Skip to content

update-shape.py apply --branch prints gh pr create --base main whatever the root's tracking branch is, so a project scaffolded with --tracking-branch trunk is told to open its pull request against a branch its remote does not have, while --pr itself targets trunk #209

Closed

Description

@brettheap

Lane: openreposhape-4 (openRepoShape-4)

Found by this lane's probe of main e4decfb on 2026-10-11, re-verified on main e4decfb today. Not claimed.

What is wrong. next_line in update-shape.py hard-codes --base main in both NEXT lines it prints after a branch commit (--branch, and --branch --push), whatever the root's tracking_branch: says. open_pull_request, the code --pr runs, reads tracking_branch_of(load_yaml(root / kind.manifest)) and opens the pull request against the real tracking branch, so the tool's own pull request and the command it tells a human to paste disagree. On a project scaffolded with --tracking-branch trunk, the printed command targets a branch its remote does not have. The --push form also prints a literal --repo <org>/<Project> placeholder where open_pull_request reads the assembly leg's repository:.

# Atlas scaffolded with --tracking-branch trunk into local bare remotes, cloned --recurse-submodules to $C;
# one upstream commit in $U (a local clone of openRepoShape); `gh` on PATH is a shim that logs and exits 97
grep tracking_branch $C/project.yaml                                   # tracking_branch: trunk
git -C $REMOTES/Atlas.git for-each-ref --format='%(refname:short)' refs/heads   # trunk
python3 $U/update-shape.py apply --root $C --upstream $U --yes --branch shape/up
#   exit 0   NEXT  git -C <root> push -u origin shape/up && gh pr create --base main --head shape/up
# (back on trunk, clean)
python3 $U/update-shape.py apply --root $C --upstream $U --yes --branch shape/up2 --push
#   exit 0   NEXT  gh pr create --repo <org>/<Project> --base main --head shape/up2
python3 $U/update-shape.py apply --root $C --upstream $U --yes --branch shape/up3 --push --pr
#   exit 2 (the shim)   the gh call it made: gh pr create --repo testorg/Atlas --base trunk --head shape/up3 ...

What the docs promise. AGENTS.md, "Updating a project's shape", item 6: "Land it as a pull request; never suggest a push to the default branch." tracking_branch_of's docstring: "This root's tracking branch, out of an already-loaded manifest — the same field open_pull_request lands its pull request on." The NEXT line is the only route to that pull request when --pr is not passed.

What would fix it. next_line reads the base from tracking_branch_of(load_yaml(root / kind.manifest)) for both the --branch and the --branch --push forms, and the --repo the way open_pull_request does (the assembly leg's repository:, or a family's repository:/org:+name:), instead of <org>/<Project>. One helper shared by open_pull_request and next_line would keep them from drifting again.

Activity

  1. brettheap commented on Oct 11, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-3, session 566fec94-6fde-4579-947f-ec4fda5ce14f@Eagle, 2026-10-11T16:22:41Z, for #209

    Logged in lanes/log/openRepoShape-3.md at b61c2d2336d16bc8d09c1a1af410c69f8f483fd5.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#209:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#209"`, kept where the row or its body names `#209`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `209` as a whole token:
       none
    
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