Skip to content

Docs-sync as a backstage automation (on PR merge) - #29

Merged
tella-butler merged 1 commit into
masterfrom
docs-sync-automation
Jul 1, 2026
Merged

Docs-sync as a backstage automation (on PR merge)#29
tella-butler merged 1 commit into
masterfrom
docs-sync-automation

Conversation

@tella-butler

Copy link
Copy Markdown
Contributor

Moves the last Mintlify-hosted workflow off Mintlify's infra and into backstage, per Michiel. Instead of a GitHub Action (the earlier direction in tella-fusion #4376), docs-sync now runs as a code-mode backstage automation triggered when a PR merges into tella-fusion.

How it works

  1. The GitHub PR webhook (already forwarded from the Slack agent) gains a new publish in its existing merge branch: on closed && merged it fires a github:pr_merged internal event with the PR number/title/branch/author.
  2. A seeded docs-sync automation (code mode, eventKey: github:pr_merged) subscribes to that event. Each merge spins up a worktree off main, and the agent runs the docs-update prompt: read the merged PR diff (gh pr diff), update the Mintlify docs under packages/core/webapp/docs/, and open a PR — or do nothing if there's no user-facing change.

This reuses the existing automation + worktree machinery (the same path cron/code automations use) and mirrors the seeded review automation, so it shows up in the Automations UI and can be toggled/edited there.

Changes

File Change
constants.ts PR_MERGED_EVENT_KEY + DOCS_SYNC_AUTOMATION_NAME
prompts.ts DOCS_SYNC_PROMPT — the docs-update spec (Johnny's prompt), adapted for a code-mode run that opens a PR
webhook.ts fire the merge event; skip PRs authored by the bot account so docs-sync can't loop on its own merged PRs
index.ts seed the docs-sync automation (enabled) on startup

Notes / decisions

  • Seeded enabled — this is the live replacement for the Mintlify workflow, so it's on by default. Flip it off in the Automations UI if you'd rather gate it.
  • Loop prevention: the automation opens PRs from the bot account on auto-docs-sync-* branches; the merge handler skips any PR whose author is the bot, so merging a docs-sync PR won't spawn another.
  • Model: claude-opus-4-8, matching the review automation.
  • Requires one backstage restart to seed the automation and pick up the webhook change (per backstage's usual deploy).
  • Companion change: tella-fusion #4376 is being reduced to just removing .mintlify/workflows/docs-sync.md (dropping the GitHub Action approach).

🤖 Generated with Claude Code

…merge

Moves the docs-sync workflow off Mintlify's infra into backstage. When a PR
merges into tella-fusion, the GitHub webhook now publishes a `github:pr_merged`
internal event; a seeded code-mode "docs-sync" automation subscribes to it,
spins up a worktree, reviews the merged PR's diff, updates the Mintlify docs in
packages/core/webapp/docs, and opens a PR.

- constants.ts: PR_MERGED_EVENT_KEY + DOCS_SYNC_AUTOMATION_NAME
- prompts.ts: DOCS_SYNC_PROMPT (the docs-update spec, code-mode)
- webhook.ts: fire the merge event, skipping bot-authored PRs so the docs-sync
  automation can never loop on its own merged PRs
- index.ts: seed the docs-sync automation (enabled) on startup

Reuses the existing automation + worktree machinery, mirroring the seeded
review automation. Toggle it in the Automations UI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tella-butler
tella-butler merged commit f392573 into master Jul 1, 2026
@tella-butler
tella-butler deleted the docs-sync-automation branch July 1, 2026 08:37
tella-butler pushed a commit that referenced this pull request Aug 12, 2026
A bare `#3` chipped as a PR reference in prose. The first fix required 4+
digits, which is right for tella-fusion (#5648) and wrong for every repo
numbered under a thousand — opensession is at #92, tella-mac at #14.

Measured over 120k transcript entries: 4+ digit `#numbers` are almost all
PRs, while 1-3 digit ones are mostly stream and step indices (`stream #0`),
CSS hex colours (`color: #333`), and rankings (`#29`). The legit short form
carries its own evidence — `PR #92` is how the small-numbered repos are
actually written.

So a short number now links when something other than its digits says PR: a
`PR`/`PRs` cue in front of it, a qualifier (`backstage#92`), or a PR the
session list already knows for that repo. The cue is matched by the
tokenizer (which cannot see behind its own match position) but re-emitted as
prose, so the chip stays labelled `#92` rather than repeating the word next
to the PR icon.
tella-butler pushed a commit that referenced this pull request Aug 12, 2026
The renderer can place `opensession#92` at any length, but a bare `#92` is a
guess it declines to make for short numbers — `#3`, `#333` and `#29` are far
more often a step, a hex colour or a ranking. Writing the repo id is the
cheap half of that contract, so ask for it in the run instructions instead of
leaning entirely on heuristics.

Goes in the existing "Session UI rendering" section, so every run gets it.
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