Repository navigation
tests/test_adopt_plan_value_order.py: a bad id: or org: beside a --work-dir that is a file or a shared one, or beside a gone source, is the value's refusal in both check and execute, so the head ask is pinned against _work_root's other refusals and the source (#1179) - #1226
Conversation
… right after its three repository names, so a bad one beside an unanswered entry, a moved source, a refused name or another repository is that one refusal in both, and a `pins:` entry that is no pin is said as `_read_as` says it (#1020) #901 made `check` and `execute` name the same first problem among a plan's options. Outside them, the two still named different problems first (#1020, found by lane 1's writer on #901). 1. **One rule, the refusal before what `check` lists.** `check` refuses a bad `org:` or `id:` outright, exit 2, and lists none of its findings. `execute` refuses at the first of them, but it asked the two only after it had refused four things that `check` lists as findings: a plan for another repository (`plan-not-the-source`), a name the naming policy refuses (`naming-unclassified`), an unanswered entry (`plan-unresolved`) and a source that has moved on (`plan-stale`). And `check` asked the two only where the policy took the plan's names (`_manifest_values`), so an unsafe `org:` beside a refused name was a finding about the name, or about another repository. Both commands now ask the two first of the plan's values, right after the three repository names (`plan.names()`, then `_checked_org_and_id`): `execute` in `cmd_execute`, ahead of `_refuse_a_plan_for_another_repository`, and `check` at its head, after the triad advisory. `_checked_plan_values` no longer asks them, since `cmd_execute` has. 2. **#716's L4-48, decided.** An `org:` that `checked_value` refuses, held to a repository, was `unsafe-value` to `check` and `plan-not-the-source` to `execute`. Such an `org:` names no repository, on GitHub or in the manifest, so it is not compared with the source's. It is `unsafe-value` in both commands now, held to a repository or not. Once it is mended, a plan for another repository is still `plan-not-the-source` in both. This reverses three tests in `tests/test_adopt_check_plan_name.py`, which pinned the old answers on purpose: - `test_an_unsafe_org_is_unsafe_in_check_and_compared_by_execute_if_held` expected `plan-not-the-source` from `execute` in its six held rows. As `test_an_unsafe_org_is_unsafe_in_check_and_in_execute_held_or_not`, all twelve expect `unsafe-value` from both, in the same words. - `test_check_compares_an_unsafe_org_where_no_manifest_is_built` expected `check` to compare `org: acme labs` beside the refused name `bad_name`: `plan-not-the-source` and `naming-unclassified`, exit 1. As `test_an_unsafe_org_is_asked_before_the_plans_refused_names`, it expects `unsafe-value`, exit 2, from `check` and from `execute`. - `test_check_asks_an_unsafe_org_first_where_a_kept_submodule_url_is_relative` expected `plan-not-the-source` from `execute`. It now expects `unsafe-value`, in `check`'s words. 3. **A `pins:` entry that is no pin** was spelled with `repr` (`` `pins:` entry 1 is 7 ``, `True`, `None`). #901 made `pins:` itself read as `_read_as` reads it, and an entry reads the same way now: "the number 7", "the boolean true", "null", "a list of 2 item(s)". Docstrings and comments now say this: `_checked_org_and_id`, `_checked_plan_values`, `_manifest_values`, `_held_findings`, `_not_the_source`, `_refuse_a_plan_for_another_repository`, `_read_pins` and the #499 block comment. No finding is added or removed: only which problem is named first changes, and the spelling of an entry. Measured on main at `6da757cb` and on this branch, with a stub `gh`, a bogus token, an empty `GH_CONFIG_DIR`, `GIT_SSH_COMMAND=false` and `--local-remote-dir`. No run made a leg. | The plan has | `check` on main | `execute` on main | both, here | |---|---|---|---| | a bad id beside an unanswered entry | `plan-bad-id` | `plan-unresolved` | `plan-bad-id` | | a bad id beside a source that has moved on | `plan-bad-id` | `plan-stale` | `plan-bad-id` | | a bad id beside a name the policy refuses | `plan-bad-id` | `naming-unclassified` | `plan-bad-id` | | a bad id beside another organisation, held to a repository | `plan-bad-id` | `plan-not-the-source` | `plan-bad-id` | | no `id:`, and `legs.assembly: north_wind` (a derived id the policy refuses too) | `plan-bad-id` | `naming-unclassified` | `plan-bad-id` | | an unsafe `org:` held to a repository (L4-48) | `unsafe-value` | `plan-not-the-source` | `unsafe-value` | | an unsafe `org:` beside an unanswered entry | `unsafe-value` | `plan-unresolved` | `unsafe-value` | | an unsafe `org:` beside a source that has moved on | `unsafe-value` | `plan-stale` | `unsafe-value` | | an unsafe `org:` beside a refused name | finding `naming-unclassified`, exit 1 | `naming-unclassified` | `unsafe-value` | | the same, held to a repository | finding `plan-not-the-source`, exit 1 | `plan-not-the-source` | `unsafe-value` | Each "here" row is exit 2 from both, word for word. The last two rows agreed on main. They change because `check` now asks the two where the policy refuses the names, as `execute` now does: without that, moving `execute` alone would have made them disagree. Plans with only one of these problems (an unanswered entry, a moved source, a refused name, another repository) are named as on main by both. **Tests.** - `tests/test_adopt_plan_value_order.py` gains 16 rows: - the 10 above, through both commands, comparing the first line; - four `pins:` entries that are no pin: number, boolean, null and list; - two guard rows, `id` and `org`: a leg name `checked_value` refuses (`legs.spec: "-spec"`) beside a bad `id:` or `org:` is that name's `unsafe-value` in both, so the three names are still asked first. - The 14 non-guard rows all fail against `6da757cb`'s `adopt-project.py` and pass here. The two guard rows pass on both, by design. - Existing rows changed for the new behaviour: - `test_adopt_check_plan_name.py`: the three tests above, and its docstring's L4-48 line. - `test_adopt_pins.py`: `a-number`. - `test_adopt_execute_refusals.py`: the three entry rows of `PIN_ENTRIES`. Closes #1020 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… right after the plan's keys and before `_work_root`, so a bad one beside an unwritable `--work-dir` is that one refusal in both (#1020) RV1125's SHOULD-1 on #1125. A bad `id:` or `org:` beside a `--work-dir` this user cannot write in was `plan-bad-id` (or `unsafe-value`) to `check` and `adopt-work-dir-unwritable` to `execute`: `check` lists the directory as a finding (#524), and `execute` refuses it before it opens the source, ahead of the two asks, which #1125 had placed after `_work_root`. The comments in `cmd_execute` and `_checked_org_and_id` said that cannot happen. - `cmd_check` asks `plan.names()` and `_checked_org_and_id(plan)` right after its mistyped-plan question, before `_work_root`, and `cmd_execute` asks them right after `_refuse_a_mistyped_plan`, before `_work_root`. Both read only the plan. `execute` now asks them before `_require_filter_repo()` too. - A side effect, said in the body: `check` printed the Triad advisory, once it had opened the source, before it refused a bad `org:` or `id:`; it prints nothing now, since the refusal comes before the source is opened. - The comments and docstrings that placed the asks "at its head, after the triad advisory" or "right after the names" say where they are now. - tests/test_adopt_plan_value_order.py: `both_on` takes a `--work-dir` for both commands; one row per bad `id:` and bad `org:` beside an unwritable `--work-dir` (skipped where `chmod` cannot keep this user from writing); and, for NIT-2, one row per value that asks `check` alone and holds stdout empty, the position being told by the Triad advisory the unedited plan prints first. - tests/test_adopt_check_plan_name.py: the docstring of the kept-submodule row says it is a regression row since `check` asks `org:` at its head (NIT-1). Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…`--work-dir` that is a file or a shared one, or beside a gone source, is the value's refusal in both `check` and `execute`, so the head ask is pinned against `_work_root`'s other refusals and the source (#1179) Six rows, with the plan unedited beside the same file, directory or path as the control. Test only: no change to adopt-project.py. Stacked on the head of #1125 (9549006). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Reviewer's GuideTestsDocument and add parameterized checks that invalid
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
RV1226: independent review of #1226 at Independent review for lane openRepoShape-4 of #1226 (for #1179), stacked on #1125 ( What I measured
MutantsEach was applied to
L8 is new here: the 85 old rows and RV1125b's agree-only probe both let it live, and the file and shared rows kill it. Gate on a scratch merge of current mainScratch merge The environment was the landing gate's:
Merge-trees (
|
| Against | Tree |
|---|---|
origin/main 50ce8ab15 and f61be9f5 |
bede214aa0d5, the same as the body's |
#1125's head 9549006fe and f61be9f5 |
8c604453d476, this head's own tree |
#1198's head d38e4e36d and f61be9f5 |
a1504e06d18f, the same as the body's |
my scratch merge b079615ea and #1198's head |
fb54228545ca, clean |
Of the open PRs, only #1125, #1198 and this one touch tests/test_adopt_plan_value_order.py.
Findings
NIT-1: a second sys.path insert for an import that is already loaded. The new lines add sys.path.insert(0, str(REPO / "scripts")) and from repo_shape import double_quoted. But test_adopt_template_values, imported on the line above, already does both at its import (its lines 57 and 59). So scripts/ lands on sys.path twice.
Fix: from test_adopt_template_values import double_quoted, with_line. Then drop the sys import, the REPO import and the insert.
NIT-2: the module docstring undercounts _work_root. It says "_work_root refuses two more things before it makes anything". _work_root also refuses:
- a symlink loop;
- a symlink to something that is no directory;
- a directory another user owns;
- a shared directory above the
--work-dir.
The rows rightly cover two of them.
Fix: "refuses more before it makes anything, among them a --work-dir that is a file and one every user can write in". Or leave it.
Landing note, not a finding: GitHub reads the body's closing line only once the PR is retargeted to main after #1125 lands. closingIssuesReferences is empty now. Check that it reads #1179 before landing.
Lane: openreposhape-4 (openRepoShape-4)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…eeping this branch's tests/test_adopt_plan_value_order.py #1125's own files are the same in its final head and its squash, so the one conflict (tests/test_adopt_plan_value_order.py) is taken as this branch had it. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
RS1226: #1226 restacked onto main after #1125's squash. New head: 19d03d4 (it was f61be9f, which RV1226 graded READY). Pushed as a plain fast-forward (f61be9f..19d03d4), no force; The three merges (merge commits, never a rebase; each by the estate identity):
Delta comparison. The real base is
Gate at 19d03d4 (git filter-repo on PATH, EMAIL set, the lane variables unset, basetemps under /tmp, never the full suite):
Merge-trees ( Main moved while the gate ran. origin/main is now 3ee5bb4 (two commits past 5c662f7: 9cb156a for #1161's plan-case-twins and 3ee5bb4 for the GNUmakefile change; ten files, none is tests/test_adopt_plan_value_order.py). The pushed head does not contain them and the gate above did not run on them. Please review the restack only (a delta review): the three merge commits above, and that the branch's only change against main is the reviewed +102/-1 lines in tests/test_adopt_plan_value_order.py. The test rows themselves were reviewed at f61be9f. Lane: openreposhape-4 (openRepoShape-4) |
|
RVD1226: delta review of #1226's restack at Delta review for lane openRepoShape-4 of RS1226's restack of #1226 (for #1179) onto main after #1125's squash. I did not write the restack, and I reviewed it only: nothing pushed, no edit to the PR. The change itself was graded READY by RV1226 at The eight checksAll commands ran in my own clone with refs
1. Ancestry: PASS.
2. Merge 1: PASS. The tree of 3. Merge 2: PASS. 4. Merge 3: PASS. The tree of 5. The delta: PASS. The merge base of
6. Today's main: PASS. Main moved twice while I worked:
7. Tests: PASS. Environment as the lane rules give:
There was no failing id, so there was nothing to compare against Extra, beyond the brief: the new rows still bite on the refreshed code. RV1226 graded the rows against
The same 4-of-6 kills RV1226's table shows for L1, L4 and L8. 8. RS1226's comment (#1226 issuecomment-6752188531): PASS. Each fact checked:
FindingsNone at MUST, SHOULD or NIT. At review time GitHub reports the PR ScratchMy clone is Lane: openreposhape-4 (openRepoShape-4) |
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 4 days and 4 hours by commenting |
|
Lane: openRepoShape-3 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lan_value_order.py The PR's own no-context lines over the squash equal its lines over #1226's head 489bc3e, and the tree is 960f1ad, the tree of this PR's own range applied to main. Lane: openRepoShape-3 Co-Authored-By: Claude Opus 5.5 <[email protected]>



Test only: six rows in
tests/test_adopt_plan_value_order.pythat kill four surviving mutants (L1, L2, L4 and L11) of #1125's head ask. No change toadopt-project.py(its sha256 is412edbdaon #1125's head and on this one).This PR lands after #1125 and stays a draft until then. Its base is
fix/1020-bad-id-first-problem(#1125's head9549006fe), notmain, so the diff is this one commit. #1125 is a draft againstmainand has not landed. Once #1125 has landed, this branch is brought up to date withmainand gated again on that head before it lands.Closes #1179
What the rows pin
RV1125b's NIT-A on #1125 (for #1020):
checkandexecuteaskplan.names()and_checked_org_and_id(plan)right after the plan's keys and before_work_root. One row pinned that position against the work directory, and it used a directory made unwritable withchmod._work_rootrefuses two more things before it makes anything, and both commands refuse a gone source, and no row put a badid:ororg:beside any of them.Three tests, each run for
idand fororg, so six rows. Each ischeckand thenexecute --yeson one plan, in the shape oftest_the_org_or_the_id_is_named_before_an_unwritable_work_dir:id:ororg:addedtest_the_org_or_the_id_is_named_before_a_work_dir_that_is_a_file--work-dirthat is a file: both commands exit 2 onREFUSED adopt-work-dir-unwritabletest_the_org_or_the_id_is_named_before_a_shared_work_dir(WINDOWS_SKIP)--work-direvery user can write in, no sticky bit:adopt-work-dir-sharedtest_the_org_or_the_id_is_named_before_a_source_that_is_gonesource.local_paththat names nothing:plan-source-goneThe shared row is in because RV1125b's NIT-A names "a
--work-dirthat is a file or a shared one", and #1179 asked for it unless the lane ruled otherwise.Mutants
Each mutant was made from #1179's text in the writer's own clone, run against the 85 old rows (the two order files of #1125,
tests/test_adopt_plan_value_order.pyandtests/test_adopt_check_plan_name.py) and against the six new ones, andadopt-project.pywas restored after each with its sha256 checked (412edbda, the same after each one).checkasksplan.names()and_checked_org_and_idafter_work_rootidand fororgcheckasks them after the source is openedexecuteasks them after_work_rootcheckasksplan.names()at its head and_checked_org_and_idafter_work_rootThe
plan-source-gonerows fail only on L2, as #1179's table says. On the head the six pass alone (6 passed, 40 deselected in 8.49s), the two order files together give 91 passed, andtests/test_adopt_plan_value_order.pyalone is 46 rows, the 40 it had and the six.Gates
One pytest run over 39 files each time: every file that greps for the codes and functions #1125 touches, the files this test file imports from,
tests/test_repo_hygiene.py,tests/test_cli_reference.pyandtests/test_agents_md_codes.py. The environment is the landing gate's own: a stubghfirst on PATH,GH_TOKEN=bogus, an emptyGH_CONFIG_DIRand an empty gitconfig,GIT_CONFIG_NOSYSTEM=1andEMAILset, and a wait for at least 17G free before each run.f61be9f591c1e6653cof961640c68(origin/mainwhen it was gated) and the head, not pushedtests/test_adopt_plan.py:567, which needsSHAPE_MEDXEHR_CLONE, a read-only clone of MedxSoft/MedxEHR.tests/test_adopt_root_symlinks.py, at lines 1926, 1981 and 2532. They need git 2.45 or later, and the bench has git 2.43.0.origin/mainhas moved since: it is now50ce8ab15, and #1119 (b7edd8816) changedadopt-project.pyincheck. Since961640c68main has changedadopt-project.pyandtests/test_adopt_pins.py, two of the five files #1125 changes, and it has not changed this PR's file. The 39-file gate was not run again on it. The two order files, the 91 rows, were run on a scratch merge of50ce8ab15and the head (b0e2e0461, not pushed): 91 passed in 172.19s, exit 0.Merge-trees (all clean, exit 0)
origin/main(50ce8ab15) and this headbede214aa0d551c1c0c2ce81ff4ce1452983d45c9549006feand this head8c604453d4766e3eed40e34874f4a6acaaf0039dd38e4e36dand this heada1504e06d18f07f1f3c02d081ee6067159459180origin/mainand #1125's head (context)ad61940f1a55897592a519dee59b5f31f53c7a9a88530bb7b3d29bfb11c5bb8e1f28e0ab194261aeOf the 45 open PRs, only #1125 and #1198 touch
tests/test_adopt_plan_value_order.py.See #1020, #1113 and #1125.
🤖 Generated with Claude Code
Lane: openreposhape-4 (openRepoShape-4)
Summary by Sourcery
Strengthen adoption plan validation tests to pin the precedence of value refusals across additional work-directory and missing-source errors.
Enhancements:
idandorgvalues are reported before additional work-directory and source refusals in bothcheckandexecute.Tests:
idandorgvalues.