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

Allow a branch build strategy to not-build merge PRs when only the target revision has changed

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      ChangeRequestSCMRevision has the equivalent(ChangeRequestSCMRevision) method that can be used to compare whether two revisions are the same ignoring the getTarget() but as BranchBuildStrategy does not have access to the previous revision we cannot use this method to allow an extension that would only build merge PRs when there are actual changes to the PR and ignore rebuilding because the target branch changed.

      There are probably additional use cases, but this is sufficient to drive a solution.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            pom.xml
            src/main/java/jenkins/branch/BranchBuildStrategy.java
            src/main/java/jenkins/branch/MultiBranchProject.java
            src/test/java/integration/EventsTest.java
            http://jenkins-ci.org/commit/branch-api-plugin/6189c758a9f1872f3e167d49dca91d48e950e811
            Log:
            [FIXED JENKINS-48535] Allow a BranchBuildStrategy to not build PR-merge revisions where the only change is the target revision

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: pom.xml src/main/java/jenkins/branch/BranchBuildStrategy.java src/main/java/jenkins/branch/MultiBranchProject.java src/test/java/integration/EventsTest.java http://jenkins-ci.org/commit/branch-api-plugin/6189c758a9f1872f3e167d49dca91d48e950e811 Log: [FIXED JENKINS-48535] Allow a BranchBuildStrategy to not build PR-merge revisions where the only change is the target revision
            Show
            stephenconnolly Stephen Connolly added a comment - A working impl is available in  https://github.com/jenkinsci/basic-branch-build-strategies-plugin/blob/master/src/main/java/jenkins/branch/buildstrategies/basic/ChangeRequestBuildStrategyImpl.java

              People

              • Assignee:
                stephenconnolly Stephen Connolly
                Reporter:
                stephenconnolly Stephen Connolly
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: