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

Should perform clean checkout if update fails

    Details

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

      Description

      In a project configured to use CVS update mode, and doing incremental builds (or
      faulty clean steps), it can happen that CVS updates produce conflicts. For
      example, on occasion what was previously a .cvsignore'd build product becomes
      checked into the repository - say, ANTLR-generated files if you no longer wish
      to depend on antlr.jar for regular builds. In such cases, "cvs up" fails and the
      build breaks. There is no way to correct the build from the admin GUI, either;
      you need to log in to the server and delete the workspace.

      If a project is configured to use update mode, and the update command fails, I
      think Hudson should automatically attempt a clean checkout, in the interests of
      robustness and zero maintenance.

        Attachments

          Activity

          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          Similar issue happens with subversion, when a svn-controlled directory is
          deleted first, leaving some local artifacts (like maven's target dir) behind,
          and then the directory is added back later.

          So this is useful across the board for other SCMS, too.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - Similar issue happens with subversion, when a svn-controlled directory is deleted first, leaving some local artifacts (like maven's target dir) behind, and then the directory is added back later. So this is useful across the board for other SCMS, too.
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          Note that this is now implemented for Subversion.

          In case of CVS, it's bit hard for us to decide when the retry would be appropriate.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - Note that this is now implemented for Subversion. In case of CVS, it's bit hard for us to decide when the retry would be appropriate.
          Hide
          jglick Jesse Glick added a comment -

          For Mercurial, I would love to see every pull preceded by

          hg up -C .

          to make sure there are no local modifications in the workspace; and every build
          finished by the equivalent of

          mods=`hg st`
          test -z "$mods" || exit

          to at least mark a build unstable if after completion it has modified some
          source files, deleted them, created non-ignorable build products, etc.

          Show
          jglick Jesse Glick added a comment - For Mercurial, I would love to see every pull preceded by hg up -C . to make sure there are no local modifications in the workspace; and every build finished by the equivalent of mods=`hg st` test -z "$mods" || exit to at least mark a build unstable if after completion it has modified some source files, deleted them, created non-ignorable build products, etc.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Michael Clarke
          Path:
          src/main/java/hudson/scm/CVSSCM.java
          src/main/resources/hudson/scm/CVSSCM/config.jelly
          http://jenkins-ci.org/commit/cvs-plugin/794afd76127191e6a5174647d0c2620f0aadd915
          Log:
          [FIXED JENKINS-753] Allows performing a clean checkout if update fails
          [FIXED JENKINS-12595] CVS gets passed the module name so creates lock
          files in the correct directory on the remote server
          [FIXED JENKINS-12581] CVS plugin now forces a module name in the udpate
          command to prevent an attempt to checkout all remote modules

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michael Clarke Path: src/main/java/hudson/scm/CVSSCM.java src/main/resources/hudson/scm/CVSSCM/config.jelly http://jenkins-ci.org/commit/cvs-plugin/794afd76127191e6a5174647d0c2620f0aadd915 Log: [FIXED JENKINS-753] Allows performing a clean checkout if update fails [FIXED JENKINS-12595] CVS gets passed the module name so creates lock files in the correct directory on the remote server [FIXED JENKINS-12581] CVS plugin now forces a module name in the udpate command to prevent an attempt to checkout all remote modules
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Michael Clarke
          Path:
          src/main/java/hudson/scm/CVSSCM.java
          http://jenkins-ci.org/commit/cvs-plugin/1ccef67edc26350d544b2ae5ebfebed5ed91ac8c
          Log:
          JENKINS-12599 Changing how password is set in connections so as not to
          modify port numbers (as per comments #2 and #3)
          JENKINS-753 Stop processing if update fails and we're not going to do
          a workspace clean

          Compare: https://github.com/jenkinsci/cvs-plugin/compare/39da798...1ccef67

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michael Clarke Path: src/main/java/hudson/scm/CVSSCM.java http://jenkins-ci.org/commit/cvs-plugin/1ccef67edc26350d544b2ae5ebfebed5ed91ac8c Log: JENKINS-12599 Changing how password is set in connections so as not to modify port numbers (as per comments #2 and #3) JENKINS-753 Stop processing if update fails and we're not going to do a workspace clean Compare: https://github.com/jenkinsci/cvs-plugin/compare/39da798...1ccef67
          Hide
          dogfood dogfood added a comment -

          Integrated in plugins_cvs #4
          [FIXED JENKINS-753] Allows performing a clean checkout if update fails (Revision 794afd76127191e6a5174647d0c2620f0aadd915)

          Result = SUCCESS
          michael.m.clarke :
          Files :

          • src/main/java/hudson/scm/CVSSCM.java
          • src/main/resources/hudson/scm/CVSSCM/config.jelly
          Show
          dogfood dogfood added a comment - Integrated in plugins_cvs #4 [FIXED JENKINS-753] Allows performing a clean checkout if update fails (Revision 794afd76127191e6a5174647d0c2620f0aadd915) Result = SUCCESS michael.m.clarke : Files : src/main/java/hudson/scm/CVSSCM.java src/main/resources/hudson/scm/CVSSCM/config.jelly
          Hide
          mc1arke Michael Clarke added a comment -

          Feature added in 2.1 to provide the user with a checkbox to enable cleaning workspace on failed update

          Show
          mc1arke Michael Clarke added a comment - Feature added in 2.1 to provide the user with a checkbox to enable cleaning workspace on failed update

            People

            • Assignee:
              mc1arke Michael Clarke
              Reporter:
              jglick Jesse Glick
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: