Issue Details (XML | Word | Printable)

Key: HUDSON-3925
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: teilo
Reporter: syvalta
Votes: 1
Watchers: 1
Operations

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

Clear workspace before build

Created: 25/Jun/09 05:39 AM   Updated: 08/Mar/10 02:18 AM
Return to search
Component/s: m2release
Affects Version/s: current
Fix Version/s: None

File Attachments: 1. Text File m2release-clearworkspace.patch (11 kB)
2. Text File m2release-clearworkspace.patch (11 kB)

Environment: Platform: All, OS: All


 Description  « Hide

Release builds should be built from clear workspace.



syvalta added a comment - 25/Jun/09 05:43 AM

Created an attachment (id=755)
Patch that adds clear workspace, fixes race a condition and decreases copy-paste code. Sorry about the white space changes.


syvalta added a comment - 25/Jun/09 06:44 AM

Created an attachment (id=756)
Updated patch, the previous patch used next dev version when setting build description instead of the release version


teilo added a comment - 25/Jun/09 01:25 PM

Thanks for the patch but I want to understand this a bit more.

Currently releases are effectivly done from a clean checkout - which is
${workspace_loc}/target/checkout

if you want to make sure its clean you just need to add the clean goal before
release:prepare release:perfrom options in the release goals.

If your using a local m2 repository which is recommended I think cleaning the m2
repo should be pushed up to the maven core to clean - and the m2release plugin
just triggers that to clean itself.

If your not using a local m2 repo then you have other issues

Other than that what was the race condition and under what circumstances did it
manifest itself?


syvalta added a comment - 25/Jun/09 11:43 PM

I thought it as precaution to guarantee that the release is buildable from clean
checkout. But you are right, if it isn't the build will fail at release:perform.
So the patch just makes it to fail earlier (already in release:prepare before
tagging instead only in release:perform).

About the race condition: when M2ReleaseAction schedules a build it synchronizes
on the M2ReleaseBuildWrapper instance. However, M2ReleaseBuildWrapper.setUp
doesn't synchronize on anything, so it might run before M2ReleaseAction has set
the release properties, or they might be only partially set. The patch makes the
setUp() to wait M2ReleaseAction to signal that everything is set up.


teilo added a comment - 20/Jul/09 03:10 AM

Race condition is fixed in 0.3.


fabrice31 added a comment - 08/Mar/10 02:18 AM

Hi

I would like to konw when this patch will be merge to trunk and released ?
I use svn update option and I need for a release to delete my entire worspace to clean sources and also my .repository maven local folder job repo.