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

A rebuild of a commit leaves original GitHub build failure statuses in place #32

Open
jimklimov opened this issue Oct 28, 2023 · 0 comments

Comments

@jimklimov
Copy link
Member

jimklimov commented Oct 28, 2023

This can happen due to not only programmatic problems with tested code, but also CI issues (failed to check out, killed by OOM, etc. - and a slowbuild-run/MATRIX_TAG=... status emerges). In that case the same code is okay to rebuild, but an obsolete status remains in GitHub.

Per https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28 and https://www.jenkins.io/doc/pipeline/steps/github/ there seems to be no way to delete a commit-status entry. It is also too expensive to pre-set states for each matrix cell (and feasible to exceed the allowed 1000 contexts per commit, never mind getting lost in those during manual review).

It might be possible to detect if a status for a build cell exists when we start it, re-post it as PENDING and remember to explicitly post a SUCCESS (as e.g. "Fixed since last build"). Probably this would best fit generally in Dynamatrix::generateBuild() loop that also posts other slowbuild-run/* messages, and not in individual buildMatrixCell implementations. Not sure if the github plugin allows that - maybe this is best pursued by PRing a https://github.com/jenkinsci/github-plugin/tree/master/src/main/java/org/jenkinsci/plugins/github/status "GitHubCommitStatusGetter" first, rather than adding direct GH interactions to this JSL :)

Note however that for builds failed due to external circumstances, a more likely emitter of such messages would be shellcheck/spellcheck/stylecheck "quick-run" steps which are handled separately at this time.

Not pursuing currently as this is a relatively rare situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant