jenkinsci / github-checks-plugin

Jenkins Plugin for GitHub Checks API
https://plugins.jenkins.io/github-checks/
MIT License
78 stars 38 forks source link

Jenkins in monorepo with multiple multibranch pipeline jobs #275

Open Wayonb opened 2 years ago

Wayonb commented 2 years ago

Describe your use-case which is not covered by existing documentation.

I have a GitHub monorepo setup. There is a seed job that monitors a build configuration file when new projects are added to a repo. The seed job will create new multibranch pipeline job for that project. Thus the monorepo has multiple multibranch jobs. Each job only runs when files are updated in its project. I have a couple of questions.

  1. I noticed that the Jenkins GitHub Check does not always show the correct status or job for that repo. Should each job have its own unique GitHub Status name?

GitHub Check Status

  1. With this setup, each pull request can have one or more jobs running at once. GitHub branch protection rule requires selecting the check stat= us needed to check in. Since each PR will have different jobs, then cannot select any specific job. Is there a plugin that will aggregate status checks across multiple jobs?

Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.

I havent been able to find any documentation on how to configure a scenario where a repo has multiple jobs running. Not sure if I missed anything.

e.g. This PR shows the Jenkins Check as green but some of the jobs seems to fail.

https://github.com/NemProject/nem/pull/56

aitorpazos commented 2 years ago

@Wayonb Maybe this helps and maybe some have a better solution...

We set a custom name for GH checks for each of the projects in the monorepo in the seed job:

// Configures Status Checks customizations
        traits << 'io.jenkins.plugins.checks.github.status.GitHubSCMSourceStatusChecksTrait' {
          skip(false)
          skipNotifications(true)
          unstableBuildNeutral(true)
          name("${args.jobName} Jenkins build log")
          suppressLogs(false)
          skipProgressUpdates(true)
        }
Wayonb commented 2 years ago

@aitorpazos Thanks. It seems notification is also disabled

Wayonb commented 1 year ago

Any updates on this issue? Thanks