History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CIB-1088
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Christian Foisy
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Pulse

Patch for personal builds not applied correctly in presence of cvs modules

Created: 11/May/07 04:08 PM   Updated: 24/May/07 04:12 AM
Component/s: Personal
Affects Version/s: 1.2.26
Fix Version/s: 1.2.27

Environment: Pulse 1.2.22


 Description  « Hide
Our project is built from two top-level cvs directory, say TopDir1 and TopDir2. Since pulse allows a single check out per pulse project, we have a cvs module called say MyModule including the two top level directory.

Here is the problem. Assume file TopDir1/modified_file is changed and a personal build is requested. Checking out module MyModule creates the directory structure:

MyModule/
      TopDir1
      TopDir2

unfortunately on the build agent the patch is applied but without the module top-level directory. On the build agent we have:

Module/
      TopDir1
      TopDir2
TopDir1/modified_file

I know that cvs modules are not very well-known (see http://ximbiot.com/cvs/manual/cvs-1.12.13/cvs_18.html#SEC177 for info) and maybe tricky to deal with automatically from pulse point of view. In our case the name of the module is also the name of the top-level directory with the cvs top-level directories directly above as shown above.


 All   Comments   Change History      Sort Order:
Daniel Ostermeier - 14/May/07 02:38 AM
Hi Christian,

I see. Unfortunately, at the moment, pulse attempts to simply handle the common case and deal with this problem via some careful user defined working directories. It appears that this is not enough, that pulse is going to need to detect the module type and behave accordingly. There is already some work planned to handle this since Pulses' handling of cvs modules needs to be smarter - in particular, it needs to read and understand the cvs modules file - so that it can correctly handle these situations and remove the need for users playing around with the working directory property for there builds.

Unfortunately, this is more than a quick patch, and so will need to be scheduled in 2.0.x / 2.x sometime, sooner rather than later I expect. We are entering the final stretch for 2.0.0 so are devoting as much effort to that as practical.

Cheers,
-Daniel


Christian Foisy - 14/May/07 02:15 PM
Daniel,

     I understand easily that full-blown automatic cvs module handling is far from being a quick patch. My suggestion to solve our very immediate need is to have a new pulse property variable called say cvs.prefix or somesuch. Everything stays exactly the same except that on the server side cvs.prefix is used to prefix all patched filenames.

What do you think?

Christian

Daniel Ostermeier - 15/May/07 01:48 PM
Hi Christian,

This is certainly something that is possible. I will schedule this for the next release, due out early next week.

Regards,
-Daniel

Christian Foisy - 18/May/07 03:57 PM
Thanks Daniel. Looking forward to it.

Daniel Ostermeier - 20/May/07 10:29 PM
The properties available are as follows:

1) personal.patch.prefix.default : a default prefix to be applied to all personal builds when they are applied to the source checkout during bootstrapping
2) personal.patch.prefix.<projectName> : a project specific prefix that can be specified on a per project level.

If 2 is available, it is used. If not, 1 is used if available. If neither are specified, then the existing behaviour will apply


Christian Foisy - 22/May/07 04:11 PM
Daniel,

    Maybe there is something I quite doesn't catch but I can't activate the patch prefix with 1.2.27.

Here is the content of .pulse.properties in directory DFFileDelivery:

[camlf@bigboy DFFileDelivery]$ cat .pulse.properties
project=File Delivery
specification=FDFT Build+Tests
cvs.password=fountain
personal.patch.prefix.default=FDFT
personal.patch.prefix.File Delivery=FDFT

(I tried with only personal.patch.prefix.default first without success).

Starting the personal build produces:

[camlf@bigboy DFFileDelivery]$ pulse personal
Pulse password:
Updating working copy...
   ? .pulse.properties
  M Makefile
Update complete.
Getting working copy status...
  MODIFIED Makefile
Status retrieved.
Creating patch archive...
  meta.xml
  files/DFFileDelivery/Makefile
Patch created.
Sending patch to pulse server...
Patch accepted: personal build 94.

which is OK since Makefile was the only modified file.

Here is the result on the agent:

[christian@dfeng4-mdk base]$ ls
DFFileDelivery/ FDFT/
[christian@dfeng4-mdk base]$ ls DFFileDelivery/
Makefile
[christian@dfeng4-mdk base]$ ls FDFT/
CVS/ DFFileDelivery/ DFTools/
[christian@dfeng4-mdk base]$ ls FDFT/DFFileDelivery/Makefile
FDFT/DFFileDelivery/Makefile
[christian@dfeng4-mdk base]$ diff DFFileDelivery/Makefile FDFT/DFFileDelivery/Makefile
344c344
< ppulseTest:
---
> pulseTest:

This shows that the FDFT prefix wasn't used to patch FDFT/DFFileDelivery/Makefile. Any fix suggestion?

Daniel Ostermeier - 22/May/07 04:24 PM
Hi Christian,

Ahh, I see.

The properties that you need to apply are actually system properties on the server side, not properties in the configuration on the client side, although that is a much better place for them. I should have thought of that...

See http://confluence.zutubi.com/display/pulse0102/System+Properties for details on how to set these up as system properties.

How many projects do you have that need this patch? If it is going to be a hassle for you to maintain, i will fix it so that it becomes a client side property (as you expected).

Cheers,
-Daniel

Christian Foisy - 22/May/07 05:25 PM
Daniel,

    In fact it is better that they are system properties (I didn't know about them) since I don't have to tell developers how to customize their client property.

This being said I set the system properties as per your provided link but it still doesn't work. Just to be sure I tried also with pulse.personal.patch.prefix.default since this seems to be the standard naming scheme, again without success. I also made sure to restart the server after each change.

[christian@pit config]$ pwd
/home/christian/.pulse/data/config
[christian@pit config]$ ls -alt
total 56
drwxrwxr-x 3 christian christian 4096 May 22 10:20 .
-rw-rw-r-- 1 christian christian 76 May 22 10:01 system.properties
-rw-rw-r-- 1 christian christian 569 May 17 14:27 pulse.properties
drwxrwxr-x 9 christian christian 4096 Feb 13 18:21 ..
-rw-rw-r-- 1 christian christian 64 Feb 6 17:22 service.token
-rw-rw-r-- 1 christian christian 1736 Feb 6 17:20 database.properties
drwxr-xr-x 3 christian christian 4096 Feb 4 20:22 templates
[christian@pit config]$ cat system.properties
personal.patch.prefix.default=FDFT
pulse.personal.patch.prefix.default=FDFT
[christian@pit config]$

How exactly should the property setup be? Moreover is project names have spaces in them what is the correct syntax for the property file?

Daniel Ostermeier - 23/May/07 06:39 AM
Hi Christian,

A white space character can be represented by escaping it with a '\'. So, the project File Delivery can be represented by

personal.patch.prefix.File\ Delivery=FDFT

Regarding the pulse.per...., that is probably what I should have named it. However, rest assured that the properties are:

personal.patch.prefix.default
personal.patch.prefix.<projectName>

After updating the system.properties file, did you restart pulse? This file is only read on startup, so modifications will require a restart.

Cheers,
-Daniel

Christian Foisy - 23/May/07 03:19 PM
Hey Daniel,

     Still no luck, either with default or with the project name and making sure the server was restarted. Is there a way to verify that the server effectively read those new properties? I suspect that either the new properties are not effective for some reason, otherwise your test config is different enough from ours and it doesn't kick in on our side.

Daniel Ostermeier - 24/May/07 01:27 AM
Hi Christian,

I can think of one possible reason why this is not working. Is your build buy any chance running on a remote agent? If so, can you please try updating the config/system.properties file for that agent? This is not a case that I had considered previously, but would be a reason why you are seeing the behaviour that you are seeing.

The system properties need to be available to the process running the bootstrap, which is the agent. It just happens that with all my testing I was using the agent built into the master.

Please let me know how you go, and my apologies for not considering this option earlier.

Cheers,
-Daniel

Christian Foisy - 24/May/07 04:06 AM
Daniel,

     Yes that was it. I was dead sure that the server was "calling the shots" in terms of what happens on the agent. This is a workable solution (we don't have that many projects requiring this trick) but I like very much the fact that all agents are centrally managed through the server. This fix goes a bit against this but I prefer this over having no personal build for those projects :-)

Thanks again for the quick turnaround, always appreciated.

Christian

Daniel Ostermeier - 24/May/07 04:12 AM
Hi Christian,

Good to hear. We agree that the agents should be centrally managed by pulse, and to a large extent this is the case.

Since the patch is just that, a patch, I took the quickest route possible to implement this, hence using the system.properties. Future functionality will not be so sly :)

Cheers,
-Daniel