Repository navigation
tests/test_update_shape_landing.py: the gh its landing tests drive update-shape.py with is a Python stub the update's child starts through a sitecustomize hook rather than a #!/bin/sh file on PATH, so the eight tests that carried WINDOWS_SKIP run on Windows too and the --pr landing and re-run paths (#204) are run by all three CI jobs, not two (#334) - #336
Conversation
…`update-shape.py` with is a Python stub the update's child starts through a `sitecustomize` hook rather than a `#!/bin/sh` file on PATH, so the eight tests that carried `WINDOWS_SKIP` run on Windows too and the `--pr` landing and re-run paths (#204) are run by all three CI jobs, not two (#334) #227 drove `update-shape.py apply --branch --push --pr` against a `gh` that was a shell script on PATH, so every test that reached it was skipped on Windows: `CreateProcess` reads no shebang. No file the suite can write is a `gh` there either: for a program name with no extension it appends `.exe`, so a `gh.cmd` beside a script is not what `gh` names, and the runner's real `gh.exe` further down PATH would be the one that ran. So the stub is no longer found by searching PATH. - The stub is a Python program (`GH_STUB`): it logs its argv to `GH_LOG`, one line per call and each argument ended by a unit separator, as bytes, so the log is the same on every OS; `pr list` answers from `GH_STATE/list`; `pr create` exits 97 with the same `HTTP 422` line while `GH_STATE/create-fails` exists, else prints the URL and records the pull request; anything else exits 64. - Python imports `sitecustomize` at start-up from `PYTHONPATH`, so the update's child interpreter is started with a `sitecustomize.py` (`GH_ON_PATH`) first on it. It does what PATH resolution would have done: a `subprocess.Popen` whose program is named `gh` is started as `python <the stub> <the same arguments>`. The stub is a real process, its exit code and streams cross real pipes and the arguments cross the OS's own command-line quoting; `shape_materialize.run` still builds the `CommandFailed` from that process, and the refusal and the NEXT line still name `gh`, not python. `git` is untouched, and with no `GH_STUB` in the environment the module does nothing. - The `gh` fixture's interface is unchanged (`env`, `calls`, `failing`, `answer`, `forget`); `env` carries `PYTHONPATH`, `GH_STUB`, `GH_LOG` and `GH_STATE` in place of a `PATH` entry. - The eight `@WINDOWS_SKIP` marks come off, nine test items: each was skipped for the stub, as the file's own docstring said, and the rest of what they do (`git`, a refusing commit hook, NEXT-line quoting) is also done by tests of this file that were never skipped on Windows. The `WINDOWS_SKIP` and `stat` imports go with them. - The two in-process tests keep their bodies. Their docstrings no longer call themselves the Windows job's coverage: the first is the same two runs with no process for `gh`, the second is the only coverage of a missing `gh` on a runner that has `gh` beside `git` (the subprocess test skips there). Unchanged: no `assert` line and no test name moves (`git diff -U0 | grep -E '^[-+]\s*(assert|def test_)'` is empty), so no assertion is weakened; the scripts are untouched. What this does not exercise: the operating system finding a `gh` by searching PATH. The old stub did on POSIX only, and a missing `gh` stays covered by `test_a_gh_missing_from_path_is_the_step_that_failed_on_both_runs` and the in-process test. Left out: six other files skip on Windows for the same `#!` `gh` stub (`test_free_plan_hint.py` four times, `test_neutral_pin_validator.py`, `test_scaffold_pin_and_reuse.py`, `test_scaffold_pin_collisions.py`, `test_scaffold_leg_paths.py`, `test_scaffold_leg_path_collisions.py`); `GH_STUB` and `GH_ON_PATH` could move to `tests/conftest.py` for them. Lane: openreposhape-3 (openRepoShape-3) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
(lane openRepoShape-3, 2026-10-12T11:28Z) @codex review |
|
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 11 hours and 14 minutes by commenting |
Reviewer's GuideThe PR makes the landing-test File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…, #253 via #264, #302 via #318, #288 via #309, #279 via #310, #306 via #311, #334 via #336, #239 via #269, #243 via #268, #321 via #335) into fix/adopt-record-submodule-placement Brings in the twelve commits from c7c02fa to a1b3a4b on top of 71b58a1, merged by sha. No rebase. Among the files this branch changes: 346079d (#216) and e43fa95 (#243) change adopt-project.py; 34ecbc2 (#260) changes scripts/shape_materialize.py; 87373a6 (#306) changes shape-doctor.py and tests/test_shape_doctor.py; 7491530 (#288) changes AGENTS.md and tests/test_repo_hygiene.py. Two conflicts, each resolved keeping both sides: - adopt-project.py, the module docstring's `execute` paragraph. #243 ends "the root's only submodules are the two leg mounts, each at the commit pushed to its leg."; this branch follows "two leg mounts." with "The split's `project.yaml` records the leg each source submodule kept in a leg was answered into, under `submodules:`, for `shape-doctor.py` to check it against." The merge has #243's sentence, then this branch's, re-wrapped to the paragraph's width. The module docstring is not in `--help` (docs/cli.md holds neither sentence). - tests/test_repo_hygiene.py, `test_agents_md_is_short_enough_to_be_read`. Each side moved the AGENTS.md cap from 464 and wrote a paragraph saying why: #288 to 477, for thirteen lines, and this branch to 472, for eight. AGENTS.md itself merged cleanly and holds both: 485 lines, main's 477 plus this branch's +9 -1. The merge keeps #288's paragraph word for word, then this branch's, renumbered "2026-10-12: 477 -> 485" because it now follows #288's, and asserts `<= 485`. `git merge-tree --write-tree` of the two parents gives the same tree in every file but these two. Checked: - adopt-project.py: `_commit_the_split` was changed by both sides, in hunks that do not touch. #243 clones the assembly with `--template=`; this branch builds `append` with the `submodules:` record. The merged function holds both, and each side's text is unchanged. Every other definition one side changed is that side's text. - shape-doctor.py: #306 changes `validator_row` and `run_validator`. This branch's placement functions, F1's `gitmodules_the_record_answers` among them, are this branch's text. - No top-level name is bound twice in adopt-project.py, scaffold-project.py, scripts/repo_shape.py, scripts/shape_materialize.py, shape-doctor.py, validate-manifest.py, update-shape.py, scripts/family.py or scripts/bump-leg.py. Each merged module's names are the base's plus what either side added. - AGENTS.md is main's plus exactly this branch's changed lines. - The branch's diff against main is #189 alone: 12 files, +1694 -157. That is +1670 at 27d039b, plus F1's fix and test (+23), plus the one line the docstring re-wrap adds. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… of main's commits merge with no conflict, among them #243's template-less clone of the assembly and #216's literal `git grep` in adopt-project.py, and #260's one-pass `render` in shape_materialize.py origin/main moved 71b58a1 -> 8cdca5e. It was merged by sha, as the coordinator asked for e43fa95 or later: - c7c02fa (#299 via #315), scripts/family.py; - 346079d (#216 via #228), adopt-project.py: `plan`'s follow-up `git grep`; - 34ecbc2 (#260 via #316), scripts/shape_materialize.py: `render` substitutes in one pass; - 86da808 (#253 via #264), scripts/bump-leg.py; - 6f4ce47 (#302 via #318), scripts/family.py; - 7491530 (#288 via #309), AGENTS.md, README, docs and scaffold-project.py's --help; - 7591455 (#279 via #310), tests/conftest.py: `git()` takes its default identity as `-c` config; - 87373a6 (#306 via #311), shape-doctor.py; - 8a14ac9 (#334 via #336), tests/test_update_shape_landing.py; - c1b6732 (#239 via #269), update-shape.py; - e43fa95 (#243 via #268), adopt-project.py: the assembly root is cloned with `--template=`, and the verification refuses a mount whose gitlink is not the commit pushed to its leg (`adopt-mount-commit`); - a1b3a4b (#321 via #335), tests/test_git_output_decoding.py; - 8cdca5e (#295 via #312), the template's scripts/validate-pins.py. `git merge-tree` and this merge give the same tree, 07e6b49. adopt-project.py, scripts/shape_materialize.py and tests/test_adopt_ignored_shape_files.py auto-merge. In the last of these main's 346079d and this branch's 86a5e30 change different cases. Checked on the merged tree: - AST (fin183g/names.py, base 71b58a1): no top-level name is bound twice in adopt-project.py, scaffold-project.py, scripts/repo_shape.py or scripts/shape_materialize.py, and none is loaded but bound nowhere. Main changed the signature of no function this branch calls. - Every sentence 86a5e30 changed is still there: in `_through`, in `_link_parts`, in `_verify`'s `_resolve` (which e43fa95's `adopt-mount-commit` leaves as it was), and in the three test files. - `_commit_the_split` now clones the assembly with `--template=`. The next commit, F3, reads what that clone holds in its own `.git`, which is why F3 comes after this merge. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>



Lane: openreposhape-3 (openRepoShape-3)
Claim: #334 (comment)
What
tests/test_update_shape_landing.pyonly; no script changes.ghthe landing tests driveupdate-shape.pywith is now a Python program (GH_STUB) instead of a#!/bin/shfile on PATH. It logs its argv (bytes, one line per call, each argument ended by a unit separator, so the same log on every OS), answerspr listfrom the state directory, makespr createexit 97 with the sameHTTP 422line whilecreate-failsexists, and exits 64 on anything else: what the shell stub did.sitecustomize.py(GH_ON_PATH) is put first on the update's childPYTHONPATH. It does what PATH resolution did on POSIX: asubprocess.Popenwhose program is namedghis started aspython <the stub> <the same arguments>. The stub is a real process; its exit code and its two streams cross real pipes, and its arguments cross the OS's own command-line quoting.shape_materialize.runstill builds theCommandFailedfrom it, so the refusal and the NEXT line still namegh.gitis untouched; with noGH_STUBin the environment the module does nothing.@WINDOWS_SKIPmarks (nine test items;MERGED/CLOSEDis one function) come off, and theWINDOWS_SKIPandstatimports with them. Each was skipped for the stub, as the file's docstring said; none names a second reason, andgit, the refusing commit hook and the NEXT-line quoting they also exercise are done by tests in this file that were already running on Windows.ghfixture's interface is unchanged (env,calls,failing,answer,forget);envcarriesPYTHONPATH,GH_STUB,GH_LOG,GH_STATEin place of aPATHentry.Why not a
gh.cmd(the suggestion in the task).subprocess.run(["gh", ...])on Windows isCreateProcess, which appends.exeto a program name that has no extension (its documented rule);gh.cmdis not whatghnames. Worse, as I understand the hosted Windows images they ship a realgh.exefurther down PATH, so a.cmdbeside the old script would be bypassed and the real one would answer. I could not run Windows here, so that is from documentation and memory of the images, not measured; it is why the hook rewrites the program instead of relying on PATH. The issue's own direction (more in-process tests) was kept for the two that exist and not extended, because the flush-order test needs real streams in one pipe.Why
Measured on this host (Linux), with
-p no:cacheprovider,tests/test_update_shape_landing.py:WINDOWS_SKIP's condition forced true in a scratchconftest.py(what Windows CI decides)ghanywhere on PATH (scratch copy)gh.calls()is[], or the run exits 2 with "ghcould not be started")ghthat exits 99 and writes a marker FIRST on PATH, hook onThe last row is the property the Windows job needs: a real
ghon PATH is never reached. The 7 failing items are the ones whose assertions read whatghwas asked or answered;test_the_commit_and_the_push_print_above_the_refusal_in_one_logandtest_a_rerun_from_another_branch_is_still_nothing_to_dopass without a working stub because a missingghand a failing one both exit 2 and neither asserts a call; they are written that way.No
assertline and no test name moves:git diff -U0 | grep -E '^[-+]\s*(assert|def test_)'is empty.What the Windows job will exercise
The nine items now run in
tests-windows, each a realupdate-shape.pysubprocess doing realgitcommit and push into bare repositories, with the stub started aspython.exe <stub> <args>byCreateProcess. That runs: thesitecustomizehook loading fromPYTHONPATHin the child; the argument round trip through Windows command-line quoting (--titleand--bodycarry spaces, backticks and an apostrophe, and the tests compare the logged argv with the NEXT line); exit 97 and the stub's stderr reachinglanding_failed; stdout and stderr ordering over one real pipe; and the re-run paths ongh pr listanswers that are[],OPEN,MERGEDandCLOSED.What it does not run:
CreateProcessfinding aghby searching PATH. A missingghstays covered on Windows bytest_a_gh_missing_from_path_is_the_step_that_failed_on_both_runsand the in-process test, both already unskipped. If the Windows job fails on one of these nine, the CI log is the diagnosis and a fix goes on this branch.Tests
On head 6c93590 (rebased onto origin/main c7c02fa, one commit, one file):
tests/test_update_shape_landing.py tests/test_repo_hygiene.py tests/test_cli_reference.py tests/test_git_output_decoding.py tests/test_update_shape.py: 176 passed in 378.34s, no skips.tests/test_update_shape_landing.pyalone: 33 passed (19 test functions, 33 items) on the Linux host. Skipped by operating system: none.test_a_gh_missing_from_path_is_the_step_that_failed_on_both_runsstill skips by its own guard whereghlives besidegitor Python (a Linux runner), as before.tests3471 passed, 6 skipped;tests-macos3467 passed, 10 skipped;tests-windows3190 passed, 287 skipped. Two other recent pull-request runs on the same base show 296 and 297 skipped on Windows, against 287 here; those branches carry tests of their own, and the-qlog names no tests, so this is a count and not a list.Composes with
git merge-tree --write-tree <branch> HEADat 6c93590, wave A siblings (all CLEAN; none changestests/test_update_shape_landing.py, so nothing here can conflict with them beyond the one file this PR touches):fix/pin-rewrite-indentationfix/update-shape-next-quotingfix/guard-call-formsfix/adopt-plan-asks-unsafe-pathsfix/adopt-refuse-existing-split-branchfix/ruleset-hint-tracking-branchfix/doctor-contracts-manifestsfix/adopt-spelled-unambiguousfix/family-add-member-idThis head also merges CLEAN into the current
origin/main.Left out
#!ghstub (test_free_plan_hint.pyfour times,test_neutral_pin_validator.py,test_scaffold_pin_and_reuse.py,test_scaffold_pin_collisions.py,test_scaffold_leg_paths.py,test_scaffold_leg_path_collisions.py);GH_STUBandGH_ON_PATHcould move totests/conftest.pyfor them, andtest_free_plan_hint.pywould need aPopenpatch in the test process instead of thesitecustomize.ghfile on PATH, to keep the old "found by PATH search" check on two of three OSes, was not added.Closes #334
🤖 Generated with Claude Code