Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-8687

lshistory is not usable with different branches and labels for polling and changelog

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • clearcase-plugin
    • None
    • Wondows XP, Hudson 1.395, CC plugin 1.3.5

      The config spec in our project is generated and included as file in hudson. We have different branches for different VOBs and some VOBs are referenced with labels. It's tricky to enter all branches and labels in hudson to have right chagelog (lshistory). e.g.:
      "load vob1\source1" with branch "min.10"
      "load vob2\source2" with branch "min.10.01"
      "load vob2\source3" with branch "min.10.02"
      "load vob3\source1" with branch "min.10.05"

      So if we enter branches: min.10, min.10.01, min.10.02, min.10.05 and some of them are not there for some VOBs we will have errors:

      [hudson.min.10] $ cleartool lshistory -all -since 3-feb-11.12:01:38utc+0000 -fmt '\"%Nd\" \"%u\" \"%En\" \"%Vn\" \"%e\" \"%o\" \n%c\n' -branch brtype:min.10 -nco vob1\source1 vob2\source2 vob2\source3 vob3\source1
      cleartool: Error: Branch type not found: "min.10".
      cleartool: Error: Branch type not found: "min.10".
      cleartool: Error: Branch type not found: "min.10".

      [hudson.min.10] $ cleartool lshistory -all -since 3-feb-11.12:01:38utc+0000 -fmt '\"%Nd\" \"%u\" \"%En\" \"%Vn\" \"%e\" \"%o\" \n%c\n' -branch brtype:min.10.01 -nco vob1\source1 vob2\source2 vob2\source3 vob3\source1
      cleartool: Error: Branch type not found: "min.10.01".
      cleartool: Error: Branch type not found: "min.10.01".
      cleartool: Error: Branch type not found: "min.10.01".

      [hudson.min.10] $ cleartool lshistory -all -since 3-feb-11.12:01:38utc+0000 -fmt '\"%Nd\" \"%u\" \"%En\" \"%Vn\" \"%e\" \"%o\" \n%c\n' -branch brtype:min.10.02 -nco vob1\source1 vob2\source2 vob2\source3 vob3\source1
      cleartool: Error: Branch type not found: "min.10.02".
      cleartool: Error: Branch type not found: "min.10.02".
      cleartool: Error: Branch type not found: "min.10.02".

      [hudson.min.10] $ cleartool lshistory -all -since 3-feb-11.12:01:38utc+0000 -fmt '\"%Nd\" \"%u\" \"%En\" \"%Vn\" \"%e\" \"%o\" \n%c\n' -branch brtype:min.10.03 -nco vob1\source1 vob2\source2 vob2\source3 vob3\source1
      cleartool: Error: Branch type not found: "min.10.03".
      cleartool: Error: Branch type not found: "min.10.03".
      cleartool: Error: Branch type not found: "min.10.03".
      ...

      So it's more complicated if some VOBs should be used with labels and the config spec file is dynamically changeable. Because of this we use snapshot views and use the updt file as changelog:
      Log has been written to "D:\Views\hudson.min.10\update.2011-02-03T131647+0100.updt".

          [JENKINS-8687] lshistory is not usable with different branches and labels for polling and changelog

          anb0s added a comment -

          It would be good if the updt file can be used after checkout to generate hudson changelog entries. In this case there is no need to specify branches and labels for lshistory. All files with versions can be extracted from updt file and the same format can be used for describe command:
          cleartool describe -fmt "\"%Nd\" \"%u\" \"%En\" \"%Vn\" \"%e\" \"%o\" \n%c\n" vob1\source1\main.cpp@@\main\maj.10\min.10\5

          For executing lshistory after checkout, see: http://issues.jenkins-ci.org/browse/JENKINS-8684

          anb0s added a comment - It would be good if the updt file can be used after checkout to generate hudson changelog entries. In this case there is no need to specify branches and labels for lshistory. All files with versions can be extracted from updt file and the same format can be used for describe command: cleartool describe -fmt "\"%Nd\" \"%u\" \"%En\" \"%Vn\" \"%e\" \"%o\" \n%c\n" vob1\source1\main.cpp@@\main\maj.10\min.10\5 For executing lshistory after checkout, see: http://issues.jenkins-ci.org/browse/JENKINS-8684

          anb0s added a comment -

          This would only work with base clear case and snapshot views for changelog generation. For polling it's not usable. For polling we added check if config spec (and/or load rules) was changed, start new build, because then new config spec is applied to the view and we get new updt file for changelog.

          anb0s added a comment - This would only work with base clear case and snapshot views for changelog generation. For polling it's not usable. For polling we added check if config spec (and/or load rules) was changed, start new build, because then new config spec is applied to the view and we get new updt file for changelog.

          You would get a partial changeset, because if 2 changes have been done on the same file, you will only see one entry. But I agree that in your use case it is better than nothing.

          Vincent Latombe added a comment - You would get a partial changeset, because if 2 changes have been done on the same file, you will only see one entry. But I agree that in your use case it is better than nothing.

          anb0s added a comment -

          Yes, you are right. We will see only last entries, but it's ok for us, because we need list of changed files between two checkouts (builds) in snapshot view. May be it's possible to create more enties for updated files, because they are logged with old and new versions. For new files (also loaded with new load rule) it's enough to have last version information.

          I will add new option get history from updt file in snapshot views to "No" and "Branches". Also if's enabled the lshistory before checkout we will skipped. I have no idea now how to use lshistory with polling in this case...

          anb0s added a comment - Yes, you are right. We will see only last entries, but it's ok for us, because we need list of changed files between two checkouts (builds) in snapshot view. May be it's possible to create more enties for updated files, because they are logged with old and new versions. For new files (also loaded with new load rule) it's enough to have last version information. I will add new option get history from updt file in snapshot views to "No" and "Branches". Also if's enabled the lshistory before checkout we will skipped. I have no idea now how to use lshistory with polling in this case...

          anb0s added a comment -

          I added new option for base CC: "Use history from updt file (for snapshot views only)". It works for my usecase. Is it useful for other users?

          anb0s added a comment - I added new option for base CC: "Use history from updt file (for snapshot views only)". It works for my usecase. Is it useful for other users?

          anb0s added a comment -

          anb0s added a comment - Integrated patch at https://github.com/anb0s/clearcase-plugin/tree/integrate_1.3.8

          Code changed in jenkins
          User: anb0s
          Path:
          pom.xml
          src/main/java/hudson/plugins/clearcase/AbstractClearCaseScm.java
          src/main/java/hudson/plugins/clearcase/ClearCaseSCM.java
          src/main/java/hudson/plugins/clearcase/ClearTool.java
          src/main/java/hudson/plugins/clearcase/ClearToolExec.java
          src/main/java/hudson/plugins/clearcase/UpdtEntry.java
          src/main/java/hudson/plugins/clearcase/action/CheckOutAction.java
          src/main/java/hudson/plugins/clearcase/action/DynamicCheckoutAction.java
          src/main/java/hudson/plugins/clearcase/action/SnapshotCheckoutAction.java
          src/main/java/hudson/plugins/clearcase/action/UcmDynamicCheckoutAction.java
          src/main/java/hudson/plugins/clearcase/action/UcmSnapshotCheckoutAction.java
          src/main/java/hudson/plugins/clearcase/base/BaseHistoryAction.java
          src/main/java/hudson/plugins/clearcase/history/AbstractHistoryAction.java
          src/main/java/hudson/plugins/clearcase/ucm/UcmCommon.java
          src/main/java/hudson/plugins/clearcase/ucm/UcmHistoryAction.java
          src/main/java/hudson/plugins/clearcase/util/PathUtil.java
          src/main/resources/hudson/plugins/clearcase/ClearCaseSCM/config.jelly
          src/main/webapp/base/help-changeset.html
          src/test/java/hudson/plugins/clearcase/ClearToolExecTest.java
          src/test/java/hudson/plugins/clearcase/ucm/UcmCommonTest.java
          http://jenkins-ci.org/commit/clearcase-plugin/889c75d9c2ec0d3c1785868d3e9bd1b11aba952c
          Log:
          JENKINS-8687: new option "Use updt file" added. updt file will be readed after checkout in snapshot views and version information is extracted per file with desc command.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: anb0s Path: pom.xml src/main/java/hudson/plugins/clearcase/AbstractClearCaseScm.java src/main/java/hudson/plugins/clearcase/ClearCaseSCM.java src/main/java/hudson/plugins/clearcase/ClearTool.java src/main/java/hudson/plugins/clearcase/ClearToolExec.java src/main/java/hudson/plugins/clearcase/UpdtEntry.java src/main/java/hudson/plugins/clearcase/action/CheckOutAction.java src/main/java/hudson/plugins/clearcase/action/DynamicCheckoutAction.java src/main/java/hudson/plugins/clearcase/action/SnapshotCheckoutAction.java src/main/java/hudson/plugins/clearcase/action/UcmDynamicCheckoutAction.java src/main/java/hudson/plugins/clearcase/action/UcmSnapshotCheckoutAction.java src/main/java/hudson/plugins/clearcase/base/BaseHistoryAction.java src/main/java/hudson/plugins/clearcase/history/AbstractHistoryAction.java src/main/java/hudson/plugins/clearcase/ucm/UcmCommon.java src/main/java/hudson/plugins/clearcase/ucm/UcmHistoryAction.java src/main/java/hudson/plugins/clearcase/util/PathUtil.java src/main/resources/hudson/plugins/clearcase/ClearCaseSCM/config.jelly src/main/webapp/base/help-changeset.html src/test/java/hudson/plugins/clearcase/ClearToolExecTest.java src/test/java/hudson/plugins/clearcase/ucm/UcmCommonTest.java http://jenkins-ci.org/commit/clearcase-plugin/889c75d9c2ec0d3c1785868d3e9bd1b11aba952c Log: JENKINS-8687 : new option "Use updt file" added. updt file will be readed after checkout in snapshot views and version information is extracted per file with desc command.

          anb0s added a comment -

          fixed in >= 1.3.9

          anb0s added a comment - fixed in >= 1.3.9

            anb0s anb0s
            anb0s anb0s
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: