option to post and update a single GitHub comment for `Failed to merge this PR due to:` notifications
haysclark opened this issue · 1 comments
Summary
When using a GitHub project with Branch Protection Rules that Require status checks to pass before merging, Jenkins-X can spam the PR with hundreds of the following comments:
Failed to merge this PR due to:
failed merging [40]: [Method Not Allowed]
Steps to reproduce the behavior
- have a project hosted in GitHub
- in the repo settings, add a Branch Protection Rule for the
main
branch - enable multiple Require status checks to pass before merging and add Jenkins-X status checks and add status checks that it outside the control of Jenkins-X (WIP, or some other option)
- create a PR
- have Jenkins-X status checks pass (pr and Lighthouse Merge Status) but have the third status check fail.
/approve
the PR
An alternative to adding an additional status check is to disable "Merge commits" and only allow "Squash" commits.
Screenshot of GitHub project with Branch Protection Rule configured
Actual behavior
PR is slowly filled with the following comment (~1 per minute)
Failed to merge this PR due to:
failed merging [40]: [Method Not Allowed]
Screenshot of a PR that has sat for 4h (200+ messages):
Expected behavior
Ideally, GitHub only needs a single comment that can simply be updated on each Merge attempt. However, this could be configurable.
CodeClimate offers a nice solution where you can configure the number of comments that their Bot generates:
Screenshot of CodeClimage GitHub bot options:
Jx version
The output of jx version is:
jx version
version: 3.4.12
shaCommit: 845b21dd2c9ccadd3ac899ab7ad67bfbe0a87f1b
buildDate: Thu Aug 25 12:30:51 UTC 2022
goVersion: 1.17.9
branch: main
gitTreeState: clean