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

Problem with "changes" report if build done based on CVS label

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Component/s: cvs-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      We use CVS for version control.
      "Changes" report doesn't appear to show any changes if builds were performed
      from a label rather than as a "tip/HEAD/Latest" revision build.

      I have a project that is set up in Maven as a CI build for the development team.
      The change report works fine here. For the very same project, I do "official"
      QA builds off a label and the changelog report doesn't show any changes.

        Attachments

        1. 1816.patch
          2 kB
        2. CVSSCM.java.patch
          0.5 kB
        3. hudson-core.zip
          37 kB
        4. issue1816.patch
          1 kB

          Issue Links

            Activity

            Hide
            jferr jferr added a comment -

            Just did some research (I'm sure you already know these details, but for
            completeness); It appears that the ant task "ChangeLog" won't take tags as
            parameters, but the CVSTagDiff task will. But CVSTagDiff doesn't appear to
            include check-in comments in it's xml output.

            So, I suppose this is an enhancement if you were to add "CVSTagDiff" for builds
            that were based on tags.

            Minimally (if running CVSTagDIff doesn't work for some reason), Hudson shouldn't
            falsely display "no changes" if a build was based on a tag.

            Show
            jferr jferr added a comment - Just did some research (I'm sure you already know these details, but for completeness); It appears that the ant task "ChangeLog" won't take tags as parameters, but the CVSTagDiff task will. But CVSTagDiff doesn't appear to include check-in comments in it's xml output. So, I suppose this is an enhancement if you were to add "CVSTagDiff" for builds that were based on tags. Minimally (if running CVSTagDIff doesn't work for some reason), Hudson shouldn't falsely display "no changes" if a build was based on a tag.
            Hide
            jackgene jackgene added a comment -

            Hi,
            This affects us too, in fact in a bigger way, since we tag everything to be
            built. I was looking into this over the weekend, and I believe the problem was
            due to the version of the Ant CVS ChangeLogTask being used (it may have been a
            bug, or it may have been intended, but either way, it's been resolved in Ant
            1.7.1).

            I was able to get the 1.235 Hudson source, and update it to use the latest Ant
            task, which has partially resolved this issue. Here's everything I had to do
            (I'll be updating this source shortly):
            1. Replace everything under hudson.org.apache.tools.ant.taskdefs (and sub-
            packages) with the latest Ant source.
            2. Made some changes to the Ant task (I tried to minimize this to simplify
            future updates to the task):
            a. Re-introduced the one change Kohsuke did related to timezone issues
            (ChangeLogTask.java:235-252).
            b. Re-introduced the cvsExe property to the task (AbstractCvsTask.java:151,160-
            162,767) (Ant 1.7.1 no longer allows you to specify the CVS binary to use, and
            instead assumes that "cvs" will be in your path, Hudson still allows you to
            specify the "cvs" location, so I thought this would be a good idea to add it).
            c. Added " * @version Ant 1.7.1 (Copied into Hudson)" to JavaDoc so that we can
            keep track of which version of the Ant task is being used.
            3. Modified hudson.scm.CVSSCM to account for changes in the Ant task:
            a. Made "changeLogFile" parameter final in calcChangeLog so that it can be
            accesssed from an inner class (CVSSCM:701).
            b. Modified to pass the changeLogFile location to the Ant task using setDestfile
            (File) instead of setDeststream(OutputStream) (CVSSCM:760, CVSSCM:796).
            c. Modified to pass branch to Ant task using setTag(String) instead of setBranch
            (String) (CVSSCM:761)
            d. Modified the way we pass changedFiles to the Ant task (CVSSCM:773-783)
            e. Modified the way modules/packages are passed to the Ant task (CVSSCM:789)
            (I'll be revisiting this).

            Everything up to now has simply been to get Hudson to work with the new Ant
            task. This caused some information to appear in the change log, when builds are
            triggered based on tags. However, because there are no historical information
            associated with tags, the change log only shows the revision of the file that
            was tagged (even when there may be multiple revisions to the file since the
            last build). To resolve this, I've modified the "task.setTag(String)" line as
            follows:

            task.setTag(isTag() ? ":" + branch : branch);
            (Passing ":rev" to CVS tells it to generate change log for the revision
            tagged "rev" and before, on the same branch, per CVSNT's "cvs log --help").

            There are still a few outstanding issues:
            1. Since tags are not versioned, it is possible for a file to be committed
            before the previous build, but tagged after the build. This will cause a new
            build to be triggered. However, the change log will not include information
            about this file, since as far as CVS is concerned, the change occurred before
            the last build.
            2. Tags can be moved backwards to an older revision, or across branches, which
            will probably cause some problems.

            I'll continue to work on these issues.

            Show
            jackgene jackgene added a comment - Hi, This affects us too, in fact in a bigger way, since we tag everything to be built. I was looking into this over the weekend, and I believe the problem was due to the version of the Ant CVS ChangeLogTask being used (it may have been a bug, or it may have been intended, but either way, it's been resolved in Ant 1.7.1). I was able to get the 1.235 Hudson source, and update it to use the latest Ant task, which has partially resolved this issue. Here's everything I had to do (I'll be updating this source shortly): 1. Replace everything under hudson.org.apache.tools.ant.taskdefs (and sub- packages) with the latest Ant source. 2. Made some changes to the Ant task (I tried to minimize this to simplify future updates to the task): a. Re-introduced the one change Kohsuke did related to timezone issues (ChangeLogTask.java:235-252). b. Re-introduced the cvsExe property to the task (AbstractCvsTask.java:151,160- 162,767) (Ant 1.7.1 no longer allows you to specify the CVS binary to use, and instead assumes that "cvs" will be in your path, Hudson still allows you to specify the "cvs" location, so I thought this would be a good idea to add it). c. Added " * @version Ant 1.7.1 (Copied into Hudson)" to JavaDoc so that we can keep track of which version of the Ant task is being used. 3. Modified hudson.scm.CVSSCM to account for changes in the Ant task: a. Made "changeLogFile" parameter final in calcChangeLog so that it can be accesssed from an inner class (CVSSCM:701). b. Modified to pass the changeLogFile location to the Ant task using setDestfile (File) instead of setDeststream(OutputStream) (CVSSCM:760, CVSSCM:796). c. Modified to pass branch to Ant task using setTag(String) instead of setBranch (String) (CVSSCM:761) d. Modified the way we pass changedFiles to the Ant task (CVSSCM:773-783) e. Modified the way modules/packages are passed to the Ant task (CVSSCM:789) (I'll be revisiting this). Everything up to now has simply been to get Hudson to work with the new Ant task. This caused some information to appear in the change log, when builds are triggered based on tags. However, because there are no historical information associated with tags, the change log only shows the revision of the file that was tagged (even when there may be multiple revisions to the file since the last build). To resolve this, I've modified the "task.setTag(String)" line as follows: task.setTag(isTag() ? ":" + branch : branch); (Passing ":rev" to CVS tells it to generate change log for the revision tagged "rev" and before, on the same branch, per CVSNT's "cvs log --help"). There are still a few outstanding issues: 1. Since tags are not versioned, it is possible for a file to be committed before the previous build, but tagged after the build. This will cause a new build to be triggered. However, the change log will not include information about this file, since as far as CVS is concerned, the change occurred before the last build. 2. Tags can be moved backwards to an older revision, or across branches, which will probably cause some problems. I'll continue to work on these issues.
            Hide
            jackgene jackgene added a comment -

            Created an attachment (id=329)
            Files mentioned in my last comment in this issue.

            Show
            jackgene jackgene added a comment - Created an attachment (id=329) Files mentioned in my last comment in this issue.
            Hide
            ybubnov ybubnov added a comment -

            Created an attachment (id=839)
            small patch to fix just the problem

            Show
            ybubnov ybubnov added a comment - Created an attachment (id=839) small patch to fix just the problem
            Hide
            ybubnov ybubnov added a comment -

            I think jackgene's patch is somewhat overreacted for the problem in hand. We
            need just to specify branch or tag during 'cvs log' command.

            Show
            ybubnov ybubnov added a comment - I think jackgene's patch is somewhat overreacted for the problem in hand. We need just to specify branch or tag during 'cvs log' command.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in hudson
            User: : kohsuke
            Path:
            trunk/hudson/main/core/src/main/java/hudson/scm/CVSSCM.java
            trunk/www/changelog.html
            http://fisheye4.cenqua.com/changelog/hudson/?cs=20679
            Log:
            [FIXED JENKINS-1816] In 1.321. Applied a patch from Yury Bubnov.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/scm/CVSSCM.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=20679 Log: [FIXED JENKINS-1816] In 1.321. Applied a patch from Yury Bubnov.
            Hide
            liyatikal liyatikal added a comment -

            still doesn't work with the latest 1.323 for the cvs branch (not tag)

            Show
            liyatikal liyatikal added a comment - still doesn't work with the latest 1.323 for the cvs branch (not tag)
            Hide
            mcgrey mcgrey added a comment -

            Applied changes http://fisheye4.cenqua.com/changelog/hudson/?cs=20679 broke
            initial functionality: finding changes in CVS "branches".
            Line
            ===
            task.setBranch(branch);
            ===
            is needed to enforce ChangeLogParser find a "branch".

            Show
            mcgrey mcgrey added a comment - Applied changes http://fisheye4.cenqua.com/changelog/hudson/?cs=20679 broke initial functionality: finding changes in CVS "branches". Line === task.setBranch(branch); === is needed to enforce ChangeLogParser find a "branch".
            Hide
            mcgrey mcgrey added a comment -

            Created an attachment (id=899)
            Here is the patch to bring initial functionality back. P.S. And excuse me my misspelled "brock" instead of "broke" =)

            Show
            mcgrey mcgrey added a comment - Created an attachment (id=899) Here is the patch to bring initial functionality back. P.S. And excuse me my misspelled "brock" instead of "broke" =)
            Hide
            mcgrey mcgrey added a comment -
                • Issue 2726 has been marked as a duplicate of this issue. ***
            Show
            mcgrey mcgrey added a comment - Issue 2726 has been marked as a duplicate of this issue. ***
            Hide
            ybubnov ybubnov added a comment -

            Created an attachment (id=914)
            Proposed patch fix problem with brunches and tags in them.

            Show
            ybubnov ybubnov added a comment - Created an attachment (id=914) Proposed patch fix problem with brunches and tags in them.
            Hide
            ybubnov ybubnov added a comment -

            My previous patch broke change log calculation on CVS Branches. Mcgrey's patch
            fixed that but doesn't work with tags on branches.
            I proposed the patch that fix the problem.

            Show
            ybubnov ybubnov added a comment - My previous patch broke change log calculation on CVS Branches. Mcgrey's patch fixed that but doesn't work with tags on branches. I proposed the patch that fix the problem.
            Hide
            klaus__ klaus__ added a comment -

            When will this finally go into the official Hudson build?
            I am still waiting for the resolution of #4324, which I opened. It's the same
            issue if I am not mistaken. And I opened it in August.
            I am surprised that not too many people seem to have issues...

            Show
            klaus__ klaus__ added a comment - When will this finally go into the official Hudson build? I am still waiting for the resolution of #4324, which I opened. It's the same issue if I am not mistaken. And I opened it in August. I am surprised that not too many people seem to have issues...
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in hudson
            User: : kohsuke
            Path:
            trunk/hudson/main/core/src/main/java/hudson/model/UpdateCenter.java
            trunk/hudson/main/core/src/main/java/hudson/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java
            trunk/hudson/main/core/src/main/java/hudson/scm/CVSSCM.java
            trunk/www/changelog.html
            http://fisheye4.cenqua.com/changelog/hudson/?cs=23071
            Log:
            [FIXED JENKINS-1816] in 1.331. Applied a patch from ybubnov, and made him a committer.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/model/UpdateCenter.java trunk/hudson/main/core/src/main/java/hudson/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java trunk/hudson/main/core/src/main/java/hudson/scm/CVSSCM.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=23071 Log: [FIXED JENKINS-1816] in 1.331. Applied a patch from ybubnov, and made him a committer.
            Hide
            kohsuke Kohsuke Kawaguchi added a comment -
                • Issue 4324 has been marked as a duplicate of this issue. ***
            Show
            kohsuke Kohsuke Kawaguchi added a comment - Issue 4324 has been marked as a duplicate of this issue. ***
            Hide
            klaus__ klaus__ added a comment -

            Just upgraded to Hudson 1.331.. and it works!
            Thanks

            Show
            klaus__ klaus__ added a comment - Just upgraded to Hudson 1.331.. and it works! Thanks

              People

              • Assignee:
                Unassigned
                Reporter:
                jferr jferr
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: