Skip to content

fix(cli): report convert openms data errors as click errors - #341

Merged
ypriverol merged 2 commits into
devfrom
fix/pr340-review-findings
Oct 6, 2026
Merged

ypriverol merged 2 commits into
devfrom
fix/pr340-review-findings

Conversation

@ypriverol

Copy link
Copy Markdown
Contributor

Summary

qpxc convert openms let ValueErrors for user-facing data problems escape as Python tracebacks. These include the new --consensusxml PSM run recovery failures ("no exact companion XML match", "ambiguous or unresolved companion XML run") and validation failures. They are now raised as click.ClickException, so the command exits with code 1 and a one-line error. This is the same pattern convert openms-consensus already 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_error drives 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 uncaught ValueError. 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:

Finding Outcome
convert openms data errors surface as tracebacks Real, fixed here
build_psm_run_lookup returns a resolver when identifications exist but carry no numeric spectrum references, so every PSM row fails Intended. test_hitless_pid_is_not_treated_as_header_only documents that "present but unusable identification evidence cannot disable validation", which guards against OpenMS#9872 run labels. Not changed.
SILAC labels now classify as "SILAC", which breaks the QuantMS MSstats converter Pre-existing. On main, 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:

  • The native-ID component regex no longer matches scan=5; / scan=5,. No real OpenMS reference with such separators was found.
  • build_psm_run_lookup holds all references in memory. This is a single pass, on the optional path.
  • Spectronaut keeps a PG.Quantity of 0 as 0, while MaxQuant/FragPipe null it when per-unit identification evidence exists. The new pg.md text leaves this ambiguous.

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.
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d47387c6-a56e-4d65-91e2-26a5251ccdac

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

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.

@ypriverol
ypriverol merged commit 7f3acfc into dev Oct 6, 2026
14 checks passed
@ypriverol
ypriverol deleted the fix/pr340-review-findings branch October 19, 2026 14:24
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