Skip to content

fix(ci): validate checks out at depth 1 and fetches history only for a manifest with tasks - #1549

Merged
antonwolfy merged 3 commits into
intel:mainfrom
antonwolfy:ci/validate-shallow-checkout
Dec 3, 2026
Merged

antonwolfy merged 3 commits into
intel:mainfrom
antonwolfy:ci/validate-shallow-checkout

Conversation

@antonwolfy

@antonwolfy antonwolfy commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The validate job of repo-eval.yml checks the caller out with fetch-depth: 0 for every manifest. A guidance-only manifest (no tasks:) needs no history: Select tasks exits with "guidance-only manifest: no tasks to check" before its git diff, and eval check --schema-only has 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 in scan; 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 a fetch-depth input 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, job validate: the first checkout no longer sets fetch-depth: 0.
  • A new step "Decide whether the history is needed", after "Set up dokimi", reads the manifest named by inputs.manifest with dokimi's own load_manifest (the loader behind eval check --manifest), so "has tasks" is the same test Select tasks applies to the tasks key. It sets deepen=true only when tasks is set and git rev-parse --is-shallow-repository is not false. 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-only reports the manifest error. If git rev-parse --is-shallow-repository itself fails, the step fails with git's message instead of reading that as a shallow checkout.
  • A new step "Fetch the history" runs when deepen is true: a second actions/checkout at the same pinned SHA with fetch-depth: 0, persist-credentials: false and clean: false. It is a checkout rather than git fetch --unshallow because persist-credentials: false removes the token once the checkout step ends, so a later git fetch would have no credentials on a private caller repository. clean: false keeps the setup action's .dokimi-action directory.
  • The tasks-check job keeps its fetch-depth: 0, and scan is unchanged.
  • dokimi/tests/test_repo_eval_validate_history.py (new): parses the workflow and checks the first validate checkout has no fetch-depth, the deepening checkout has fetch-depth: 0, clean: false and the if, the step order, and that tasks-check still 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.
  • No changelog fragment: the change is under .github/ and dokimi/tests/, not dokimi/dokimi/, dokimi/data/ or pyproject.toml. The contract doc's "CI for a repository" section does not state the history depth of validate, so it is unchanged.

Risk

A manifest with tasks sees the same history in eval check --schema-only and Select tasks, now from a second checkout. A guidance-only manifest no longer has history in validate, 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 and eval check --schema-only fails on the manifest. The deepening step relies on actions/checkout turning fetch-depth: 0 into a full fetch of an existing shallow clone; this was read in the action's source at the pinned commit (--unshallow is added when fetch-depth is not positive and .git/shallow exists; clean: false skips git clean) but not run against a real runner. Open PR #1539 changes the name of the tasks-check job in the same file; it merges cleanly with this branch.

Testing

On a Linux review host, at 5fea3b1b (on main badfd39):

  • make ci-local: 38 passed, 0 failed, 16 skipped. ci.yml:test / Run tests: 34482 passed, 28 skipped, including tests/test_cli_fault_contract.py::test_a_bad_path_is_refused_as_the_quickstart_says[agent run], which main now 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 run reaches no path parameter, so its case fails on main #1544 and test_cli_fault_contract: agent run has 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.
  • The new test file: 11 passed. On main's workflow: 9 failed, 1 passed, the first at assert 'fetch-depth' not in {'persist-credentials': False, 'fetch-depth': 0}.
  • Ten mutants of the workflow, one break each, each failed the new tests: fetch-depth: 0 back on the first checkout, the if removed from the second checkout, clean: false removed, fetch-depth removed from the second checkout, the no-tasks branch removed, a manifest with tasks not deepened, a complete checkout deepened, the try/except removed, fetch-depth removed from tasks-check, a git fetch --unshallow step added, and the fetch step moved after eval check. An eleventh mutant, check=True removed from the git rev-parse call, fails the test of a directory that is no git repository.
  • Not run: a real GitHub runner (the second checkout, a private caller repository, the timings), and the other Python versions.

Open questions

None.

Revert

A plain revert restores the single full-history checkout in validate. Nothing is stored.

Checklist

  • Tests added/updated and pytest passes
  • ruff, mypy, and schema checks pass
  • Docs updated (or N/A) — see the docs-drift checklist in CONTRIBUTING.md
  • Self-reviewed per "Before opening a PR" in AGENTS.md
  • Each new raise/exit and test names the doc, contract or issue it traces to
  • No ad-hoc run artifacts committed
  • New files carry the SPDX license header (or are exempt in .github/.licenserc.yaml)

…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>
@antonwolfy
antonwolfy requested a review from a team as a code owner December 2, 2026 18:54
Copilot AI balanced review requested due to automatic review settings December 2, 2026 18:54
@antonwolfy antonwolfy self-assigned this Dec 2, 2026
@exai-bot

exai-bot commented Dec 2, 2026 •

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s).

CI at `5fea3b1`: 1 failing, 24 passing, 3 skipped

One check failed and three checks were intentionally skipped; the remaining checks passed. The Python 3.14 suite aborted on a timeout and pytest-xdist internal errors, but the available logs do not establish whether this change caused the failure, so no change-specific fix is justified.

Check Status Assessment
Tests (py3.14) failing at step Run tests Cause unclear. A 60-second pytest-timeout fired during the unchanged outcomes reporting hook, followed by pytest-xdist internal errors naming an unchanged catalog CLI test. The aborted run reports 17 failures without their diagnostic summaries; neither a matching baseline run nor evidence tying these failures...
Review details
  • Commit reviewed: 5fea3b1 against merge base badfd39
  • Coverage: 2 files in 1 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 131k tokens (76k from cache), 20s
  • Tool calls: 14 (8 file_read, 3 code_search, 1 ci_status, 1 local_check_results, 1 pr_threads)
  • small change set: 2 files

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
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 validate checkout shallow (default depth) instead of fetch-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

Comment thread .github/workflows/repo-eval.yml Resolved
Comment thread .github/workflows/repo-eval.yml Resolved
Comment thread .github/workflows/repo-eval.yml Resolved
@codecov-commenter

codecov-commenter commented Dec 2, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.49%. Comparing base (badfd39) to head (5fea3b1).
⚠️ Report is 1 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

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     

see 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…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>
@antonwolfy

Copy link
Copy Markdown
Contributor Author

Review points answered at 4eae9dc; 1 checks still pending (Windows smoke test (py3.13)); failed: Test Linux Python 3.14, Test Linux Wheels Python 3.14, Tests (py3.14).

Declined, with the evidence in the replies:

Tests (py3.14) fails the same tests on main (its latest run, at 892f927): not this PR's change.

@napetrov napetrov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@antonwolfy

Copy link
Copy Markdown
Contributor Author

(commented) ### Change class: CONTRACT (head 4eae9dc)

@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.

@antonwolfy

Copy link
Copy Markdown
Contributor Author

Ready for another look at 4eae9dc; failed: Test Linux Python 3.14, Test Linux Wheels Python 3.14, Tests (py3.14).

Test Linux Python 3.14 fails the same tests on main (its latest run, at 892f927): not this PR's change.
Test Linux Wheels Python 3.14 fails the same tests on main (its latest run, at 892f927): not this PR's change.
Tests (py3.14) fails the same tests on main (its latest run, at 892f927): not this PR's change.

@antonwolfy
antonwolfy requested a review from napetrov December 2, 2026 22:21

@napetrov napetrov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@antonwolfy

Copy link
Copy Markdown
Contributor Author

(approved) ### Change class: CONTRACT (head 4eae9dc)

@napetrov (#1549 (review)): Checked on the tree merged with current main (5fea3b1): make ci-local is 38 passed, 0 failed, 16 skipped, and tests/test_repo_eval_validate_history.py passes (11 tests). The agent run bad-path failure from earlier heads is gone after #1545 on main. A hosted private-repository checkout was not run here either.

@antonwolfy
antonwolfy merged commit 599fcad into intel:main Dec 3, 2026
36 of 37 checks passed
@antonwolfy
antonwolfy deleted the ci/validate-shallow-checkout branch December 3, 2026 13:12
antonwolfy added a commit to IntelPython/mkl_random that referenced this pull request Dec 3, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

repo-eval.yml: validate fetches the full history for a guidance-only manifest, which needs none

5 participants