Repository navigation
fix(repo): PATH@REV takes a revision with a slash; flush progress per task - #159
Conversation
…task repo scan .@origin/main read the spec as a path: the revision pattern had no '/'. Allow it (no '..', '//', trailing '/'). repo tasks check and repo run hand a flushing logger to the runners so CI shows lines as they come. 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 #159 +/- ##
==========================================
+ Coverage 91.64% 91.78% +0.14%
==========================================
Files 222 223 +1
Lines 27409 27637 +228
Branches 4508 4552 +44
==========================================
+ Hits 25118 25368 +250
+ Misses 1620 1607 -13
+ Partials 671 662 -9
🚀 New features to boost your workflow:
|
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
antonwolfy
left a comment
There was a problem hiding this comment.
Review at 1dec01a. The PATH@REV fix works for origin/main and refs/heads/x, but it breaks the split for unpinned remote URLs with a user. Three points, inline.
What I ran, on a Linux review host at 1dec01a:
make ci-local: 24 passed, 2 failed, 6 skipped. The failures aretest_unbalanced_quote_in_hook_completes_quickly(1.04 s against a 1 s limit, a timing flake under load; the rest of the suite is 6724 passed) and pip-audit on virtualenv 21.14.7 (CVE-2026-113722) from the existing locks, fixed onmainby #152. Changed-line coverage passes.- Reproductions of
RepoSource.parseon the PR head and on the base. - A mutation run over the new tests: 4 of the mutants survive the new tests and the existing
test_repo*.pytests.
Checked, no issues
- Non-rev suffixes: dropping the
..,//or trailing-/check is each caught by the new parametrized test. - Wiring: removing
log=_progressor passinglog=printin either command is caught. - Changelog: the fragment is present.
…st resolve_rev Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
With "/" allowed in a revision, a local path such as ws/job@2/repo or /home/alice@corp.com/proj was split at the "@" and failed as "not a directory". Split a local spec only when the whole spec is no directory. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
|
antonwolfy
left a comment
There was a problem hiding this comment.
Review at 6841ae8. The three earlier points are fixed, and the existing-directory rule from the last commit is right. One thing is worth fixing before merge: an unpinned remote URL with an @ in its path is still split at that @.
What I ran, on a Linux review host at 6841ae8:
make ci-local: 28 passed, 1 failed, 7 skipped. The failure is pip-audit on the existing locks, unrelated to the PR. 7,232 tests passed; changed-line coverage 100%.- Reproductions of
RepoSource.parseon the PR head and on the base. - A mutation run over the new tests: dropping the
spec.startswith(_REMOTE_PREFIXES)exemption, droppingfile://from_has_location_path, and allowing a leading/in_REV_REall pass the fulltest_repo*.pyrun. The other mutants (_is_revclauses,resolve_revguard, remote prefixes,log=_progress, flush) are caught.
Checked, no issues
- Pinned specs:
PATH@origin/main,ssh://git@host/o/r@origin/main,git@host:o/r@shaandws/job@2/repogive the same location and rev as before, or the intended new one. - Callers: nothing uses
.revas a file name or cache key;cache_pathhashes the URL only. - Flush test: with
print(line)instead ofprint(line, flush=True)it now fails on the 5 s wait.
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
antonwolfy
left a comment
There was a problem hiding this comment.
LGTM. The last commit fixes the remaining unpinned-URL splits, and the four specs from my earlier thread get the pin error again. One nit inline.
What I ran, on a Linux review host at 79bca0e:
make ci-local: 26 passed, 3 failed, 7 skipped. 7,246 tests passed; changed-line coverage passes. The failures arepip-audit, which fails on the lock files this PR does not touch, and the twogitleakssteps, which could not download the tool;gitleaks detectover the PR's 5 commits finds no leaks.RepoSource.parseonfile:///home/a@corp.com/proj,file:///tmp/a@b/c,https://github.com/o@x/r,git@github.com/o/r: each raises "a remote source must be pinned to a revision".ssh://git@host/o/r@origin/main,git@host:o/r@sha,https://github.com/o/r.git@v1.0,https://github.com/o@x/r@abc1234keep their location and revision.- A mutation run over the new tests: dropping
file://from_has_location_path, the_remote_split_okref-root check, theoriginandrefsroots, and the..and//clauses of_is_revare each caught.
Checked, no issues
- Limit the author named: a remote branch like
feature/xneeds a SHA or a ref-prefixed name (https://github.com/o/r.git@feature/xgives the pin error). The base gave the same error, so nothing regresses. - Wiring:
repo tasks checkandrepo runboth passlog=_progress. - Changelog: the fragment covers both fixes.
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 c969408, which fix the nit from my review:
c969408:dokimi/tests/test_repo_manifest.py:682: the pinned-spec test now has one case each for theupstream,remotes,headsandtagsroots, asserting the rev.
make ci-local at c969408: 28 passed, 1 failed (pip-audit), 7 skipped.
Part of #41 (found while porting oneDAL).
Summary
RepoSource.parse("PATH@REV") # rpartition on the last '@' - _REV_RE = [A-Za-z0-9._^~-]+ # origin/main -> no rev -> "not a directory" + _is_rev: [A-Za-z0-9._/^~-]+, no '..', '//', trailing '/' cmd_repo_tasks_check -> run_check(..., log=print) + run_check(..., log=_progress) # print(line, flush=True) cmd_repo_run -> run_batch(..., log=_progress)Every
repocommand that takes a source goes throughRepoSource.parse;resolve_revuses the same check.PYTHONUNBUFFEREDinrepo-eval.ymlis left as is.Evidence
dokimi repo scan .@origin/main->local source is not a directory: .@origin/main; per-task check lines appear only at exit under a pipe.After:
test_source_parse_takes_a_rev_with_a_slash[origin/main|refs/heads/x|HEAD~1|...]pass (local and remote);test_source_parse_leaves_a_non_rev_suffix_in_the_pathkeepsa..betc. in the path;test_progress_line_is_flushed_under_a_pipereads the line from a piped subprocess before it exits.Merge Danger
Door: two-way
Blast Radius: narrow
A local directory literally named
x@origin/mainwould now be read asxatorigin/main; same trade-off that already applied tox@main.Checklist
ruff check .cleandokimi/changelog.d/🤖 Generated with Claude Code