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

Wrong revision built when using post-commit hook and a commit occur during quiet period

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: subversion-plugin
    • Labels:
      None
    • Environment:
      Windows Server 2008
      Hudson 1.388
      Subversion plugin 1.21
    • Similar Issues:

      Description

      This appears to be related to a change made in Subversion plugin 1.18:

      "Builds triggered via the post-commit hook check out from the revision specified by the hook. The hook specifies the revision with either the rev query parameter, or the X-Hudson-Subversion-Revision HTTP header."

      To reproduce:
      1) Set up SVN to use a post-commit hook as described on the Subversion plugin page
      2) Set up a Hudson job using subversion as its SCM and a quiet period (mine is 60 seconds)
      3) Commit a change and note the resulting revision number.
      4) Observe job is queued in hudson
      5) Commit another change before quiet period expires and note the revision number.
      6) Quiet period resets as expected
      7) Once quiet period expires the job will run, but it will checkout with the revision number from step 3 instead of 5

      This is a major problem because the commit in step (5) above are ignored by hudson. The build that is done does not incorporate the second changes, and a second build is not triggered. The behavior I would expect is that if the changes are committed before the quiet period is expired, then those changes should be included in the upcoming build.

      I haven't investigated fully, but it seems that the Hudson core code has a mechanism to do this with the FoldableAction interface. It might be possible to make the RevisionParameterAction implement this interface in order to update its state when a new commit notification is received.

        Attachments

          Activity

          Hide
          kbell Kevin Bell added a comment -

          Add implementation of FoldableAction to RevisionParameterAction

          Show
          kbell Kevin Bell added a comment - Add implementation of FoldableAction to RevisionParameterAction
          Hide
          dty Dean Yu added a comment -

          Sorry about the delay in reviewing your patch.

          I had initial concerns about how your patch adds revisions to builds that didn't previous have a revision action associated with it, but I've come around to the "latest state always wins" approach, so your patch looks fine the way it is, excepting some whitespace issues.

          I'll apply the patch as soon as I get myself set up on Git.

          Show
          dty Dean Yu added a comment - Sorry about the delay in reviewing your patch. I had initial concerns about how your patch adds revisions to builds that didn't previous have a revision action associated with it, but I've come around to the "latest state always wins" approach, so your patch looks fine the way it is, excepting some whitespace issues. I'll apply the patch as soon as I get myself set up on Git.
          Hide
          dty Dean Yu added a comment -

          I applied your patch and it was released in version 1.23 of the plugin, back in January.

          Show
          dty Dean Yu added a comment - I applied your patch and it was released in version 1.23 of the plugin, back in January.

            People

            • Assignee:
              dty Dean Yu
              Reporter:
              kbell Kevin Bell
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: