Repository navigation
fix(repo): PATH@REV takes a revision with a slash; flush progress per task #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6ea6aad
fix(repo): take a PATH@REV revision with a slash; flush progress per …
napetrov 1dec01a
test(repo): license header; close the progress test's pipe
napetrov 7ac3f2e
fix(repo): keep an unpinned user@ URL whole; bound the flush test; te…
napetrov f9975b0
Merge remote-tracking branch 'intel/main' into fix/scan-rev-unbuffered
napetrov 6841ae8
fix(repo): read an existing directory with an @ in its path whole
xaleryb 79bca0e
fix(repo): keep an unpinned remote spec with an @ in its path whole
napetrov c969408
test(repo): pin every remote rev root in the pinned-spec test
antonwolfy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
dokimi/changelog.d/20261021_120000_napetrov_scan-rev-unbuffered.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ### Fixed | ||
|
|
||
| - **`PATH@REV` takes a revision with a slash** — `repo scan .@origin/main` (and `refs/heads/x`) read the whole spec as a path and failed with "not a directory"; a branch with `/` is now a revision for every `repo` command that takes a source. A suffix that is no revision (`a..b`, `x//y`, trailing `/`) still stays in the path, and an existing local directory with an `@` in its path (`ws/job@2/repo`) is read whole. | ||
| - **`repo tasks check` and `repo run` progress is flushed per task** — under a pipe (CI) the per-task lines were block-buffered and all appeared at exit unless `PYTHONUNBUFFERED` was set. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Copyright (C) 2026 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """Progress lines of `repo tasks check` / `repo run` are flushed one by one, not at exit.""" | ||
|
|
||
| import select | ||
| import subprocess | ||
| import sys | ||
|
|
||
|
|
||
| def test_progress_line_is_flushed_under_a_pipe(): | ||
| code = ("import sys, time\n" | ||
| "from dokimi.commands.repo_run import _progress\n" | ||
| "_progress('t1: OK')\n" | ||
| "time.sleep(30)\n") | ||
| proc = subprocess.Popen([sys.executable, "-c", code], stdout=subprocess.PIPE, text=True, | ||
| env={"PATH": "", "PYTHONPATH": ":".join(sys.path)}) | ||
| try: | ||
| assert proc.stdout is not None | ||
| # A flushed line arrives at once; a buffered one stays in the child until it exits (30 s). | ||
| ready, _, _ = select.select([proc.stdout], [], [], 5) | ||
| assert ready, "no progress line within 5 s: the line was not flushed" | ||
| assert proc.stdout.readline() == "t1: OK\n" | ||
| finally: | ||
| proc.kill() | ||
| proc.wait() | ||
| if proc.stdout is not None: | ||
| proc.stdout.close() | ||
|
|
||
|
|
||
| def test_commands_hand_the_flushing_logger_to_the_runners(): | ||
| import inspect | ||
|
|
||
| from dokimi.commands import repo_run | ||
|
|
||
| src = inspect.getsource(repo_run) | ||
| assert src.count("log=_progress") == 2 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.