Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(jenkins-jobs) add GitHub scm custom notification to ensure distinct checks for each job #1081

Conversation

dduportal
Copy link
Contributor

@dduportal dduportal commented Feb 22, 2024

Ref. jenkins-infra/helpdesk#2778 (comment)

This PR proposes the following:

GitHub checks default notification is changed from continuous-integration/jenkins/pr-merge to the following pattern:

jenkins/<Jenkins FQDN>/<Full Job Identifier> where:

  • is passed by helm values or defaults to "localhost"
  • is automatically set to the full Jenkins internal Job ID (string with '/' separators when recursive job structure such as folders or multibranch jobs)

Example with a diff on the infra.ci.jenkins.io setup:

  • Principal job for jenkins-infra/packer-images:
+                       gitHubNotificationContextTrait {
+                         contextLabel('jenkins/infra.ci.jenkins.io/infra-tools/packer-images')
+                         typeSuffix(true)
+                       }
  • Secondary (updatecli) job for jenkins-infra/packer-images:
+                       gitHubNotificationContextTrait {
+                         contextLabel('jenkins/infra.ci.jenkins.io/updatecli/packer-images')
+                         typeSuffix(true)
+                       }

Pros:

  • Less configuration: the notifications for secondary jobs do NOT require a custom static string (like the current GH check "Updatecli (infra.ci.jenkins.io)" check name on each job
  • Supports more than 2 multibranch jobs per repository

Cons:

  • Naming depends on the Jenkins controller structure: it changes per repository

…nct checks for each job.

Pattern is "jenkins/<Jenkins FQDN>/<Full Job Identifier>" where

- <Jenkins FQDN> is passed by helm values or defaults to "localhost"
- <Full Job Identifier> is automatically set to the full Jenkins internal Job ID (string with '/' separators when recursive job structure such as folders or multibranch jobs)

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
@dduportal dduportal force-pushed the feat/jenkins-jobs/helpdesk-2778/github-scm-trait-notification-context branch from 1a376db to af05642 Compare February 22, 2024 16:19
@dduportal dduportal changed the title feat(jenkins-jobs) add GitHub scm custom notification setup by defaul… feat(jenkins-jobs) add GitHub scm custom notification to ensure distinct checks for each job Feb 22, 2024
@dduportal dduportal marked this pull request as ready for review February 22, 2024 16:26
@dduportal dduportal added enhancement New feature or request jenkins-jobs labels Feb 22, 2024
Copy link
Member

@lemeurherve lemeurherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@dduportal dduportal merged commit 1208cdc into jenkins-infra:main Feb 22, 2024
4 checks passed
@dduportal dduportal deleted the feat/jenkins-jobs/helpdesk-2778/github-scm-trait-notification-context branch February 22, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request jenkins-jobs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants