Repository navigation
feat(agents): PRs get labels, milestone and reviewer; branches keep up with main - #482
Conversation
…p with main - scripts/pr-meta.mjs works out a PR's labels (commit types and changed paths), milestone (the closed issue's, else the story's tracker) and reviewer (the other collaborator); `--apply` adds them to the open PR. - AGENTS.md § Git: two standing instructions. Merge `origin/main` in at the start of work, before finalizer validates and before any push, fixing conflicts. Run pr-meta after a PR opens or a story closes. - finalizer, pipeline, pr-desc and release point at both.
baldurpan
left a comment
There was a problem hiding this comment.
Four comments, inline. The script itself does what the description says. At d8b1d29 the 71 tests pass, and a dry run on this PR gives the labels it already carries. I read --apply, and it only adds.
I'd want the first two settled before this merges. Both are about the instructions, not the script:
- The new standing instructions contradict the section they sit in, and
CLAUDE.md. - The finalizer's merge will usually be refused at the point it runs.
The other two are smaller. Some root tooling and docs/ get no label. A gh failure reads as "no open PR".
- AGENTS.md, CLAUDE.md and the inline pipeline name the two standing instructions as the only exceptions to the git rule. - finalizer merges `origin/main` as its first step, before it edits the READMEs or the tracker, so git does not refuse the merge. - Every root tooling file, all of `.github/` outside workflows and `.vscode/` get `gmt monorepo`; `docs/` and every LICENSE get `documentation`. A test checks that every tracked path gets a label, except a changeset entry. - pr-meta treats only gh's own not-found answers as no PR or no issue; any other gh failure stops with gh's message.
|
Checked the merge from |
…ate (#482) At the finalizer's first step the story's published figures are not synced yet (step 4), so `validate` fails on any story with new tests for a reason the merge did not cause. The finalizer now commits the resolved merge without it; step 9's `validate` checks the merged tree. The other merges (work starting on a branch, before a push) still run `validate` first.
baldurpan
left a comment
There was a problem hiding this comment.
Approving 319f801. All five threads are fixed, and I've checked each one:
- AGENTS.md, CLAUDE.md and
inline-mode.mdagree on the two standing exceptions. - The finalizer merges
mainat step 1 and runsvalidateonly at step 9. - Every tracked file gets a label, with a
git ls-filestest that keeps it that way. pr-meta.mjsreports gh's own error instead of "no open PR".
The merge from main (9d21295) doesn't change the patch, and the label test passes on the merged tree.
CI when I approved: 6 checks passed, and 31 were still running, Build & Lint and the TZ tests among them.
Agents now keep a branch up to date with
main, and every PR they open or close out gets its labels, milestone and reviewer.Labels, milestone and reviewer
node scripts/pr-meta.mjsshows what a PR should carry.--applysets it on the branch's open PR.feat→ enhancement,fix→ bug,refactor,docs) and the changed paths:packages/gmt→ gmt, itsskills/→ skills, and each lint plugin → its own label.github/workflows→ pipes.agents,.claude,AGENTS.md,CLAUDE.md→ ai skills.githuboutside workflows,.vscodeandapps/dox/scripts→ gmt monorepocontext,docs, the rest ofapps/dox, the READMEs and every LICENSE → documentationrelease/branch gets onlyrelease--applyonly adds. It never removes a label, never replaces a milestone someone set, and never asks again someone who was already asked or has already reviewed. Aghfailure other than gh's own "not found" answer stops the script with gh's message.The rules live in
scripts/lib/pr-meta-plan.mjs, tested inapps/dox/scripts/pr-meta/plan.test.tswith branches and paths from merged PRs.Keeping up with main
AGENTS.md § Git gains two standing instructions:
finalizer's first step (before it edits the READMEs or the tracker), and before any push: fetchorigin/main, merge it in (never rebase), resolve conflicts so both sides survive, validate, and commit the merge. At the finalizer's first step the merge is committed withoutvalidate, because the story's figures are synced only at its step 4; its step 9 validates the merged tree.pr-meta.mjs --applyright after a PR opens, and whenfinalizercloses a story whose PR is open.finalizer(steps 1 and 11),/pipeline,/pr-descand/releasepoint at these.Validation
vitest run scripts/pr-meta/plan.test.ts scripts/affected.test.ts: 87 passednode scripts/verdict.mjs validate: PASS, 23 of 23GH_TOKEN=bad node scripts/pr-meta.mjs 482printsHTTP 401: Bad credentialsand exits 2--checkand oxlint on the new and changed scripts: clean/optimize: 0 findings to fix