Clear the nf-test PR comment once its failure is fixed - #4436
Open
FelixKrueger wants to merge 1 commit into
Open
Clear the nf-test PR comment once its failure is fixed#4436FelixKrueger wants to merge 1 commit into
FelixKrueger wants to merge 1 commit into
Conversation
The sticky comment for latest-everything failures can only ever be added. The producer writes pr-comment/comment.md solely when failure fragments exist, so a run that goes green leaves the poster nothing to publish and the previous failure comment stands unchanged. Any PR that fixes such a failure then carries a permanently misleading cross. Add an optional `delete` marker to the pr-comment artifact contract. nf-test touches it when no leg failed, and the poster deletes that header's comment instead of posting one. Producers that write neither file are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ❌ nf-test comment for
latest-everythingfailures can currently only be added, never cleared. The producer writespr-comment/comment.mdonly when failure fragments exist, so once a PR fixes the failure the poster has nothing to publish and the previous comment stays put — a green PR keeps showing a stale cross. This adds an optionaldeletemarker to thepr-commentartifact contract: nf-test touches it when no leg failed, and the poster deletes that header's comment instead of posting one. Producers that write neither file behave exactly as before, so linting, template-version and branch-protection comments are untouched.Verification notes (AI-assisted)
Found on a real pipeline PR (nf-core/riboseq#222), which sat fully green while displaying a failure comment that pointed at a cancelled run. The comment cannot self-clear, so it had to be corrected by hand.
deleteis a real input onmarocchino/sticky-pull-request-commentat the already-pinned SHA5770ad5(v3.0.5): "delete the previously created comment. Onlytrueis allowed." Deletion is scoped byheader, so producers stay independent of one another.comment.mdpresent →post;deletemarker only →delete; neither → early exit unchanged (the path the other three producers take); both present →postwins;deletemarker with an empty PR number → the existing numeric guard still rejects it.nf-test.ymlalso fires onreleaseandworkflow_dispatch, wheregithub.event.pull_request.numberis empty. Those never reach the poster, which is gated ongithub.event.workflow_run.event == 'pull_request', so the new marker cannot trip that guard.{% raw %}block, so its${{ ... }}expressions are not Jinja-interpreted;{%- endraw %}moves to the new final line.pr-comment.ymlparses as YAML with the raw tags stripped.nf-test.yml's change is inside arun: |block scalar.