feat(bin): mt-land, land a merge-train train PR as jmz with a pinned head #57

Merged
jmz merged 3 commits from maximus/mt-land into master 2026-11-23 21:11:35 +00:00 AGit
Member

mt-land <train-id> lands a merge-train train PR fast-forward as jmz, from Jörg's own machine. It replaces /root/merge-train-click.sh, /root/merge-nh.sh and /root/merge-hf.sh on spl-vm05, so the jmz token can leave that host. Design: nixos-hosts docs/superpowers/specs/2026-11-23-merge-queue-design.md §5.8; the service side (the marker) is nixos-hosts PR #1107.

  • It finds the one open PR whose last body line is <!-- merge-train train=<id> phase=awaiting_click tip=<sha> base=<branch> -->.
  • It refuses unless that PR was opened by maximus, its head branch is train/<id>/…, head == tip, base == the marked base, and the combined CI status of the tip is success.
  • It prints the PRs in the train (not the dropped ones), then merges with {"Do": "fast-forward-only", "head_commit_id": tip}.
  • The token comes from pass show forgejo/jmz-merge-token (override with MT_LAND_TOKEN_CMD) and is only ever sent in the Authorization header. There are no redirects, and control characters from PR text are stripped before printing.
  • The repo is guessed from the train id prefix (nixos-hosts, wanderer, homelab-flux), or given with --repo.

Tests: python3 -I -B -m unittest discover -s tools/mt-land -p 'test_*.py' → 10 tests OK (tools/** is chezmoi-ignored).

Setup, once: create a Forgejo token with repository write scope for jmz, then pass insert forgejo/jmz-merge-token.

Commits are unsigned (no gpg-agent on spl-vm05).

🤖 Generated with Claude Code

https://claude.ai/code/session_01XMf4ELSbWvtUkEeVky4wWr

`mt-land <train-id>` lands a merge-train train PR fast-forward as **jmz**, from Jörg's own machine. It replaces `/root/merge-train-click.sh`, `/root/merge-nh.sh` and `/root/merge-hf.sh` on spl-vm05, so the jmz token can leave that host. Design: nixos-hosts `docs/superpowers/specs/2026-11-23-merge-queue-design.md` §5.8; the service side (the marker) is nixos-hosts PR #1107. - It finds the one open PR whose **last body line** is `<!-- merge-train train=<id> phase=awaiting_click tip=<sha> base=<branch> -->`. - It refuses unless that PR was opened by `maximus`, its head branch is `train/<id>/…`, head == tip, base == the marked base, and the combined CI status of the tip is `success`. - It prints the PRs in the train (not the dropped ones), then merges with `{"Do": "fast-forward-only", "head_commit_id": tip}`. - The token comes from `pass show forgejo/jmz-merge-token` (override with `MT_LAND_TOKEN_CMD`) and is only ever sent in the Authorization header. There are no redirects, and control characters from PR text are stripped before printing. - The repo is guessed from the train id prefix (nixos-hosts, wanderer, homelab-flux), or given with `--repo`. Tests: `python3 -I -B -m unittest discover -s tools/mt-land -p 'test_*.py'` → 10 tests OK (`tools/**` is chezmoi-ignored). Setup, once: create a Forgejo token with repository write scope for jmz, then `pass insert forgejo/jmz-merge-token`. Commits are unsigned (no gpg-agent on spl-vm05). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XMf4ELSbWvtUkEeVky4wWr
maximus force-pushed maximus/mt-land from 912ea8a9fc
Some checks were skipped
ci / gate (pull_request) Has been skipped
to 75877239af
Some checks were skipped
ci / gate (pull_request) Has been skipped
2026-11-23 21:11:21 +00:00
Compare
jmz merged commit 75877239af into master 2026-11-23 21:11:35 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
public/dotfiles-public!57
No description provided.