Repository navigation
fix(cli): make qa duplicates --threshold work on Typer 0.29 (#1597) - #1607
swastiktawate wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Automated review by the maintainer's conductor agent, of head c7b58f25. Read from the whole diff; nothing was run on this head.
Thank you for this. The fix is right, and it is the same fix as two pull requests that were already open when this one arrived:
- #1604 (the maintainer's loop; claimed on the issue at 11:36Z, pushed 11:37Z) and #1603 (opened 11:51Z). The maintainer decided today that #1604 lands, with #1603's author credited as co-author, because #1597 blocks Thursday's release and #1604 carries a test that is red on
devwithout the fix. #1604 is now in the merge queue. The decision is recorded on #1603. - So this pull request cannot land: when #1604 merges, #1597 closes and this is closed as superseded. That is no comment on the quality of the work.
What you did differently, and it is the better idea: test_cli_accepts_a_threshold_on_the_boundary checks the reply (payload["threshold"] and count == 1), where #1604's boundary test checks only the exit code. If you want that kept, open a small test-only pull request against dev after #1604 has merged, adding just that test to tests/test_qa_duplicates.py (prefix test:, no changelog fragment needed). It would be reviewed the same day.
Two notes for next time, so your work is not spent twice:
- Before starting an issue, look for an open pull request and a claim comment:
gh pr list --state open --search "1597 in:body,title"showed #1603 and #1604, and the issue had a claim comment from 11:36Z. CONTRIBUTING, "Branches, hooks and pull requests", describes the claim rule. parser=_parse_unit_interval, min=0, max=1declares the range twice. With aparser=function Typer hands click a function type, and I did not check whethermin=/max=are then read or ignored on 0.27.3 and 0.29.1; one of the two should be the rule, not both.
Open work that is yours to pick and has nobody on it: the per-option range issues under #1541 that carry good first issue and have no pull request. Your own open pull requests #1408, #1410, #1415, #1422 and #1428 each have review items waiting, and #1390, #1391, #1411 and #1462 conflict with dev; finishing those would land more than a new one.
Recommendation: close as superseded by #1604 once it has merged.
|
Closing as superseded, per the review on this head: #1604 merged to |
Fixes #1597.
Typer 0.29 removed the click_type parameter, so every pyrite command crashed at import because qa duplicates --threshold was declared with click_type=_UnitInterval(). This replaces the custom click type with a parser function that raises typer.BadParameter, keeping the same refusal behaviour: values outside 0 to 1, NaN, inf and non-numbers are still refused as usage errors (exit 2).
The fix also covers the boundaries: --threshold 0 and 1 are accepted end to end, pinned by a new CLI test. No other click_type= remains under pyrite/ or extensions/.
Changelog: changelog.d/1597-qa-duplicates-threshold.fixed.md