Skip to content

Conversation

@pinin4fjords
Copy link
Member

@pinin4fjords pinin4fjords commented Nov 13, 2025

Summary

Fixes the CI configuration issue where PRs with only markdown/documentation changes cannot be merged because the confirm-pass required status check doesn't run.

Problem

The nf-test workflow used paths-ignore at the workflow level, which prevented the entire workflow (including the confirm-pass job) from running when only docs/markdown files were changed. If confirm-pass is configured as a required status check in branch protection rules, these PRs cannot be merged.

This affects PRs like #1613 which only modify documentation files.

Solution

Key Changes

  1. Remove paths-ignore from workflow trigger: The workflow now always runs for every PR
  2. Add dorny/paths-filter action: Detects when only docs/markdown files changed
  3. Use predicate-quantifier: 'every': Ensures ALL changed files must match ignore patterns for tests to be skipped (prevents skipping tests when PR has mixed doc+code changes)
  4. Make test execution conditional: The nf-test job only runs when skip_tests != 'true'
  5. Enhance confirm-pass job: Always runs and handles both test execution and skip scenarios

Workflow Behavior Scenarios

Scenario 1: Markdown-Only PR (e.g., only docs/usage.md and CHANGELOG.md)

  • nf-test-changes job runs → detects all files match ignore patterns → outputs skip_tests='true'
  • nf-test job is SKIPPED (condition fails: skip_tests != 'true')
  • confirm-pass job RUNS (always) → first step executes → PASSES
  • Result: PR can merge, no expensive tests run

Scenario 2: Code-Only PR (e.g., only main.nf or modules/)

  • nf-test-changes job runs → detects non-ignored files → outputs skip_tests='false', calculates shards
  • nf-test job RUNS all test matrices (docker, conda, singularity)
  • confirm-pass job RUNS (always) → validates test results → PASSES or FAILS based on tests ✅/❌
  • Result: PR requires passing tests to merge

Scenario 3: Mixed Changes PR (e.g., README.md + main.nf)

  • nf-test-changes job runs → detects main.nf doesn't match ignore patterns → outputs skip_tests='false'
  • nf-test job RUNS full test suite (code was changed)
  • confirm-pass job RUNS → validates test results ✅/❌
  • Result: Tests run because code changed (correct behavior)

Scenario 4: Edge Case - No Tests Found (shards = 0, but code changed)

  • nf-test-changes job runs → outputs skip_tests='false', total_shards='0'
  • nf-test job is SKIPPED (condition fails: total_shards != '0')
  • confirm-pass job RUNS → detects nf-test was skipped → checks for success in nf-test-changesPASSES
  • Result: PR can merge (no tests to run)

Technical Details

Modified File

.github/workflows/nf-test.yml:

  • Removed paths-ignore from workflow trigger (lines 2-9)
  • Added dorny/paths-filter@v3 with predicate-quantifier: 'every' (lines 42-52)
  • Added skip_tests output to nf-test-changes job (line 30)
  • Made shard calculation conditional on skip_tests != 'true' (line 55)
  • Updated nf-test job condition to check skip_tests (line 72)
  • Enhanced confirm-pass job to:
    • Depend on both nf-test-changes and nf-test (line 125)
    • Handle skipped tests scenario (lines 131-135)
    • Conditionally check test results only when tests ran (lines 137-147)

Why predicate-quantifier: 'every' is Critical

Without this setting, the default 'some' quantifier would return skip_tests='true' if ANY file matches ANY ignore pattern. This would incorrectly skip tests for PRs that change both docs AND code.

With 'every', all files must match at least one ignore pattern:

  • README.md alone → all files match → skip tests
  • main.nf alone → not all files match → run tests
  • README.md + main.nf → not all files match → run tests

Test Plan

  • Verify workflow runs on markdown-only PRs (this PR validates this)
  • Verify confirm-pass check appears and passes for markdown-only changes
  • Verify full test suite still runs for code changes
  • Verify confirm-pass correctly validates test results for code changes
  • Verify mixed change PRs trigger full test suite

🤖 Generated with Claude Code

The nf-test workflow used paths-ignore at the workflow level, which prevented the entire workflow (including the confirm-pass job) from running when only docs/markdown files were changed. This caused PRs with only documentation changes to fail merge requirements if confirm-pass was configured as a required status check.

Changes:
- Remove paths-ignore from workflow trigger to ensure workflow always runs
- Add dorny/paths-filter action to detect docs/markdown-only changes
- Make nf-test job conditional on skip_tests output
- Update confirm-pass job to always run and pass when tests are skipped
- Add skip_tests output to nf-test-changes job

This ensures the confirm-pass required check is always present while still skipping expensive test execution for documentation-only changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link

This PR is against the master branch ❌

  • Do not close this PR
  • Click Edit and change the base to dev
  • This CI test will remain failed until you push a new commit

Hi @pinin4fjords,

It looks like this pull-request is has been made against the nf-core/rnaseq master branch.
The master branch on nf-core repositories should always contain code from the latest release.
Because of this, PRs to master are only allowed if they come from the nf-core/rnaseq dev branch.

You do not need to close this PR, you can change the target branch to dev by clicking the "Edit" button at the top of this page.
Note that even after this, the test will continue to show as failing until you push a new commit.

Thanks again for your contribution!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@pinin4fjords pinin4fjords changed the base branch from master to dev November 13, 2025 14:07
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link

github-actions bot commented Nov 13, 2025

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit 47a84d9

+| ✅ 284 tests passed       |+
#| ❔   8 tests were ignored |#
!| ❗   9 tests had warnings |!

❗ Test warnings:

  • files_exist - File not found: assets/multiqc_config.yml
  • pipeline_todos - TODO string in base.config: Check the defaults for all processes
  • pipeline_todos - TODO string in awsfulltest.yml: You can customise AWS full pipeline tests as required
  • pipeline_todos - TODO string in methods_description_template.yml: #Update the HTML below to your preferred methods description, e.g. add publication citation for this pipeline
  • 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 nextflow.config: Specify any additional parameters here
  • pipeline_if_empty_null - ifEmpty(null) found in /home/runner/work/rnaseq/rnaseq/subworkflows/local/prepare_genome/main.nf: _ versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ]
    _

❔ Tests ignored:

✅ Tests passed:

Run details

  • nf-core/tools version 3.4.1
  • Run at 2025-11-14 10:23:11

pinin4fjords and others added 4 commits November 13, 2025 14:13
The default 'some' quantifier returns true if ANY file matches ANY pattern,
which incorrectly skips tests when a PR has mixed changes (e.g., both
README.md and src/main.nf). Using 'every' ensures ALL files must match
at least one pattern for tests to be skipped.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
pinin4fjords and others added 2 commits November 13, 2025 14:42
This commit modifies nextflow.config to test that code changes properly
trigger the full nf-test suite with the new CI configuration. This validates
that the paths-filter correctly identifies non-documentation changes.

This commit will be reverted after CI runs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Copilot finished reviewing on behalf of pinin4fjords November 13, 2025 14:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a CI configuration issue where pull requests containing only markdown or documentation changes could not be merged because the required confirm-pass status check didn't run. The solution removes workflow-level paths-ignore filters and instead uses conditional job execution with explicit handling for documentation-only changes.

Key changes:

  • Replaced workflow-level paths-ignore with dorny/paths-filter action using predicate-quantifier: 'every' to detect when all changed files are documentation
  • Made test execution conditional on skip_tests output to avoid running expensive tests for documentation-only PRs
  • Enhanced confirm-pass job to always run and explicitly handle both test execution and skip scenarios

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
.github/workflows/nf-test.yml Core workflow changes: removed paths-ignore, added dorny/paths-filter with conditional job execution, and enhanced confirm-pass job to handle skipped test scenarios
CHANGELOG.md Added entry documenting the CI fix
.nf-core.yml Disabled actions_nf_test lint rule to accommodate the custom workflow implementation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pinin4fjords pinin4fjords added this to the 3.22.0 milestone Nov 14, 2025
Copy link
Contributor

@edmundmiller edmundmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make this change at the GitHub Actions level.

I hadn't thought of this edge case before or no one's complained because no one else is making docs only PRs 😉

Comment on lines -4 to -9
paths-ignore:
- "docs/**"
- "**/meta.yml"
- "**/*.md"
- "**/*.png"
- "**/*.svg"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you're changing this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see now.

Let's remove the' paths-ignore' part and the on: file-specific sections if that's not working for your docs PRs.

The reason we did that was to avoid spinning up a job just to check on those, but it makes sense if you're running into an actual CI requirement, and because this is RNAseq.

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.

3 participants