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

Add option to choose static notification context

      Commit https://github.com/jenkinsci/github-branch-source-plugin/commit/5a98d2a885aa951087ba329acdc560bc1e6b7062 just broke the workflow for us.

      We have our protected branches set up to check for context "Jenkins", so a successful build (from our organisation/multibranch projects) is enforced before merging. Through the mentioned commit, we now get "Jenkins job <whatever>" as notification context, on which we cannot protect anymore.

      Please add an option to choose if the default context should contain the job name or not.
      I am aware that you can set a custom context through the GitHubCommitStatusSetter step, but its not a viable and clean solution for us, as we would have to change hundreds of Jenkinsfiles.

          [JENKINS-36574] Add option to choose static notification context

          I pushed up a Pull Request that sets the context to one of:

          • continuous-integration/jenkins/pr
          • continuous-integration/jenkins/branch

          It's hacky (it looks at job.getName() to figure out if it is a PR or not) because I couldn't figure out a better way to detect if it is a PR or not.

          Christian Höltje added a comment - I pushed up a Pull Request that sets the context to one of: continuous-integration/jenkins/pr continuous-integration/jenkins/branch It's hacky (it looks at job.getName() to figure out if it is a PR or not) because I couldn't figure out a better way to detect if it is a PR or not.

          Julien Maitrehenry added a comment - - edited

          I really like this solution, but is it possible, in an another version to be able to configure continuous-integration/jenkins?
          It's a nice feature when you migrate from one jenkins to another and don't want to mix the status check on Github.

          Julien Maitrehenry added a comment - - edited I really like this solution, but is it possible, in an another version to be able to configure continuous-integration/jenkins ? It's a nice feature when you migrate from one jenkins to another and don't want to mix the status check on Github.

          I barely know enough Java to do what I did.

          Ideally I would want to be able to replace the jenkins with something identifying what Jenkins. e.g. automan

          But that'd require understanding Jelly, etc.

          Christian Höltje added a comment - I barely know enough Java to do what I did. Ideally I would want to be able to replace the jenkins with something identifying what Jenkins. e.g. automan But that'd require understanding Jelly, etc.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubBuildStatusNotification.java
          http://jenkins-ci.org/commit/github-branch-source-plugin/d9fbd745c15ccd4cde1be0bd9e97be1f1a86dcb5
          Log:
          [FIXED JENKINS-36574] Use the minimum number of status contexts necessary to differentiate jobs potentially building a given commit.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubBuildStatusNotification.java http://jenkins-ci.org/commit/github-branch-source-plugin/d9fbd745c15ccd4cde1be0bd9e97be1f1a86dcb5 Log: [FIXED JENKINS-36574] Use the minimum number of status contexts necessary to differentiate jobs potentially building a given commit.

          Eike Waldt added a comment -

          Julien Maitrehenry: "[..] but is it possible, in an another version to be able to configure continuous-integration/jenkins?
          It's a nice feature when you migrate from one jenkins to another and don't want to mix the status check on Github."

          https://github.com/jenkinsci/github-branch-source-plugin/pull/88 implements a configurable "continuous-integration/jenkins".
          It makes it also possible to run 2 jenkins instances on the same github repo/Organisation.

          Eike Waldt added a comment - Julien Maitrehenry: " [..] but is it possible, in an another version to be able to configure continuous-integration/jenkins? It's a nice feature when you migrate from one jenkins to another and don't want to mix the status check on Github." https://github.com/jenkinsci/github-branch-source-plugin/pull/88 implements a configurable "continuous-integration/jenkins". It makes it also possible to run 2 jenkins instances on the same github repo/Organisation.

          Eike Waldt added a comment -

          https://github.com/jenkinsci/github-branch-source-plugin/pull/138 was just opened to address this issue again,

          Eike Waldt added a comment - https://github.com/jenkinsci/github-branch-source-plugin/pull/138 was just opened to address this issue again,

          Jesse Glick added a comment -

          yeoldegrove please do not reopen. You may file separate issues (and link them) for related concerns.

          Jesse Glick added a comment - yeoldegrove please do not reopen. You may file separate issues (and link them) for related concerns.

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          src/test/java/org/jenkinsci/plugins/github_branch_source/DefaultGitHubNotificationStrategyTest.java
          http://jenkins-ci.org/commit/github-branch-source-plugin/a35c612015bd17d38a66786e8c9233b14e47f7e0
          Log:
          JENKINS-36574 And example stub test

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/test/java/org/jenkinsci/plugins/github_branch_source/DefaultGitHubNotificationStrategyTest.java http://jenkins-ci.org/commit/github-branch-source-plugin/a35c612015bd17d38a66786e8c9233b14e47f7e0 Log: JENKINS-36574 And example stub test

          Code changed in jenkins
          User: steven-foster
          Path:
          .gitignore
          pom.xml
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMBuilder.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMFile.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMFileSystem.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMProbe.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSourceRequest.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubTagSCMHead.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestAction.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestGHEventSubscriber.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/PushGHEventSubscriber.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/TagDiscoveryTrait.java
          src/main/resources/org/jenkinsci/plugins/github_branch_source/Messages.properties
          src/main/resources/org/jenkinsci/plugins/github_branch_source/TagDiscoveryTrait/config.jelly
          src/main/resources/org/jenkinsci/plugins/github_branch_source/TagDiscoveryTrait/help.html
          src/test/java/org/jenkinsci/plugins/github_branch_source/TagDiscoveryTraitTest.java
          http://jenkins-ci.org/commit/github-branch-source-plugin/51e1535a7f6eb7264d59ba900c4e337443b51620
          Log:
          Merge branch 'master' into JENKINS-36574

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: steven-foster Path: .gitignore pom.xml src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMBuilder.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMFile.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMFileSystem.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMProbe.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSourceRequest.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubTagSCMHead.java src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestAction.java src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestGHEventSubscriber.java src/main/java/org/jenkinsci/plugins/github_branch_source/PushGHEventSubscriber.java src/main/java/org/jenkinsci/plugins/github_branch_source/TagDiscoveryTrait.java src/main/resources/org/jenkinsci/plugins/github_branch_source/Messages.properties src/main/resources/org/jenkinsci/plugins/github_branch_source/TagDiscoveryTrait/config.jelly src/main/resources/org/jenkinsci/plugins/github_branch_source/TagDiscoveryTrait/help.html src/test/java/org/jenkinsci/plugins/github_branch_source/TagDiscoveryTraitTest.java http://jenkins-ci.org/commit/github-branch-source-plugin/51e1535a7f6eb7264d59ba900c4e337443b51620 Log: Merge branch 'master' into JENKINS-36574

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          docs/implementation.adoc
          src/main/java/org/jenkinsci/plugins/github_branch_source/AbstractGitHubNotificationStrategy.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/DefaultGitHubNotificationStrategy.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubBuildStatusNotification.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubNotificationContext.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubNotificationRequest.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSourceContext.java
          src/test/java/org/jenkinsci/plugins/github_branch_source/DefaultGitHubNotificationStrategyTest.java
          src/test/java/org/jenkinsci/plugins/github_branch_source/GitHubNotificationTest.java
          http://jenkins-ci.org/commit/github-branch-source-plugin/267e41c5958116d58543018bdc81ff98ef0867fa
          Log:
          Merge pull request #162 from steven-foster/JENKINS-36574

          JENKINS-36574 Custom Github status context

          Compare: https://github.com/jenkinsci/github-branch-source-plugin/compare/e8c6c778f3aa...267e41c59581

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: docs/implementation.adoc src/main/java/org/jenkinsci/plugins/github_branch_source/AbstractGitHubNotificationStrategy.java src/main/java/org/jenkinsci/plugins/github_branch_source/DefaultGitHubNotificationStrategy.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubBuildStatusNotification.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubNotificationContext.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubNotificationRequest.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSourceContext.java src/test/java/org/jenkinsci/plugins/github_branch_source/DefaultGitHubNotificationStrategyTest.java src/test/java/org/jenkinsci/plugins/github_branch_source/GitHubNotificationTest.java http://jenkins-ci.org/commit/github-branch-source-plugin/267e41c5958116d58543018bdc81ff98ef0867fa Log: Merge pull request #162 from steven-foster/ JENKINS-36574 JENKINS-36574 Custom Github status context Compare: https://github.com/jenkinsci/github-branch-source-plugin/compare/e8c6c778f3aa...267e41c59581

            jglick Jesse Glick
            schulzha Hans Schulz
            Votes:
            12 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved: