Repository navigation
fix(repo): a bare root-level name is not a run of the arm's file - #186
Conversation
A bare `lint` resolves through PATH, not to the workspace file, so the first word of a command counts only as ./lint, under the workspace path or after an interpreter. Answers the review question on uptake.py:109. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #186 +/- ##
=======================================
Coverage 91.67% 91.68%
=======================================
Files 223 223
Lines 27505 27520 +15
Branches 4525 4530 +5
=======================================
+ Hits 25216 25231 +15
Misses 1620 1620
Partials 669 669
🚀 New features to boost your workflow:
|
|
antonwolfy
left a comment
There was a problem hiding this comment.
LGTM. The fix is right: a bare root-level name no longer counts, and ./name, the workspace path and the interpreter forms still do. One nit on the regex.
What I ran, on a Linux review host at a20a1ff:
make ci-local: 27 passed, 2 failed, 7 skipped; 7246 tests, total coverage 93%.- The two failures are not the PR's.
test_growth_ratchetreportsdokimi/repos/compare.py::_provenance_warnings: 11 complexity is over the 10 cap, and the PR does not touchcompare.py.pip-auditfails on the lock files, which the PR does not touch. - Base and head regexes compared on about 70 command strings. Only bare-name forms (
lint,lint x,x | lint,(lint),cd d && lint) change from counted to not counted. Names with a/behave the same on both. - Mutation: restoring
(?:\./)?in the new pattern fails 3 of the new test cases; restoring it in only one of the two branches fails 1 or 2.
Checked, no issues
- Docs: no other doc or docstring still says "first in a command"; the contract line and the module docstring match the new behaviour.
- Changelog: the fragment is in the right directory and follows the fragment format.
Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
antonwolfy
left a comment
There was a problem hiding this comment.
LGTM. The fix is right, and the merge with main cleared the test_growth_ratchet failure that the earlier head had. The one nit from my earlier review is still open.
What I ran, on a Linux review host at 2011ba3:
make ci-local: 29 passed, 0 failed, 7 skipped.tests/test_repo_uptake.pypasses.- Base and head patterns compared on 73 command strings and 5 file sets. All 79 differing results go from counted to not counted, and every one is a bare root-level name as the first word of a command or of a
;,&&,|or(part../lint, the workspace path,sh lint,python3 lint,x;./lint,x|./lint,$(./lint)and names with a/give the same result as the base.
Still open from my earlier review:
dokimi/dokimi/repos/uptake.py:109: the[;&|(]\s*\./alternative is still in the pattern. Removing it changes no result on the 73 strings, so it is dead code, and thex | lint,(lint),;lintno-match cases are still not in the test.
Checked, no issues
- Docs: the contract line and the module and function docstrings match the new rule. No other doc still says "first word of a command".
- Changelog: the fragment follows the format in
changelog.d/README.md. - Repo rules: no schema, nav or generated-file change; the tests use synthetic events and run offline.
Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
antonwolfy
left a comment
There was a problem hiding this comment.
LGTM. I pushed a commit per nit, up to def5208, which fix the nit from my review:
def5208:dokimi/dokimi/repos/uptake.py:109: removed the dead[;&|(]\s*\./alternative and addedx | lint,(lint)and;lintto the no-match test cases.
make ci-local at def5208: 29 passed, 0 failed, 7 skipped.
Follow-up to #153 (#41 D4); answers the review question on
uptake.py:109that was still open when #153 merged.Summary
A bare name at the start of a command counted as a run of the arm's root-level file. It resolves through
PATH, and the workspace is not onPATH, so it does not run that file.Evidence
tests/test_repo_uptake.py:lint x,cd d && lintand barerunmove to the no-match cases; 40 passed. ruff clean.cd d && ./lintstill counts; the matcher does not followcd(same limit as the nested-path rule).Merge Danger
Door: two-way
Blast Radius: small. Only
uptake.commandsofpatch:cells whose arm adds a root-level file; a count can drop.🤖 Generated with Claude Code