Repository navigation
Description
Goal: make siblings and family.py siblings write the token in SHAPE_LEGS_TOKEN or SHAPE_LEGS_APP_TOKEN to no trace a caller asked git for, as #996 (#1045) makes make bootstrap write it to none.
State
templates/family-root/scripts/siblings.pybuilds the credential's-cas the family root'sbootstrap.pybuilds it (git_prefix,:582-595on main1a47ed07):-c url.https://x-access-token:<token>@github.com/.insteadOf=https://github.com/, and the same for[email protected]:.- It hands them, in argv, to two gits, with no
env=, so each runs in the caller's own environment:git clone -q --no-local --recurse-submodules ...for a member with no clone beside the holder (place,:964-970);git fetch --quiet originfor a member whose clone is there (:997-999).
- Its docstring says the token is "never written into
.git/config, never persisted, never printed" (:586-587).scrubkeeps it out of the output, and that part holds. - Both entry points pass the caller's environment through: the holder's
make siblings(templates/family-root/Makefile:77-79) andfamily.py siblings --family-root <holder>(cmd_siblings, which runs the holder's own copy withinherited_child_environment(), the caller's environment plusPYTHONIOENCODING). - the family root's bootstrap.py: git's update ended by a signal fails the run by name, and B4 with a token in use is told from fetches redone without a trace, so the token reaches no file (#998, #996) #1045 (open; closes the family root's bootstrap.py: with SHAPE_LEGS_TOKEN or SHAPE_LEGS_APP_TOKEN set, a member's commit no branch of its remote holds (B4) still ends
family bootstrap ok, with the advice to set the token that is already set #996) runs every gitbootstrap.pygives the token inuntraced()'s environment. It leavessiblings.pyas it is: the file's sha256 is7fe10a7a...on main and at the family root's bootstrap.py: git's update ended by a signal fails the run by name, and B4 with a token in use is told from fetches redone without a trace, so the token reaches no file (#998, #996) #1045's headb2bbb31calike. With the family root's bootstrap.py: git's update ended by a signal fails the run by name, and B4 with a token in use is told from fetches redone without a trace, so the token reaches no file (#998, #996) #1045 landed,siblings.pyis the one Python file left intemplates/andscripts/that gives a git the token in the caller's own environment (the twovalidate.ymlworkflows give it in a CI step's shell).
What happens (measured)
Lane 5's probe on main 1a47ed07, with git 2.43.0 and git 2.47.1:
- The family of
tests/test_family.py(two members, local bare remotes, the file transport allowed as the suite allows it), laid out as<tmp>/InkRouter/InkRouter, withSHAPE_LEGS_TOKEN=ghp_FAKEFAKEFAKE0123456789. Offline:GIT_SSH_COMMAND=falseand a stubgh. make siblingsrun twice, so the first run clones both members and the second fetches both; andfamily.py siblingsrun once, cloning.- Each run asked for traces one of three ways: the six variables
GIT_TRACE,GIT_TRACE2,GIT_TRACE2_EVENT,GIT_TRACE2_PERF,GIT_TRACE_PACKETandGIT_TRACE_CURLset to files;trace2.eventTargetin a scratchGIT_CONFIG_GLOBAL; or the same in a scratchGIT_CONFIG_SYSTEM.
What it showed:
-
Every run ended
siblings ok: 2 member(s) beside the holder in ..., exit 0, and the token was in neither stdout nor stderr. -
Every trace2 target held the token, on both gits, for the clone and the fetch, and through
family.py siblingstoo: two lines in each file, one for each member, thestartevent of the git given the-c. The first line below is 2.43.0's clone and the second 2.47.1's fetch, fromtrace2-normal.txt; 2.47.1 writes the argument unredacted too:10:43:21.481565 common-main.c:56 start git -c url.https://x-access-token:[email protected]/.insteadOf=https://github.com/ -c url.https://x-access-token:[email protected]/[email protected]: clone ... 10:44:09.564912 common-main.c:58 start git -c url.https://x-access-token:[email protected]/.insteadOf=https://github.com/ -c url.https://x-access-token:[email protected]/[email protected]: fetch ...how the trace was asked for files that held the token, lines in each (both gits; clone, then fetch) the six variables, make siblingstrace2-event.json,trace2-normal.txt,trace2-perf.txt: 2 and 2the six variables, family.py siblingsthe same three: 2 (clone) trace2.eventTargetin the global configcfg-event.json: 2 and 2trace2.eventTargetin the system configsys-event.json: 2 and 2 -
GIT_TRACE's andGIT_TRACE_PACKET's files were written and held no token;GIT_TRACE_CURLwrote nothing, with no http remote. -
The control with no token (
make siblings, each of the three ways): the same files written, and nox-access-tokenin any. -
The holder's own copy of
siblings.pychanged only so that the clone and the fetch run in the environment the family root's bootstrap.py: git's update ended by a signal fails the run by name, and B4 with a token in use is told from fetches redone without a trace, so the token reaches no file (#998, #996) #1045'suntraced()builds: all twelve runs (three ways, clone and fetch, two gits) endedsiblings ok, exit 0, the trace files were still written by the run's other gits, and none held the token.
Not measured: an https remote, since the rewrite reaches only github.com and these probes are offline. #996 measured git 2.43 also writing the rewritten url it gives a remote helper, so a real github.com member would put the token in more lines.
Direction
Run the two gits that siblings.py gives the -c (the clone at :964 and the fetch at :997) in the environment #1045's untraced() builds: every variable whose name begins GIT_TRACE taken out, and GIT_TRACE2, GIT_TRACE2_EVENT and GIT_TRACE2_PERF set to 0, which turns off a target the global or the system config names too. Only where a token is in use; with none, the two gits keep the caller's environment, as now.
- Where the helper comes from is the writer's call.
siblings.pyimportscredentialandREWRITE_TARGETSfrombootstrap, but keeps its own copy ofbootstrap.py'sMAKEFLAGSreadings (:1018-1027): a holder may keep abootstrap.pyolder than itssiblings.py(update-shape.py apply --accept-local), and an import of a name that copy lacks would stopmake siblings,parkandresumewith anImportError.untracedexists only from the family root's bootstrap.py: git's update ended by a signal fails the run by name, and B4 with a token in use is told from fetches redone without a trace, so the token reaches no file (#998, #996) #1045 on, so the same holds for it. A copy kept here would need a test that holds the two to one answer, astests/test_family_member_make_jobserver.pyholdsmember_make_env. - The member's own
scripts/bootstrap.pythatplaceruns after a clone (run_member_bootstrap) is given no token in its argv, so it keeps the caller's environment and the traces the caller asked for.
Verify
make siblings(clone),make siblingsagain (fetch) andfamily.py siblings, each with a fakeSHAPE_LEGS_TOKENand, in turn, the trace variables set to files,trace2.eventTargetin the global config, and the same in the system config: exit 0,siblings ok, the trace files written, and the token in no file under the run's TMPDIR and in no output.- The same with
SHAPE_LEGS_APP_TOKEN. - With no token, the clone and the fetch are still traced where the caller asked.
- Each such row with a token fails on main's
siblings.py: the token is intrace2-event.json,trace2-normal.txtandtrace2-perf.txt, as measured above.
Found by lane 5's independent review of #1045 (#998, #996), rv996 (#1045 issuecomment-6288783192), and measured by lane 5.
Milestone: v1.2.0 (placement is lane 3's call).
Not claimed.
Lane: openreposhape-5 (openRepoShape-5)
Activity
brettheap commentedon Oct 20, 2026
CLAIMED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-10-20T12:53:38Z, for #1055
Logged in
lanes/log/openRepoShape-5.mdat83f0634d873a53125c4128ed89196f86a0c92957.The three reads (lane-collision-protocol Rule 1):
the family root's siblings.py and its test: a row with a member whose…
the https row of the family root's siblings.py test: its git gets a g…