Skip to content

Conversation

@JackCurragh
Copy link
Contributor

Add lines to modules ribocode_metaplots and ribocode_ribocode to make the process fail when invalid outputs are created.

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the module conventions in the contribution docs
  • If necessary, include test data in your PR.
  • Remove all TODO statements.
  • Emit the versions.yml file.
  • Follow the naming conventions.
  • Follow the parameters requirements.
  • Follow the input/output options guidelines.
  • Add a resource label
  • Use BioConda and BioContainers if possible to fulfil software requirements.
  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
    • For modules:
      • nf-core modules test <MODULE> --profile docker
      • nf-core modules test <MODULE> --profile singularity
      • nf-core modules test <MODULE> --profile conda
    • For subworkflows:
      • nf-core subworkflows test <SUBWORKFLOW> --profile docker
      • nf-core subworkflows test <SUBWORKFLOW> --profile singularity
      • nf-core subworkflows test <SUBWORKFLOW> --profile conda

JackCurragh and others added 15 commits December 1, 2025 15:31
- Fix error messages to use module-appropriate ext.args references
  instead of pipeline-specific argument names
- Improve metaplots validation: check for actual data lines using
  grep instead of line count (handles blank lines correctly)
- Improve ribocode error detection: use extended regex to catch
  both "^Error" and "Error:" patterns
- Add failure mode tests for both modules to verify error handling
- Add nextflow_fail.config for metaplots failure test

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@pinin4fjords
Copy link
Member

Review and improvements to error handling

I've reviewed the error handling changes and made the following improvements:

Error message fixes

  • Replaced pipeline-specific argument references (--extra_ribocode_metaplots_args) with module-appropriate ext.args references
  • This keeps modules agnostic to how they're invoked by pipelines

Improved metaplots validation

  • Issue: The original wc -l <= 2 check didn't work because the config file includes blank lines
  • Fix: Now uses grep -qE '^[^#[:space:]]' to check for actual data lines (lines that don't start with # or whitespace)
  • This correctly detects when no sample config line was generated

Improved ribocode error detection

  • Changed grep pattern from ^Error to ^Error|Error: (with -E flag)
  • This catches both line-start errors and "Error:" patterns that may appear mid-line

Added failure mode tests

  • Added test test_ribocode_metaplots - empty config failure with nextflow_fail.config using -f0_percent 1.0 to force empty output
  • Added test test_ribocode_ribocode - invalid config failure that creates an inline header-only config file
  • Both tests verify the process fails and the error message is present in output

All tests passing locally with Docker profile.

pinin4fjords and others added 2 commits December 19, 2025 10:27
The detect-nf-test-changes action was failing because it parsed
lines containing 'config_file' as config directives.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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