Skip to content

docs(merge-queue): document Trunk merge queue and enforcement setup#3202

Closed
gantoine wants to merge 2 commits into
mainfrom
posthog-code/merge-queue-docs
Closed

docs(merge-queue): document Trunk merge queue and enforcement setup#3202
gantoine wants to merge 2 commits into
mainfrom
posthog-code/merge-queue-docs

Conversation

@gantoine

@gantoine gantoine commented Jul 6, 2026

Copy link
Copy Markdown
Member

What

Documents the Trunk merge queue and the GitHub settings that make it the only path into main.

  • New docs/merge-queue.md:
    • Contributor how-to — merge by commenting /trunk merge (never the GitHub merge button or gh pr merge), read the Trunk Merge Queue (main) check run, handle a kicked PR, enqueue from the CLI.
    • Admin checklist (one-time) — the two-ruleset enforcement setup on main (Restrict updates with the trunk-io app on bypass in Exempt mode; a separate required-checks ruleset with no Trunk bypass), the trunk-temp/**/* + trunk-merge/**/* branch exclusions, draft-PR mode, and a smoke test.
  • Pointer added to CONTRIBUTING.md and the AGENTS.md reference list.

Why

The org adopted the Trunk merge queue and wants queue-only merges. Nothing in the repo documented the enforcement settings or the day-to-day flow.

Notes

  • Draft-PR mode (Trunk's default) means no .github/workflows/ changes — existing pull_request workflows run on Trunk's draft PRs unchanged.
  • Docs-only change.

Created with PostHog Code

Add docs/merge-queue.md covering how contributors merge through the Trunk
queue (`/trunk merge`), how to inspect the `Trunk Merge Queue (main)` check
run, and the one-time GitHub ruleset + Trunk dashboard admin checklist that
makes the queue the only path into `main`. Link it from CONTRIBUTING.md and
the AGENTS.md reference list.

Generated-By: PostHog Code
Task-Id: 2d321370-0c0e-4d63-89d7-e367ebd9ecee
@trunk-io

trunk-io Bot commented Jul 6, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "docs(merge-queue): document Trunk merge ..." | Re-trigger Greptile

Comment thread docs/merge-queue.md

Agents working in PostHog Code follow the [`merging-prs` skill](../.claude/skills/merging-prs/SKILL.md), which enqueues a PR and babysits it until it merges or fails.

---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Broken link to non-existent skill file

The referenced file ../.claude/skills/merging-prs/SKILL.md (resolved: .claude/skills/merging-prs/SKILL.md) does not exist anywhere in the repository. Any agent that encounters this doc and tries to follow the link — exactly the scenario this sentence describes — will hit a dead path and may fall back to an undefined behavior. Either create the skill file as part of this PR, or remove/update the reference until it exists.

Comment thread docs/merge-queue.md Outdated
Check the queue status without leaving the terminal:

```bash
gh api repos/PostHog/code/commits/$(gh pr view <number> --json headRefOid -q .headRefOid)/check-runs \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The gh api call hardcodes PostHog/code, so it breaks for any fork or if the repo is renamed. Using gh repo view to resolve the current repo name makes the snippet self-contained and portable.

Suggested change
gh api repos/PostHog/code/commits/$(gh pr view <number> --json headRefOid -q .headRefOid)/check-runs \
gh api repos/$(gh repo view --json nameWithOwner -q .nameWithOwner)/commits/$(gh pr view <number> --json headRefOid -q .headRefOid)/check-runs \

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Use `gh repo view` to resolve the current repo instead of hardcoding
`PostHog/code`, so the check-run status snippet works on forks and
survives a repo rename.

Generated-By: PostHog Code
Task-Id: 2d321370-0c0e-4d63-89d7-e367ebd9ecee
@gantoine gantoine closed this Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant