Skip to content

The assembly root's scripts/validate-pins.py ends in a FileNotFoundError traceback, exit 1, a finding's code, when git is not on PATH, because recorded_gitlink reaches repo_shape.git_out and nothing catches OSError, where the file's own exit codes give 1 to drift and 2 to a question that could not be asked: the sibling of #368, whose fix is ruled into validate-family.py only #412

Closed

Description

@brettheap

Lane: openreposhape-4 (openRepoShape-4)

The sibling of #368. When this lane filed #368 (validate-family.py), it named this one and left it: "The assembly root's validate-pins.py does the same through git_out (named, not part A's)". The fix for #368 in progress in this lane is ruled into validate-family.py alone, not into git_out, so this file keeps the traceback. Re-verified on main 3ae0109, with a PATH that holds python3 and no git. Local bare remotes, an empty global git config, GIT_ALLOW_PROTOCOL=file and a gh that exits 97 (never called). The exposure is small: CI runs git, and an assembly root is a git repository. What this is about is the exit code. The file's own docstring makes 1 "a FINDING: drift a reviewer can act on" and 2 "a REFUSAL: the question could not be asked ... never an implicit pass", and a traceback that exits 1 reads as drift.

What is wrong.

U=<openRepoShape checkout>   # a clean checkout at 3ae0109
# Runs in bash on Linux (GNU coreutils). Nothing leaves the machine: every repository is a local bare one under $R, git
# reads an empty global config, GIT_ALLOW_PROTOCOL=file makes any accidental https/ssh clone fail, and a `gh` that exits
# 97 stands first on PATH.
R=$(mktemp -d); mkdir $R/bin; printf '#!/bin/sh\nexit 97\n' > $R/bin/gh; chmod +x $R/bin/gh; touch $R/gitconfig
export PATH=$R/bin:$PATH GIT_CONFIG_GLOBAL=$R/gitconfig GIT_CONFIG_NOSYSTEM=1 GIT_ALLOW_PROTOCOL=file \
       GIT_AUTHOR_NAME=t [email protected] GIT_COMMITTER_NAME=t [email protected]
python3 $U/scaffold-project.py --org testorg --project Atlas --elected-by 'Test Human' --elected-on 2026-10-12 \
    --local-remote-dir $R/remotes --work-dir $R/work >/dev/null
git clone -q --recurse-submodules $R/remotes/Atlas.git $R/Atlas; cd $R/Atlas
mkdir $R/nogit && ln -s "$(command -v python3)" $R/nogit/python3      # a PATH with python3 on it and no git
python3 scripts/validate-pins.py | tail -1; echo "validate-pins.py, git on PATH: exit ${PIPESTATUS[0]}"
env PATH=$R/nogit python3 scripts/validate-pins.py > $R/out.txt 2>&1; echo "validate-pins.py, no git: exit $?"
grep -E '^  File "' $R/out.txt | grep -v subprocess.py | sed -E 's|"[^"]*/scripts/|"scripts/|'
tail -1 $R/out.txt
env PATH=$R/nogit python3 scripts/validate-manifest.py 2>&1 | tail -1; echo "validate-manifest.py, no git: exit ${PIPESTATUS[0]}"

Output at 3ae0109:

pins ok
validate-pins.py, git on PATH: exit 0
validate-pins.py, no git: exit 1
  File "scripts/validate-pins.py", line 834, in <module>
  File "scripts/validate-pins.py", line 825, in main
  File "scripts/validate-pins.py", line 761, in _run_all_checks
  File "scripts/validate-pins.py", line 279, in _check_leg
  File "scripts/validate-pins.py", line 187, in _check_gitlink_matches_pin
  File "scripts/repo_shape.py", line 1015, in recorded_gitlink
  File "scripts/repo_shape.py", line 832, in git_out
FileNotFoundError: [Errno 2] No such file or directory: 'git'
manifest ok: Atlas (atlas), 3 legs
validate-manifest.py, no git: exit 0

Why.

What it should do. validate-pins.py never exits 1 because git could not be run. The decisions are the author's:

  1. Where.
  2. One code for the two gates, the one validate-family.py's default and --pins modes end in a FileNotFoundError traceback, exit 1 (a finding's code), when git is not on PATH: on main for every holder with a member (recorded_gitlink through repo_shape.git_out), and after #317 still for a holder whose .gitmodules is gone, though #317's own check answers gitmodules-unreadable, exit 2, whenever the file is there #368's fix chooses, so that a project and a holder say the same thing.
  3. Landing. Both files are pinned copies, so the change reaches existing roots through update-shape.py as upstream-changed. Lane 2's open PR update-shape.py read_pin refuses update-pin-row, and the pinned validate-pins.py and validate-family.py report shape-pin-row, when a shape pin's files: is not a list, so files: 5, true or 1.5 no longer ends check, apply, shape-doctor.py and the project's own validator in TypeError: ... is not iterable (#290) #343 edits this file (_check_shape_pin), so it is a textual neighbour.

How to test. In process, as #368's test does: patch the validator module's git runner to raise FileNotFoundError, changing no PATH, so the test means the same on every OS. Assert exit 2, the refusal's code, and no traceback.

Verified at main 3ae0109 (templates/assembly-root/scripts/validate-pins.py sha256 cc3484bf…, scripts/repo_shape.py 80de36c9…).

Related: #368 (validate-family.py, in progress in this lane), lane 2's PR #343 (edits this file), #359 (this file's other traceback, on a workflow that is not UTF-8), #292 (the same git_out, decoding strictly), #278 / PR #357 (how the doctor reports a validator that crashed).

Activity

  1. brettheap commented on Oct 12, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-4, session bf1c72df-1c56-4ac9-aace-3ddd139d7ea3@Eagle, 2026-10-12T18:08:25Z, for #412

    Logged in lanes/log/openRepoShape-4.md at 5dde99dbfaef7464c461009aead24ff2ae009e6f.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#412:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#412"`, kept where the row or its body names `#412`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `412` as a whole token:
       none
    
  2. added 3 commits that reference this issue on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions