Repository navigation
fix: settle two leftovers of the reviews of #628 and #828 - #856
Conversation
Settles review point B1.1 of intel#628: the formal-model README and the RepoBatch.tla comment said the batch result is written with mkstemp + os.replace, but the code writes a `<name>.<pid>.<thread>.tmp` sibling of the target and then calls os.replace (artifacts.py). Only the README row and the TLA+ comment change; no state or action of the model is touched. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
…nd eval check Settles the review of intel#828 that left the exit-2 text stale: `_SOURCE_EXIT` (the help of `repo run` and `eval check`), the `tasks generate` help and the repository-evaluation contract now name a `--cache-dir` that is not a usable directory, which these commands refuse with exit 2. A test pins the phrase in the help of both commands. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
Settles review point B2.1 of intel#628: nothing pinned the `{batch or where}` label that starts the refusal in refuse_mixed_executions, so replacing it with `{where}` kept the suite green. The new test checks that the message starts with the batch name the cells record, and with `where` when they record none. Adds the changelog fragment for this and the help text. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 7 selected item(s). CI at Review details
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #856 +/- ##
=======================================
Coverage 95.76% 95.76%
=======================================
Files 424 425 +1
Lines 56511 56472 -39
Branches 9730 9718 -12
=======================================
- Hits 54115 54079 -36
+ Misses 1487 1486 -1
+ Partials 909 907 -2
🚀 New features to boost your workflow:
|
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
Review at 9e5c257. The --cache-dir exit-2 case is right in the help and in §4.6/§4.8 of the contract, and the new tests pin it. But the formal-model change describes a temp file the runner does not use, and two docs still miss the case. Details are in the line comments.
What I ran, at 9e5c257:
make ci-local --offline: 0 failed, 23 passed, 20 skipped; tests 22,338 passed, 72 skipped.eval tasks generate --from graphwith a bad--cache-dir: the index is read first (exit 2 on a bad index); after it,_source_treechecks the cache dir, so the graph path has the exit-2 case too.
Checked, no issues
- Help texts:
_SOURCE_EXITfeeds bothCHECK_EXITandRUN_EXIT, soeval checkandrepo runboth get the clause; the new help test fails on the base, which lacks it. - Mixed-execution test:
refuse_mixed_executionsstarts with the recorded batch, else the label it is given; the test checks both.
…o more docs Settles the review threads on intel#856: the formal-model README row and the RepoBatch.tla comment describe the write of result.json as mkstemp + os.replace again, since the runner writes through batch_ledger.write_json, which uses mkstemp. The --from graph section of the repository-evaluation contract (§4.7) and the exit-code paragraph of the quickstart now list a --cache-dir that is not a usable directory among the exit-2 cases. The help test also covers the eval tasks listing that holds the generate description, and the changelog fragment drops the bullet about the pinned mixed-execution label, which changes nothing a user sees. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
@vlad-perevezentsev (#856 (review)): The line comments are answered in their threads (66536e1): the mkstemp wording is restored in the README and |
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
LGTM
I checked 66536e1: every point of my first round is fixed. The formal model reads "mkstemp + os.replace" again, as the code does, and the --cache-dir exit-2 case is now in the --from graph section and in the quickstart too.
Merge: safe now: it merges cleanly into current main, 5 commits behind, and its tests pass on the merge (test_cli_help.py, test_repo_report_unreadable_cell.py, test_docs_code_refs.py: 357 passed). No open PR conflicts with it once it is in.
What I ran, at 66536e1:
make ci-local --offline: 1 failed, 22 passed, 20 skipped. The failure isschema_compat: it compares against a newermainthat hasrepo_event.v1.json, which this branch predates. This PR changes no schema.eval tasks --helpshows the newtasks generatetext, which the new test case checks.
Summary
Follow-up to the reviews of #628 and #828, which left two small points open on
main.{batch or where}label that starts the mixed-execution refusal inrepos/report.py; replacing it with{where}kept the whole suite green._SOURCE_EXITincommands/repo_run.py, thetasks generatehelp and the repository-evaluation contract list the exit-2 cases of a source but not a--cache-dirthat is not a usable directory, which_cache_dirrefuses with exit 2 since fix(repo): refuse a --cache-dir that is not a usable directory with exit 2 #828.Changes
_SOURCE_EXIT(the description ofrepo runandeval check), thetasks generatehelp, four paragraphs ofdocs/repo-evaluation-contract.md(therepo run/eval checkone and the--from replay,--from graphand--from prssections) and the exit-code paragraph ofdocs/quickstart.mdname "a--cache-dirthat is not a usable directory" among the exit-2 cases.tests/test_cli_help.py: the--helpofrepo runandeval check, and theeval tasks --helplisting that holds thetasks generatedescription, name the--cache-dircase.tests/test_repo_report_unreadable_cell.py: the mixed-execution refusal starts with the batch name the cells record, and withwherewhen they record none.Risk
None: help and doc text and two tests. The behaviour of every command is unchanged.
Testing
On a Linux review host, at
66536e1(onmain08f393c):make ci-local: 34 passed, 0 failed, 14 skipped (matrix legs on other Pythons,semgrep,conda-forge, fuzz, the CLI-surface package step and the jobs that do not run on a PR). 22392 tests passed, 19 skipped; changed-line coverage 100% (no measurable changed line).{batch or where}to{where}and to{batch}each failtest_the_mixed_execution_refusal_starts_with_the_batch_name_or_else_where(one of its two cases); removing the--cache-dirphrase from_SOURCE_EXITfails both cases oftest_the_exit_2_help_of_a_source_command_names_the_cache_dir_case; removing it from thetasks generatehelp fails its case.--cache-dirnaming a regular file exits 2 with "--cache-dir ... is not a directory" forrepo run,eval check,tasks generate --from replayand--from prs;--from graphexits 2 on a bad index first, and reads the cache directory after it.Open questions
None.
Revert
A plain revert restores the old help and doc text and drops the two tests. 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)