Repository navigation
Conversation
Raise a UserWarning naming manifest.name when it is missing or not in the '<repo>/<pipeline>' format, instead of crashing with an opaque 'not enough values to unpack' ValueError (or an IndexError later in files_exist) that gave no hint about which config field was at fault. All CLI callers of Pipeline.load_pipeline_config() already catch UserWarning and print it as a clean one-line error. Signed-off-by: kokhlo <konstantin.khlopkov93@gmail.com>
Applied the reviewer's three suggestions: the manifest.name error message, its test docstring and the test's match pattern now say <org>/<pipeline>. That is the placeholder the surrounding codebase already uses for the org component (nf_core/pipelines/list.py). tests/test_utils.py: 32 passed, 2 pre-existing failures (test_list_files_git, test_list_files_no_git — the fixture copies the pipeline to a tmp dir with no .git, so git init fails; both fail identically without this change).
|
@/tmp/foss_4470_reply.md |
|
@/tmp/foss_4470_correction.md |
|
something seems to be off with your gh posting setup 😉 |
|
Good catch on all three, and they are in as of One correction while I am here: the commit message says the two And my previous two comments in this thread are the setup you flagged — they posted a local path instead of the text. That was a scripting slip on my side, not something to interpret. The substance those comments were meant to carry is the One thing I deliberately did not touch: |
Summary
Both malformed
manifest.namecases in #4467 trace 8000 back to one unconditional unpack inPipeline.load_pipeline_config()(nf_core/utils.py):name = 'My-Pipeline'(no/) →ValueError: not enough values to unpack (expected 2, got 1). The CLI'sselective_traceback_hooksuppresses tracebacks forValueError, so nothing pointed atmanifest.name, and the crash happened beforeTesting pipeline:was printed.namemissing → the"/"default unpacks to("", ""), and the emptypipeline_namelater raisesIndexErrorinfiles_exist(the crash reported in IndexError: string index out of range #4464).This PR validates the name at the source: if
manifest.nameis missing, or does not split into exactly two non-empty<repo>/<pipeline>parts, raise aUserWarningnaming the field and the expected format. All CLI callers (pipelines lint,pipelines bump-version,pipelines rocrate) already catchUserWarningand print it as a clean one-line error, so both cases now report e.g.:Note: #4466 guards the
files_exist.pysymptom downstream — that stays compatible; this change just makes the guard unreachable in practice.Testing
tests/test_utils.py::TestUtils::test_load_pipeline_config_malformed_manifest_nametests/test_utils.py::TestUtils::test_load_pipeline_config_missing_manifest_namenf-core pipelines linton a scaffolded pipeline): both malformed values now produce the one-lineERRORnamingmanifest.name(exit 1) instead of the bare ValueError / IndexError traceback.uv run pytest tests/test_utils.py tests/pipelines/lint/ tests/pipelines/test_lint.py: 83 passed, 3 pre-existing failures on cleanmainon macOS (symlinked-tmpdir/varvs/private/varpath asserts intest_list_files_git/test_list_files_no_git, andtest_files_unchanged_pass/test_template_strings_ignored) — reproduced identical on unmodifiedmainviagit stash, unrelated to this change.ruff check+ruff format --checkclean on touched files.Fixes #4467