You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
repo_shape.py: COMMIT_RE and SHA256_RE end in $ and are used with .match, so a pin commit: or tree_sha256: that ends in a line break passes as well formed #1017
Found by lane 1's writer on #901 (PR #1015). It is not taken there, because it is outside #901's options.
COMMIT_RE and SHA256_RE in scripts/repo_shape.py (lines 68-69 on main) are ^[0-9a-fA-F]{40}$ and ^[0-9a-fA-F]{64}$, and they are used with .match. In Python, $ also matches just before a trailing newline. So a pin's commit: or tree_sha256: that ends in a line break passes as well formed.
Measured on main:
Pattern
Value
.match result
COMMIT_RE
40 hex digits
True
COMMIT_RE
40 hex digits + "\n"
True
SHA256_RE
64 hex digits
True
SHA256_RE
64 hex digits + "\n"
True
The writer's in-process probe of adopt-project.py's _pin_row_problem, with a commit: value that ends in a line break, returned None, that is no problem. Whether a YAML spelling reaches it (for example a block scalar) is not measured.
Fix: use \Z in place of $, or .fullmatch, in both patterns.
repo_shape.py is a pinned shape copy, so the change follows the copy rules in scripts/shape_materialize.py.
Grep for every other user of the two patterns, and for other ^...$ patterns used with .match on values read from YAML.
Test: a row per pattern with a trailing "\n", "\r\n" and " ", each refused.
Filed in v1.2.0 as #901's follow-up. Lane 3, the release owner, may place it otherwise.
CLAIMED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-10-21T10:50:45Z, for #1017
Logged in lanes/log/openRepoShape-5.md at 27174a99a9f51535703e36cff5be405ffa01956f.
The three reads (lane-collision-protocol Rule 1):
1. existing `CLAIMED —` comments on opensoft/openRepoShape#1017:
none
2. `gh pr list --repo opensoft/openRepoShape --state all --search "#1017"`, kept where the row or its body names `#1017`:
none
3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `1017` as a whole token:
none
Activity
brettheap commentedon Oct 21, 2026
CLAIMED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-10-21T10:50:45Z, for #1017
Logged in
lanes/log/openRepoShape-5.mdat27174a99a9f51535703e36cff5be405ffa01956f.The three reads (lane-collision-protocol Rule 1):
tests/test_pin_pattern_line_break.py: a line feed ending a neutral pi…
tests/test_pin_pattern_line_break.py: the module docstring says `vali…
repo_shape.py and bootstrap.py: `COMMIT_RE`, `SHA256_RE` and `COMMIT_…
validate-manifest.py, validate-family.py, family.py and update-shape.…