PostHog / PostHog/posthog

Self-driving: configurable branch naming for agent PRs

Open
#79,134 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
6h 51m
Merged PRs (30d)
232

Description

Filing via the API, so I can't apply the enhancement label myself — please tag per CONTRIBUTING.

Is your feature request related to a problem?

Please describe.

Self-driving branches look like posthog-self-driving/fix<scope>-<description>-<hash> (older ones posthog-code/<description>). Our repo convention is <owner>/<ticket-id>-<short-description>, and some tooling keys off it.

We can't fix it after the fact: renaming the branch closes the PR. So we had to write an explicit exemption into our agent guidance saying the branch-naming rule doesn't apply to posthog[bot] — a carve-out in a hard rule, which is exactly the kind of thing that erodes a convention over time.

Describe the solution you'd like

A branch-name template setting with a few variables — something like {prefix}, {ticket}, {slug}, {hash} — so the branch can match the repo's convention.

This is much more useful alongside issue creation (PostHog/posthog#79133), since the ticket ID is usually the piece a naming convention wants. {ticket} is only substitutable if PostHog has minted the ticket.

Describe alternatives you've considered

  • Renaming the branch after the PR opens. Not possible — it closes the PR.
  • Relaxing our convention for everyone. Rejected; the convention exists so branches map to tickets and owners.
  • The exemption we actually wrote. Works, but it's a documented hole in a rule we otherwise enforce.

Additional context

Low priority relative to PostHog/posthog#79131 and #79132 — this one is cosmetic, those two cost real time.

Debug info

  • PostHog Cloud (US)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the self-driving branch-name construction entry point and read the related issue, PostHog/posthog#79133, for ticket creation context. Trace how current prefixes, descriptions, and hashes are assembled. Done means a documented template setting supports the requested variables and handles ticket substitution only when PostHog has minted a ticket.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.