Repository navigation
fix(cli): report convert openms data errors as click errors - #341
Conversation
ValueErrors raised for user-facing data problems (companion-match failures from --consensusxml PSM run recovery, validation failures) propagated out of convert openms as tracebacks. Wrap them in click.ClickException, as convert openms-consensus already does.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Summary
qpxc convert openmsletValueErrors for user-facing data problems escape as Python tracebacks. These include the new--consensusxmlPSM run recovery failures ("no exact companion XML match", "ambiguous or unresolved companion XML run") and validation failures. They are now raised asclick.ClickException, so the command exits with code 1 and a one-line error. This is the same patternconvert openms-consensusalready uses (convert.py).The fail-loud behaviour of the run recovery is unchanged. Only how the error is reported changes.
Test
test_cli_reports_a_match_failure_as_a_usage_errordrives the real CLI with a companion consensusXML that does not match. With the fix it exits with code 1 and the message. Without it, the result is an uncaughtValueError. The full suite passes (1,610 tests); ruff is clean.Context: independent review of #340
This is the one fix that came out of a multi-agent review of the dev → main PR #340. No finding reached the confidence threshold to be posted there. Three scored 75 and were re-checked by hand before this PR:
convert openmsdata errors surface as tracebacksbuild_psm_run_lookupreturns a resolver when identifications exist but carry no numeric spectrum references, so every PSM row failstest_hitless_pid_is_not_treated_as_header_onlydocuments that "present but unusable identification evidence cannot disable validation", which guards against OpenMS#9872 run labels. Not changed."SILAC", which breaks the QuantMS MSstats convertermain, the same SILAC SDRF + MSstats input already fails ("no SDRF sample for run … and label 'LFQ'"). Only the error message differs, so there is no regression and nothing is changed here.Lower-scored notes, not changed, for the record:
scan=5;/scan=5,. No real OpenMS reference with such separators was found.build_psm_run_lookupholds all references in memory. This is a single pass, on the optional path.PG.Quantityof 0 as 0, while MaxQuant/FragPipe null it when per-unit identification evidence exists. The newpg.mdtext leaves this ambiguous.