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
brettheap wants to merge 1 commit into
Conversation
…`--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 <noreply@anthropic.com>
Reviewer's GuideAdds six parameterized tests that pin File-Level Changes
Possibly linked issues
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)



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 value-order regression coverage for invalid IDs and organizations across validation and execution.
Enhancements:
Tests: