Repository navigation
fix(ci): validate checks out at depth 1 and fetches history only for a manifest with tasks - #1549
Conversation
…a manifest with tasks (intel#1535) The validate job of repo-eval.yml checked the caller out with fetch-depth: 0 for every manifest, but a guidance-only manifest (no tasks) needs no history: Select tasks exits before its git diff and eval check --schema-only has no task base to open. The first checkout is now depth 1. A new step, after Set up dokimi, reads the manifest with dokimi's own load_manifest (the loader behind eval check --manifest, so "has tasks" is the test Select tasks applies to the manifest's tasks key) and asks for the history only when tasks is set and the checkout is still shallow (git rev-parse --is-shallow-repository). A manifest that cannot be read keeps the shallow checkout and eval check --schema-only reports it as before. The history comes from a second actions/checkout with fetch-depth: 0, not from git fetch --unshallow: the checkouts use persist-credentials: false, which removes the token once the checkout step ends, so a later git fetch has no credentials on a private caller repository. The second checkout has clean: false so it does not delete .dokimi-action, and is pinned to the same SHA as the others. The tasks-check and scan jobs are unchanged. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s). CI at `5fea3b1`: 1 failing, 24 passing, 3 skipped
Review details
|
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
4 open issues
CatchingExceptionaround both the manifest loading and anything it transitively triggers can… · New Thisgit rev-parsecall ignores the return code. If the command fails (e.g., unexpected working… · New The conditionif not tasks:treats any falsy value as 'no tasks' (e.g., empty list / empty… · New The regex uses a greedy(.*)withre.S, which can over-capture if the step content ever… · New
What changed in this PR
Updates the repo-eval.yml validate job to avoid fetching full git history for guidance-only manifests, deepening to full history only when the manifest actually has tasks.
Changes:
- Make the initial
validatecheckout shallow (default depth) instead offetch-depth: 0. - Add a decision step that inspects the manifest to determine whether history is needed, and conditionally re-checkout with full history.
- Add a new test suite validating workflow structure and the decision logic on shallow vs full clones.
| File | Description |
|---|---|
.github/workflows/repo-eval.yml |
Switches validate to shallow checkout by default, conditionally deepening only for manifests with tasks. |
dokimi/tests/test_repo_eval_validate_history.py |
Adds tests to enforce the checkout/deepen behavior and validate the decision-step logic. |
Review effort: Lite
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1549 +/- ##
==========================================
- Coverage 96.50% 96.49% -0.01%
==========================================
Files 539 539
Lines 72177 72177
Branches 12445 12445
==========================================
- Hits 69655 69650 -5
- Misses 1545 1547 +2
- Partials 977 980 +3 🚀 New features to boost your workflow:
|
…the checkout is shallow Settles the review point that the `git rev-parse --is-shallow-repository` call of "Decide whether the history is needed" ignored its exit status, so a git that failed read as a shallow checkout and the step went on to deepen it. The call now uses check=True, and the step fails with git's own message. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
|
Review points answered at Declined, with the evidence in the replies:
|
napetrov
left a comment
There was a problem hiding this comment.
Change class: CONTRACT (head 4eae9dc)
- Contract: changed. wf .github/workflows/repo-eval.yml
- Responsibility: none
- Dependency: none
- Review depth: check the changed surface: callers, docs, tests pin new behaviour
- Coverage gaps: none
0 new must-fix findings. Nothing to fix in this round. The history decision uses the manifest loader. Guidance-only and invalid manifests stay shallow. Valid task manifests request the full checkout before validation.
Checked the diff, input edges, and focused offline Linux tests (merged: 69 passed in 8.04s). Checked the history-decision step on real local shallow/full clones. The GitHub checkout action on a private caller was not exercised.
@napetrov (#1549 (review)): The review asks for no change: it reports 0 new must-fix findings. I made no commit this round and the head stays 4eae9dc. |
|
Ready for another look at
|
napetrov
left a comment
There was a problem hiding this comment.
Change class: CONTRACT (head 4eae9dc)
- Contract: changed. wf .github/workflows/repo-eval.yml
- Responsibility: none
- Dependency: none
- Review depth: check the changed surface: callers, docs, tests pin new behaviour
- Coverage gaps: none
The three historical test failures share one cause fixed in main by #1545. The exact failing case and shallow-checkout tests passed on the current merge (12 tests). Required checks passed. Hosted private-repository checkout was outside this review.
Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
@napetrov (#1549 (review)): Checked on the tree merged with current |
The new pin brings intel/dokimi#1548, which makes `repo scan` name its unresolved claims as info findings in the job summary, and intel/dokimi#1549, which makes `repo validate` check out at depth 1 when the manifest has no tasks. The reusable workflow takes the same inputs and permissions as at 00a761c. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>


Summary
The
validatejob ofrepo-eval.ymlchecks the caller out withfetch-depth: 0for every manifest. A guidance-only manifest (notasks:) needs no history:Select tasksexits with "guidance-only manifest: no tasks to check" before itsgit diff, andeval check --schema-onlyhas no task base to open. On a caller with a long history the full fetch is the longest step of the job (the issue reports 1 min 54 s of 2 min 42 s on a guidance-only caller, against 1 s at depth 1 inscan; these are the issue author's CI measurements and were not reproduced here).The fix is the issue's proposal: check out at depth 1 and deepen only for a manifest that has tasks. The other option the issue lists (
filter: blob:none) still walks the whole history, and afetch-depthinput moves a choice the workflow can make from the manifest to every caller, so neither is taken.Closes #1535
Changes
.github/workflows/repo-eval.yml, jobvalidate: the first checkout no longer setsfetch-depth: 0.inputs.manifestwith dokimi's ownload_manifest(the loader behindeval check --manifest), so "has tasks" is the same testSelect tasksapplies to thetaskskey. It setsdeepen=trueonly whentasksis set andgit rev-parse --is-shallow-repositoryis notfalse. A manifest that cannot be read (missing, not YAML, wrong shape) keeps the shallow checkout and prints one line, with no traceback:eval check --schema-onlyreports the manifest error. Ifgit rev-parse --is-shallow-repositoryitself fails, the step fails with git's message instead of reading that as a shallow checkout.deepenistrue: a secondactions/checkoutat the same pinned SHA withfetch-depth: 0,persist-credentials: falseandclean: false. It is a checkout rather thangit fetch --unshallowbecausepersist-credentials: falseremoves the token once the checkout step ends, so a latergit fetchwould have no credentials on a private caller repository.clean: falsekeeps the setup action's.dokimi-actiondirectory.tasks-checkjob keeps itsfetch-depth: 0, andscanis unchanged.dokimi/tests/test_repo_eval_validate_history.py(new): parses the workflow and checks the firstvalidatecheckout has nofetch-depth, the deepening checkout hasfetch-depth: 0,clean: falseand theif, the step order, and thattasks-checkstill fetches the full history. It also lifts the decision step's Python out of the workflow and runs it on a real shallow clone: a guidance-only manifest decides no fetch, a manifest with tasks decides to fetch, a complete clone does not fetch, and a missing, unparseable, wrong-shape or guidance-less manifest decides no fetch with no traceback. A directory that is no git repository fails the step and writes no output..github/anddokimi/tests/, notdokimi/dokimi/,dokimi/data/orpyproject.toml. The contract doc's "CI for a repository" section does not state the history depth ofvalidate, so it is unchanged.Risk
A manifest with tasks sees the same history in
eval check --schema-onlyandSelect tasks, now from a second checkout. A guidance-only manifest no longer has history invalidate, which nothing in that job reads. A caller that passes a complete clone, or whose history is short, skips the second checkout. If the manifest cannot be read, the job stays shallow andeval check --schema-onlyfails on the manifest. The deepening step relies onactions/checkoutturningfetch-depth: 0into a full fetch of an existing shallow clone; this was read in the action's source at the pinned commit (--unshallowis added whenfetch-depthis not positive and.git/shallowexists;clean: falseskipsgit clean) but not run against a real runner. Open PR #1539 changes the name of thetasks-checkjob in the same file; it merges cleanly with this branch.Testing
On a Linux review host, at
5fea3b1b(onmainbadfd39):make ci-local: 38 passed, 0 failed, 16 skipped.ci.yml:test / Run tests: 34482 passed, 28 skipped, includingtests/test_cli_fault_contract.py::test_a_bad_path_is_refused_as_the_quickstart_says[agent run], whichmainnow passes (test(cli): fill --agent so the bad-path contract reaches agent run #1545 fills--agent; earlier heads failed it, tracked in test_cli_fault_contract:agent runreaches no path parameter, so its case fails on main #1544 and test_cli_fault_contract:agent runhas no filler that reaches a path parameter, so the bad-path contract test fails on main #1546). Changed-line coverage and the changed-line mutation step had no package lines to measure. Skipped steps include the matrix legs the local run cannot execute, semgrep, micromamba and the Docker-dependent jobs.main's workflow: 9 failed, 1 passed, the first atassert 'fetch-depth' not in {'persist-credentials': False, 'fetch-depth': 0}.fetch-depth: 0back on the first checkout, theifremoved from the second checkout,clean: falseremoved,fetch-depthremoved from the second checkout, the no-tasks branch removed, a manifest with tasks not deepened, a complete checkout deepened, thetry/exceptremoved,fetch-depthremoved fromtasks-check, agit fetch --unshallowstep added, and the fetch step moved aftereval check. An eleventh mutant,check=Trueremoved from thegit rev-parsecall, fails the test of a directory that is no git repository.Open questions
None.
Revert
A plain revert restores the single full-history checkout in
validate. Nothing is stored.Checklist
pytestpassesruff,mypy, and schema checks passAGENTS.mdraise/exit and test names the doc, contract or issue it traces to.github/.licenserc.yaml)