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

Spurious builds using SCM polling and path whitelisting with git plugin

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • None

      Builds using SCM polling of a Git repo using Additional Behaviours / Included Regions results in spurious builds.

       

      The build Changes shows that none of the changes apply to the paths configured in the Included Regions, but reviewing the Polling Log and then executing the git log command the Git  plugin uses to determine changes seems to show the cause.

      The plugin uses git log --full-history --no-abbrev --format=raw -M -m --raw to determine what changed.  This not only includes merge commits, but in addition the -m flag  causes a full diff for the parents to be shown, causing previously processed commits to show up, some which may match the whitelist and result in a spurious build.
       

       

          [JENKINS-51434] Spurious builds using SCM polling and path whitelisting with git plugin

          Elias Levy added a comment -

          Found the issue that introduced the problem years ago: https://github.com/jenkinsci/git-client-plugin/commit/340da905666600a18866ebba27376c7f1874d673#diff-4a13310f7c84a9d6e133def48c0aed5a

          Amusingly, it includes this:

          This can still trigger extra builds as "-m" means the changes between all legs of a merge commit are displayed. However, without this, conflict resolution changed as part of the merge commit would be skipped.

          Elias Levy added a comment - Found the issue that introduced the problem years ago: https://github.com/jenkinsci/git-client-plugin/commit/340da905666600a18866ebba27376c7f1874d673#diff-4a13310f7c84a9d6e133def48c0aed5a Amusingly, it includes this: This can still trigger extra builds as "-m" means the changes between all legs of a merge commit are displayed. However, without this, conflict resolution changed as part of the merge commit would be skipped.

            Unassigned Unassigned
            elevy Elias Levy
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: