Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-2542

Building from CVS tag with force clean results in no changes checked out after initial build.

      I have a project with repository configured as follows:

      Build from CVS Branch/Tag
      Tag: PROJECT_0_1_7

      Force Clean Builds: Checked

      The initial checkout and build works fine.

      Bamboo runs this:

      Running CVS command: 'checkout -P -N -r PROJECT_0_1_7 Project '<br />
                   ... in: '/data/bamboo2/xml-data/build-dir/PROJECT-RELEASE'<br />
                   ... CVSROOT: '/data/cvs/cvs'
      

      However, on subsequent builds:

      • force clean removes the checked out code as expected
      • then nothing gets checked out!
      Running CVS command: 'checkout -P -N -r PROJECT_0_1_7 -D 2008-04-30 15:33:23 +1000 Project '<br />
                   ... in: '/data/bamboo2/xml-data/build-dir/PROJECT-RELEASE'<br />
                   ... CVSROOT: '/data/cvs/cvs'
      

      The build fails because no files are there.

      I don't think the -D option makes any sense in this case.

          Form Name

            [BAM-2542] Building from CVS tag with force clean results in no changes checked out after initial build.

            mail to Krystian:

            The issues with -D in the cvs command are numberless. Have a look at all the linked support cases where -DCVS_FORCE_CHECKOUT_TO_LATEST helped.

            Bamboo holds on to the wrong version string (in -D<version-string> and does not move back or forth. Possibly tweak the DB and enter a wrong version string if you can't reproduce.

            Ulrich Kuhnhardt [Atlassian] added a comment - mail to Krystian: The issues with -D in the cvs command are numberless. Have a look at all the linked support cases where -DCVS_FORCE_CHECKOUT_TO_LATEST helped. Bamboo holds on to the wrong version string (in -D<version-string> and does not move back or forth. Possibly tweak the DB and enter a wrong version string if you can't reproduce.

            comment from https://support.atlassian.com/browse/BSP-2452

            Just out of curiosity: Why do you do checkouts with "-D" for manually triggered builds where the date is not set to the date when the "build" button was clicked?

            Ulrich Kuhnhardt [Atlassian] added a comment - comment from https://support.atlassian.com/browse/BSP-2452 Just out of curiosity: Why do you do checkouts with "-D" for manually triggered builds where the date is not set to the date when the "build" button was clicked?

            We got bitten by this bug. We used a Bamboo variable to specify a CVS branch. After changing the value of the variable Bamoo tried to checkout the branch with "-D". The date for the checkout was the date of the last successful build (which was several month ago). I temporaily set the branch of the buildplan to HEAD, built the project, and then set it back to the variable.
            The Bamboo version is 2.2.1. The build was triggered manually.

            Just out of curiosity: Why do you do checkouts with "-D" for manually triggered builds where the date is not set to the date when the "build" button was clicked?

            Wilfried Weissmann added a comment - We got bitten by this bug. We used a Bamboo variable to specify a CVS branch. After changing the value of the variable Bamoo tried to checkout the branch with "-D". The date for the checkout was the date of the last successful build (which was several month ago). I temporaily set the branch of the buildplan to HEAD, built the project, and then set it back to the variable. The Bamboo version is 2.2.1. The build was triggered manually. Just out of curiosity: Why do you do checkouts with "-D" for manually triggered builds where the date is not set to the date when the "build" button was clicked?

            CVS config screen should distinguish for

            • Head with optional 'check out to latest' checkbox - if not checked use cvs -D
            • Branch with optional 'check out to latest' checkbox - if not checked use cvs -D
            • Tag - automatically apply 'checkout to latest' - do not use cvs -D,

            If the plan is a dependent plan cvs -D should override user settings.

            https://support.atlassian.com/browse/BSP-1732

            Ulrich Kuhnhardt [Atlassian] added a comment - - edited CVS config screen should distinguish for Head with optional 'check out to latest' checkbox - if not checked use cvs -D Branch with optional 'check out to latest' checkbox - if not checked use cvs -D Tag - automatically apply 'checkout to latest' - do not use cvs -D, If the plan is a dependent plan cvs -D should override user settings. https://support.atlassian.com/browse/BSP-1732

            Hi Mark,

            The workaround does the trick for our use case, thanks.

            2008-07-18 07:57:25,276 INFO [BAM::Default Agent::Agent] [CheckoutUpdateForBuild] Updating source code to revision: 2008-05-01 10:30:08 +1000
            2008-07-18 07:57:25,281 INFO [BAM::Default Agent::Agent] [CvsRepositoryManager] The flag CVS_FORCE_CHECKOUT_TO_LATEST is set to true. CVS checkout will ignore datestamp.
            2008-07-18 07:57:25,535 INFO [BAM::Default Agent::Agent] [CvsRepositoryManager]
            Running CVS command: 'checkout -P -N -kb -r PROJECT_0_1_7 Event '<br />
                         ... in: '/data/bamboo2/xml-data/build-dir/PROJECT-RELEASE'<br />
                         ... CVSROOT: '/data/cvs/cvs'
            

            Cheers,
            Brad.

            Brad Harvey added a comment - Hi Mark, The workaround does the trick for our use case, thanks. 2008-07-18 07:57:25,276 INFO [BAM::Default Agent::Agent] [CheckoutUpdateForBuild] Updating source code to revision: 2008-05-01 10:30:08 +1000 2008-07-18 07:57:25,281 INFO [BAM::Default Agent::Agent] [CvsRepositoryManager] The flag CVS_FORCE_CHECKOUT_TO_LATEST is set to true. CVS checkout will ignore datestamp. 2008-07-18 07:57:25,535 INFO [BAM::Default Agent::Agent] [CvsRepositoryManager] Running CVS command: 'checkout -P -N -kb -r PROJECT_0_1_7 Event '<br /> ... in: '/data/bamboo2/xml-data/build-dir/PROJECT-RELEASE'<br /> ... CVSROOT: '/data/cvs/cvs' Cheers, Brad.

            MarkC added a comment -

            Brad,

            2.0.6 does indeed have the compatibility flag. Please check it out and let us know how you go.

            Cheers,

            Mark C

            MarkC added a comment - Brad, 2.0.6 does indeed have the compatibility flag. Please check it out and let us know how you go. Cheers, Mark C

            cvs -t -d YOUR_CVS_ROOT checkout -P -N -kb -r PROJECT_0_1_7 -D"2008-04-30 15:33:23 +1000" Project
            

            If I run this, nothing is checked out (not even empty directories). If I remove the -D, everything gets checked out as expected.

            Brad Harvey added a comment - cvs -t -d YOUR_CVS_ROOT checkout -P -N -kb -r PROJECT_0_1_7 -D "2008-04-30 15:33:23 +1000" Project If I run this, nothing is checked out (not even empty directories). If I remove the -D, everything gets checked out as expected.

            Hi Mark,

            Sorry for delayed response - I've been on paternity leave dealing with some slightly messier I/O problems!

            Catalin described the problem nicely - it is definitely the non branch tags causing the issue. Do you still need the extra debugging output?

            Can you confirm that the -DCVS_FORCE_CHECKOUT_TO_LATEST=true workaround made it into 2.0.6? If so I'll try it out.

            Thanks,
            Brad.

            Brad Harvey added a comment - Hi Mark, Sorry for delayed response - I've been on paternity leave dealing with some slightly messier I/O problems! Catalin described the problem nicely - it is definitely the non branch tags causing the issue. Do you still need the extra debugging output? Can you confirm that the -DCVS_FORCE_CHECKOUT_TO_LATEST=true workaround made it into 2.0.6? If so I'll try it out. Thanks, Brad.

            Hi there Mark,

            The problem appears only when building a non-branch tag. I think that when given a tag name as value for "-r", having specified "-D" doesn't make sense (according to CVS). In our case, we had to modify the included javacvs lib to ignore "-D" when a tag is also present as parameter.

            Best regards,
            Catalin

            Catalin Andrei added a comment - Hi there Mark, The problem appears only when building a non-branch tag. I think that when given a tag name as value for "-r", having specified "-D" doesn't make sense (according to CVS). In our case, we had to modify the included javacvs lib to ignore "-D" when a tag is also present as parameter. Best regards, Catalin

            MarkC added a comment -

            Guys,

            Sorry we've taken so long to look into this.

            I've tried to reproduce the problem (by building a branch + force clean checkout tags) against CVS 1.11.20 and 1.12.13 and they seem to checkout cleanly without a problem.

            Can you try starting Bamboo with the "-DcvsClientLog=system" flag? This will give us detailed CVS logging for all CVS commands. If you can then attach the full logs to this issue (or attach it to a new issue at https://support.atlassian.com/ if you need to keep it private), then we can have a look into what's going on.

            Brad, what is returned if you run on the command line:

            cvs -t -d YOUR_CVS_ROOT checkout -P -N -kb -r PROJECT_0_1_7 -D"2008-04-30 15:33:23 +1000" Project
            

            on the command line? Can you also add the output for that command?

            I'm going to attempt put in a workaround for this issue for 2.0.6 (due out tomorrow), which allows you to disable checking out against a date. This was the default behaviour and should be more compatible. In 2.0.6, if you add a flag -DCVS_FORCE_CHECKOUT_TO_LATEST=true Bamboo will not attempt to checkout to a date. This can be a workaround until we can figure out exactly what's going on.

            Cheers,

            Mark C

            MarkC added a comment - Guys, Sorry we've taken so long to look into this. I've tried to reproduce the problem (by building a branch + force clean checkout tags) against CVS 1.11.20 and 1.12.13 and they seem to checkout cleanly without a problem. Can you try starting Bamboo with the "-DcvsClientLog=system" flag? This will give us detailed CVS logging for all CVS commands. If you can then attach the full logs to this issue (or attach it to a new issue at https://support.atlassian.com/ if you need to keep it private), then we can have a look into what's going on. Brad, what is returned if you run on the command line: cvs -t -d YOUR_CVS_ROOT checkout -P -N -kb -r PROJECT_0_1_7 -D"2008-04-30 15:33:23 +1000" Project on the command line? Can you also add the output for that command? I'm going to attempt put in a workaround for this issue for 2.0.6 (due out tomorrow), which allows you to disable checking out against a date. This was the default behaviour and should be more compatible. In 2.0.6, if you add a flag -DCVS_FORCE_CHECKOUT_TO_LATEST=true Bamboo will not attempt to checkout to a date. This can be a workaround until we can figure out exactly what's going on. Cheers, Mark C

              kbrazulewicz Krystian Brazulewicz
              210ff0bdcd43 Brad Harvey
              Affected customers:
              3 This affects my team
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 17h
                  17h