Skip to content

Clear the nf-test PR comment once its failure is fixed - #224

Closed
FelixKrueger wants to merge 1 commit into
devfrom
fix/nf-test-sticky-comment-not-cleared
Closed

Clear the nf-test PR comment once its failure is fixed#224
FelixKrueger wants to merge 1 commit into
devfrom
fix/nf-test-sticky-comment-not-cleared

Conversation

@FelixKrueger

Copy link
Copy Markdown
Contributor

The ❌ nf-test comment for latest-everything failures can currently only be added, never cleared. A producer writes pr-comment/comment.md only 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 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 behave exactly as before.

Verification notes (AI-assisted)

Prompted by #222, which sat green with a failure comment pointing at a cancelled run.

  • Confirmed delete is a real input on marocchino/sticky-pull-request-comment at the already-pinned SHA 5770ad5 (v3.0.5): "delete the previously created comment. Only true is allowed." Deletion is scoped by header, so producers stay independent.
  • Simulated the reworked metadata step over five cases: comment.md present → post; delete marker only → delete; neither → early exit unchanged (this is the path the other three producers take, so their behaviour is untouched); both present → post wins; delete marker with an empty PR number → the existing numeric guard still rejects it.
  • nf-test.yml also fires on release and workflow_dispatch, where github.event.pull_request.number is empty. Those never reach the poster because it is gated on github.event.workflow_run.event == 'pull_request', so the new marker cannot trip that guard.
  • Both files parse as YAML; no trailing whitespace; the one long line is a verbatim copy of the uses: line already in the file.

The sticky comment for latest-everything failures can only ever be added. A
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.
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

Warning

Newer version of the nf-core template is available.

Your pipeline is using an old version of the nf-core template: 4.0.3.
Please update your pipeline to the latest version.

For more documentation on how to update your pipeline, please see the Synchronisation documentation.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

nf-core pipelines lint overall result: Failed ❌

Posted for pipeline commit 6a3134e

+| ✅ 298 tests passed       |+
#| ❔   7 tests were ignored |#
!| ❗   6 tests had warnings |!
-| ❌   1 tests failed       |-
Details

❌ Test failures:

  • files_unchanged - .github/workflows/pr-comment.yml does not match the template

❗ Test warnings:

  • pipeline_todos - TODO string in main.nf: Optionally add in-text citation tools to this list.
  • pipeline_todos - TODO string in main.nf: Optionally add bibliographic entries to this list.
  • pipeline_todos - TODO string in main.nf: Only uncomment below if logic in toolCitationText/toolBibliographyText has been filled!
  • pipeline_todos - TODO string in CONTRIBUTING.md: Add any pipeline specific contribution guidelines here, such as coding styles, procedures, checklists etc.
  • pipeline_if_empty_null - ifEmpty(null) found in /home/runner/work/riboseq/riboseq/subworkflows/local/prepare_genome/main.nf: _ versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ]
    _
  • schema_lint - Input mimetype is missing or empty

❔ Tests ignored:

  • nextflow_config - Config default ignored: params.ribo_database_manifest
  • nf_test_content - nf_test_content
  • files_unchanged - File ignored due to lint config: assets/nf-core-riboseq_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-riboseq_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-riboseq_logo_dark.png
  • files_unchanged - File ignored due to lint config: .gitignore or .prettierignore
  • merge_markers - Ignoring file /home/runner/work/riboseq/riboseq/modules/nf-core/bowtie2/align/tests/main.nf.test.snap

✅ Tests passed:

Run details

  • nf-core/tools version 4.0.3
  • Run at 2026-08-01 05:56:34

@FelixKrueger

Copy link
Copy Markdown
Contributor Author

Closing in favour of nf-core/tools#4436.

.github/workflows/pr-comment.yml is a template file, so patching it here fails nf-core pipelines lint (files_unchanged) and would put riboseq permanently out of step with the template. The same fix upstream reaches every pipeline, and riboseq picks it up at the next template merge.

@FelixKrueger
FelixKrueger deleted the fix/nf-test-sticky-comment-not-cleared branch August 1, 2026 06:09
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

Successfully merging this pull request may close these issues.

1 participant