Issue Details (XML | Word | Printable)

Key: HUDSON-4569
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: vlatombe
Reporter: ktetzlaff
Votes: 0
Watchers: 1
Operations

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

Use 'cleartool setcs -current' instead of 'cleartool update'

Created: 28/Sep/09 05:05 PM   Updated: 05/May/10 11:38 AM   Resolved: 11/Apr/10 09:40 AM
Return to search
Component/s: clearcase
Affects Version/s: current
Fix Version/s: None

File Attachments: 1. Text File UcmSnapshotCheckoutAction.patch (5 kB)

Environment: Platform: All, OS: All


 Description  « Hide

ClearCase config specs can include files containing additional rules. When
updating a view with a config spec containing include statements, the included
files are not re-evaluated. If an included file has changed the change is only
seen by ClearCase when the config spec gets re-evaluated. This can be achieved
by calling:

cleartool setcs -current

Since apart from re-evaluating the config spec 'cleartool setcs -current'
behaves exactly the same as 'cleartool update' i would propose to replace the
use of 'cleartool update' with 'cleartool setcs -current'.



Sort Order: Ascending order - Click to sort in descending order
gbois added a comment - 12/Oct/09 12:38 PM

Added myself to cc


gbois added a comment - 12/Oct/09 12:43 PM

Otherwise, what do you think about 'ckeartool setcs -tag viewName -def' as first
command executed by the plugin for snapshot views?


abayer added a comment - 12/Oct/09 01:25 PM

I'm planning to switch to "setcs -current" - I actually had a good chunk of the
work done, but hadn't committed it yet when my laptop went kerplooie, so I need
to recreate the work. Shouldn't be too hard - I'll try to have it committed
within the week.

I'm aiming at a 1.1 release once we've accumulated enough misc bug fixes
(including a few requested by another group at my workplace, which haven't yet
been filed as bugs, though).


ktetzlaff added a comment - 12/Oct/09 02:01 PM

I've no access to CC from home so i cannot really verify this. But the
description for setcs -tag states that it is only intended for dynamic views.
Also -default would just reset the config spec to the default one (which i think
is typically just something like:

element * CHECKEDOUT
element * /main/LATEST

and this is definitely not what i would want).

Regarding setcs -current: it would then probably make sense to also add
-overwrite or -rename to convert potential hijacked files back to the VOB
version. Normally, there should not be any hijacked file in a view created and
used by hudson. But i've seen it happen occasionally (e.g. due to problems
during a view update). I think i would actually prefer to just use overwrite
(avoids cluttering the view with .keep files):

cleartool setcs -overwrite -current


scm_issue_link added a comment - 12/Oct/09 02:01 PM

Code changed in hudson
User: : abayer
Path:
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearToolDynamic.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearToolSnapshot.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/action/DynamicCheckoutAction.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/action/SnapshotCheckoutAction.java
trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/ClearToolDynamicTest.java
trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/ClearToolSnapshotTest.java
trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/action/DynamicCheckoutActionTest.java
trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/action/SnapshotCheckoutActionTest.java
http://fisheye4.cenqua.com/changelog/hudson/?cs=22683
Log:
HUDSON-4569 Work-in-progress on switching to setcs -current instead of update - still got some work to go, but I had this on a different machine than I'm doing development now, so here goes...


abayer added a comment - 12/Oct/09 02:11 PM

Agreed on the -overwrite - that's equivalent to how we're running update now
(with -force).

I'll hopefully get some live tests done with this later this week.


abayer added a comment - 14/Oct/09 10:48 AM

Done - this'll be in 1.1, which is coming out quite soon.


cerimorgan added a comment - 07/Jan/10 04:23 PM

Version 1.1 has broken ClearCase access for me. I believe the -overwrite arg is unrecognized by my version cleartool. Here's the error message:
$ cleartool setcs -current -overwrite
cleartool: Error: Unrecognized option "-overwrite"
Usage: setcs [-tag view-tag] [-force]
{-current | -default | -stream | pname}
FATAL: Base ClearCase failed. exit code=1
FATAL: java.io.IOException: cleartool did not return the expected exit code. Command line="setcs -current -overwrite", actual exit code=1

I'm using an older version of the ClearCase client (on Linux):
% cleartool -version
ClearCase version 2003.06.00 (Tue Dec 16 21:15:58 EST 2003)
clearcase_p2003.06.00-55 (Tue May 13 11:49:56 EDT 2008)
clearcase_p2003.06.00-56 (Tue May 13 22:14:31 EDT 2008)
cleartool 2003.06.10+ (Fri May 2 00:28:18 EDT 2008)
db_server 2003.06.10+ (Fri May 2 00:22:09 EDT 2008)
VOB database schema version: 53

Any suggestions for fixes on my side? Thanks... love the plugin!


abayer added a comment - 07/Jan/10 05:36 PM

Huh, yeah, I thought I'd tested it against 2003.06, but I guess I only tested it against 7.x. Could you open a new bug for this? I'll get a fix out ASAP.


cerimorgan added a comment - 07/Jan/10 07:23 PM

Created Issue 5212. Thanks for the quick response. Please let me know if I can help with testing.


vlatombe added a comment - 10/Feb/10 08:21 AM - edited

(Clearcase UCM) Using 1.1.1, this doesn't seem fixed to me, it is still running cleartool update instead of the cleartool setcs command and therefore my view doesn't get new config specs.

Is there anything else to check besides checking the 'Use update' checkbox?


abayer added a comment - 10/Feb/10 10:36 AM

There seem to be a few areas of weirdness with the UCM snapshot views. We're calling setcs with a config spec (with the config spec just being what we got from running catcs on the view) when the load rules change - which, if I remember correctly, we're doing because that's the only way to remove defunct load rules. Then we run cleartool updates for each load rule - I'm not sure why we do that. It might be a legacy thing - can you think of a reason to do that rather than the setcs -current?


vlatombe added a comment - 10/Feb/10 12:11 PM

Here is the list of use cases that it should cover

  • config spec update on the stream (after a rebase) : that is my current problem, it should call something like setcs -stream to update config spec from server (I have to verify if it's enough)
  • add a new load rule : it seems it can only be done via update -add_loadrules pname1 [pname2] ...
  • remove a load rule : I don't think it's possible besides cleaning config spec and re-adding all load rules that we have, since there is no command update -rem_loadrules or similar

In any case this is not optimal because to cover all use cases we need 2 updates : one for updating config spec from server, one other if we want to include new load rules, although this could be optimized if we can compute the difference between the current load rules, and the set that generated the previous config spec for the view.


vlatombe added a comment - 02/Mar/10 01:39 AM

The only way I could find to update correctly the config spec is to perform a full update after load rules update. A partial update doesn't update config specs


vlatombe added a comment - 17/Mar/10 11:34 AM - edited

After hitting this problem again, I came up with a patch that uses setcs every time. In my case the previous code were still calling cleartool update on every load rule, because the required config spec update was not due to the change of load rules.

This code triggers a full update of the view with correctly updated config spec, the logic is also way simpler than before.
Note : I made the patch from tag 1.1.1


scm_issue_link added a comment - 31/Mar/10 05:22 AM

Code changed in hudson
User: : vlatombe
Path:
http://hudson-ci.org/commit/29640
Log:
Branch for HUDSON-4569, as impact needs to be tested


scm_issue_link added a comment - 31/Mar/10 05:37 AM

Code changed in hudson
User: : vlatombe
Path:
http://hudson-ci.org/commit/29640
Log:
Branch for HUDSON-4569, as impact needs to be tested


scm_issue_link added a comment - 09/Apr/10 01:52 AM

Code changed in hudson
User: : vlatombe
Path:
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/AbstractClearCaseScm.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/ClearCaseDataAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/ClearCasePublisher.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/ClearCaseReportAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/ClearCaseSCM.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/ClearCaseUcmSCM.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/ClearTool.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/ClearToolExec.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/ClearToolSnapshot.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/PluginImpl.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/UcmView.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/View.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/action/AbstractCheckoutAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/action/ChangeLogAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/action/CheckOutAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/action/DefaultPollAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/action/DynamicCheckoutAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/action/PollAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/action/SaveChangeLogAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/action/SnapshotCheckoutAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/action/UcmDynamicCheckoutAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/action/UcmSnapshotCheckoutAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/base/BaseChangeLogAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/history/AbstractHistoryAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/history/HistoryAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/ucm/UcmChangeLogAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/ucm/UcmCommon.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/ucm/UcmHistoryAction.java
branches/HUDSON-4569/src/main/java/hudson/plugins/clearcase/util/PathUtil.java
branches/HUDSON-4569/src/main/resources/hudson/plugins/clearcase/ClearCaseReportAction/index.jelly
branches/HUDSON-4569/src/main/resources/hudson/plugins/clearcase/ClearCaseSCM/global.jelly
branches/HUDSON-4569/src/main/resources/hudson/plugins/clearcase/ClearCaseUcmSCM/config.jelly
branches/HUDSON-4569/src/main/webapp/standardViewPath.html
branches/HUDSON-4569/src/main/webapp/stream.html
branches/HUDSON-4569/src/main/webapp/viewpath.html
branches/HUDSON-4569/src/test/java/hudson/plugins/clearcase/AbstractClearCaseScmTest.java
branches/HUDSON-4569/src/test/java/hudson/plugins/clearcase/ClearCaseSCMTest.java
branches/HUDSON-4569/src/test/java/hudson/plugins/clearcase/ClearCaseUcmSCMDummy.java
branches/HUDSON-4569/src/test/java/hudson/plugins/clearcase/ClearCaseUcmSCMTest.java
branches/HUDSON-4569/src/test/java/hudson/plugins/clearcase/ClearToolSnapshotTest.java
branches/HUDSON-4569/src/test/java/hudson/plugins/clearcase/action/DynamicCheckoutActionTest.java
branches/HUDSON-4569/src/test/java/hudson/plugins/clearcase/action/SnapshotCheckoutActionTest.java
branches/HUDSON-4569/src/test/java/hudson/plugins/clearcase/action/UcmSnapshotCheckoutActionTest.java
http://hudson-ci.org/commit/29904
Log:
[ HUDSON-4569] Use 'cleartool setcs -current' instead of 'cleartool update'

  • User should be able to select a view path different than view tag
  • UCM : After a rebase on stream, view config spec is not updated

vlatombe added a comment - 11/Apr/10 09:40 AM

Fixed in trunk the remaining problems. In most cases, the solution is to perform a full update, which triggers a re-evaluation of the config spec from the stream. I preferred this to setcs -stream because update is more flexible.


scm_issue_link added a comment - 12/Apr/10 03:00 AM

Code changed in hudson
User: : vlatombe
Path:
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/AbstractClearCaseScm.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearCaseSCM.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearCaseUcmSCM.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearTool.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearToolDynamic.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearToolDynamicUCM.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearToolExec.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearToolSnapshot.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ConfigSpec.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/PluginImpl.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/action/AbstractCheckoutAction.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/action/SnapshotCheckoutAction.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/action/UcmSnapshotCheckoutAction.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/util/PathUtil.java
trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/AbstractClearCaseScmTest.java
trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/ClearToolExecTest.java
trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/ClearToolSnapshotTest.java
trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/action/SnapshotCheckoutActionTest.java
trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/action/UcmSnapshotCheckoutActionTest.java
http://hudson-ci.org/commit/29961
Log:
[FIXED - HUDSON-5574] Removing existing snapshot views often fails
[FIXED - HUDSON-4569] Use 'cleartool setcs -current' instead of 'cleartool update'

  • Better handling of job renaming/deletion and behaviour regarding custom workspace
  • Plugin will be more resilient in case of existing view tag or view path in the way. Instead of failing, it will remove the view tag and/or rename the view path.
  • UCM : view config spec should be more consistently sync'ed with stream
  • Dev : new unit tests to cover addition/removal of load rules on an existing view

scm_issue_link added a comment - 12/Apr/10 04:25 AM

Code changed in hudson
User: : vlatombe
Path:
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/AbstractClearCaseScm.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearCaseSCM.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearCaseUcmSCM.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearTool.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearToolDynamic.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearToolDynamicUCM.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearToolExec.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearToolSnapshot.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ConfigSpec.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/PluginImpl.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/action/AbstractCheckoutAction.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/action/SnapshotCheckoutAction.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/action/UcmSnapshotCheckoutAction.java
trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/util/PathUtil.java
trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/AbstractClearCaseScmTest.java
trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/ClearToolExecTest.java
trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/ClearToolSnapshotTest.java
trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/action/SnapshotCheckoutActionTest.java
trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/action/UcmSnapshotCheckoutActionTest.java
http://hudson-ci.org/commit/29961
Log:
[FIXED - HUDSON-5574] Removing existing snapshot views often fails
[FIXED - HUDSON-4569] Use 'cleartool setcs -current' instead of 'cleartool update'

  • Better handling of job renaming/deletion and behaviour regarding custom workspace
  • Plugin will be more resilient in case of existing view tag or view path in the way. Instead of failing, it will remove the view tag and/or rename the view path.
  • UCM : view config spec should be more consistently sync'ed with stream
  • Dev : new unit tests to cover addition/removal of load rules on an existing view