Skip to content

feat(offline): ext.offline fixture path for the two EBI-facing processes - #1

Merged
mhusbynflow merged 1 commit into
flow-schema-simplefrom
mhusbynflow/fetchngs-offline-fixtures
Aug 20, 2026
Merged

feat(offline): ext.offline fixture path for the two EBI-facing processes#1
mhusbynflow merged 1 commit into
flow-schema-simplefrom
mhusbynflow/fetchngs-offline-fixtures

Conversation

@mhusbynflow

Copy link
Copy Markdown

Lets a caller run the pipeline end to end with no network access to EBI, while every line of the pipeline's own transform logic still executes for real.

SRA_IDS_TO_RUNINFO and SRA_FASTQ_FTP are the only two processes that talk to EBI. Each gains an ext.offline branch. Unset — the default, and what every real run does — behaviour is exactly as today.

process {
    withName: '.*SRA_IDS_TO_RUNINFO.*' { ext.offline = true }
    withName: '.*SRA_FASTQ_FTP.*'      { ext.offline = true }
}

SRA_RUNINFO_TO_FTP, SRA_TO_SAMPLESHEET and MULTIQC_MAPPINGS_CONFIG are untouched and keep running for real — a fixture that replaced the samplesheet-building step could drift from what the pipeline really emits, leaving the acceptance test green while production broke.

Why ext rather than a profile or a param

The caller (flow-api's acceptance suite) layers one config file over every pipeline in its environment. A withName selector that matches nothing is a silent no-op; an unknown param would be rejected by any other pipeline validating with nf-schema. -profile offline would break every pipeline that doesn't define it. -stub-run yields an empty samplesheet, since SRA_TO_SAMPLESHEET has no stub.

Changes

File
modules/local/sra_ids_to_runinfo/main.nf Offline branch inlines assets/offline/<id>.runinfo.tsv via heredoc rather than staging it, so the fixture reaches the task without projectDir being mounted. Missing fixture calls error() naming the accession.
modules/local/sra_fastq_ftp/main.nf Offline branch generates a one-read FASTQ with gzip -n. md5sum -c still runs.
assets/offline/*.runinfo.tsv, README.md Real ENA responses captured with the module's default ENA_METADATA_FIELDS. fastq_md5 repointed at the generated bytes; every other column keeps ENA's real value.
tests/sra_offline.nf.test + config, inputs, snapshot Offline run, and the missing-fixture failure.

Acceptance criteria

  1. Default path byte-for-byte unchanged. Ran the two accessions online after the change and diffed the generated .command.sh for both processes against the pre-change run: byte-identical. tests/sra_skip_fastq_download.nf.test — the one existing test that exercises SRA_IDS_TO_RUNINFO's default path — passes against its untouched snapshot.
  2. Offline run completes with no EBI request. tests/sra_offline.nf.test asserts 2 samplesheet rows and 3 .fastq.gz, and walks the work dir asserting no .command.sh contains sra_ids_to_runinfo.py or a wget invocation.
  3. Samplesheet identical to an online run. Diffed a real online run of ERR1160845,ERR10677146 against the offline one: the only difference is the fastq_md5 column values. Header, column order, row order and all 31 other fields match exactly.
  4. md5sum -c still runs offline and passes. gzip -n produces the same md5 on the host and inside quay.io/biocontainers/wget:1.21.4 (busybox gzip), so the pinned md5 holds across the container/host split.
  5. Missing fixture fails loudly: No offline runinfo fixture for accession 'ERR1160846' (looked for …).

Out of scope, as specified: the sratools, aspera and fastqdl routes; nextflow_schema.json; the flow-api side that sets the switch.

Pre-existing failure, not from this PR

tests/default.nf.test and every other pipeline-level test in tests/ already fail on flow-schema-simple: that branch made --input require an accession column header, but the tests still point at the headerless sra_ids_test.csv on nf-core/test-datasets. Confirmed against a clean checkout of the branch. Left alone as outside this spec, but it means CI here is red regardless of this change.

Also note the pipeline now needs Nextflow >= 25.04 (nf-schema 2.5.1).

🤖 Generated with Claude Code

…ocesses

SRA_IDS_TO_RUNINFO and SRA_FASTQ_FTP are the only processes that talk to EBI.
When `ext.offline` is set they emit a pinned runinfo TSV and generate a small
FASTQ locally instead; unset (the default) they behave exactly as before.

This lets flow-api's sample-import acceptance test run the pipeline end to end
without gating a merge on EBI being reachable from a single runner IP, while
every transform step downstream — SRA_RUNINFO_TO_FTP, SRA_TO_SAMPLESHEET,
MULTIQC_MAPPINGS_CONFIG — still runs for real, so the samplesheet the test
asserts on is the one production emits.

`ext` rather than a profile or a param because the caller layers one config
over every pipeline in its environment: a `withName` selector that matches
nothing is a silent no-op, whereas an unknown param would be rejected by any
pipeline validating with nf-schema.

`md5sum -c` still runs in the offline path. That makes the generated bytes
load-bearing: `gzip -n` keeps them deterministic, and the fixtures' fastq_md5
column is repointed at the generated read. Every other column keeps ENA's real
value. An accession with no fixture fails naming the accession, rather than
emitting an empty TSV that would surface later as zero samples imported.

No breaking changes; no nextflow_schema.json change.
@github-actions

Copy link
Copy Markdown

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

Posted for pipeline commit 810791d

+| ✅ 205 tests passed       |+
#| ❔  13 tests were ignored |#
!| ❗   2 tests had warnings |!
Details

❗ Test warnings:

❔ Tests ignored:

  • files_exist - File is ignored: .github/workflows/awsfulltest.yml
  • files_exist - File is ignored: .github/workflows/awstest.yml
  • files_exist - File is ignored: assets/multiqc_config.yml
  • files_exist - File is ignored: conf/igenomes.config
  • files_exist - File is ignored: conf/igenomes_ignored.config
  • files_exist - File is ignored: conf/modules.config
  • files_unchanged - File ignored due to lint config: .github/PULL_REQUEST_TEMPLATE.md
  • files_unchanged - File ignored due to lint config: assets/sendmail_template.txt
  • files_unchanged - File ignored due to lint config: assets/nf-core-fetchngs_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-fetchngs_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-fetchngs_logo_dark.png
  • multiqc_config - multiqc_config
  • modules_config - modules_config

✅ Tests passed:

Run details

  • nf-core/tools version 3.5.2
  • Run at 2026-08-19 15:53:01

@mhusbynflow
mhusbynflow merged commit 4c19461 into flow-schema-simple Aug 20, 2026
2 of 3 checks passed
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