diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ee5f8ca --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.env +.claude/ diff --git a/plugins/newtab/skills/trainhop/SKILL.md b/plugins/newtab/skills/trainhop/SKILL.md new file mode 100644 index 0000000..f03f5e7 --- /dev/null +++ b/plugins/newtab/skills/trainhop/SKILL.md @@ -0,0 +1,117 @@ +--- +name: trainhop +description: Runs the New Tab train-hop release workflow for all automated steps: metabug, locales, metrics, Nimbus recipe, Confluence page, and QA ticket. Use when asked to start a train-hop. Do NOT use for individual steps like updating locales alone — those have their own skills. +argument-hint: "[bug-number] (optional)" +disable-model-invocation: true +--- + +# Train-hop: Full Workflow + +## Before Starting + +**Step 1 — Pick the phase.** Ask (numbered list): + +> Which steps would you like to run? +> +> **1. Full workflow** — all steps, start to finish +> **2. Prep only** — steps 1–3 (metabug, locales, metrics), run before the XPI is cut +> **3. Post-XPI** — steps 4–5 (Nimbus recipe, Confluence page + QA ticket) +> **4. Custom** — specify which step numbers to include + +**Step 2 — Resolve, ask, confirm.** Resolve what you can automatically, ask the user only for the rest, then present the plan and wait for a single confirmation. + +*Resolve automatically:* +- **`TARGET_VERSION`** — read the Nightly major from `browser/config/version.txt`; the release target is `Nightly − 2` (e.g. `154` → `152`). This labels the meta bug, per-step bugs, QA ticket, and Confluence title — **not** the Nightly version. Use it everywhere; don't re-derive it per step. +- **Conductor** — defaults to the signed-in user (`${MCP}atlassianUserInfo`). +- **QA contact** — defaults to Valentin Bandac (`6310ac8255b0a9e29f1af16d`). +- **accountIds** — resolve names → accountIds with `${MCP}lookupJiraAccountId`. + +*Ask the user (only what the chosen phase needs):* +- **Target version** — confirm the computed `Nightly − 2` default, or take an override. +- If step 4 is included — **Ship task URL** (from ShipIt). +- If step 5 is included: + - **Dates**: XPI cut, QA handoff, QA sign-off (= the Jira due date), and the staged **Release** dates — 50% and 100% (usually consecutive days). + - **Rel Man** — name only (check https://whattrainisitnow.com/release/?version=release if unknown). + - **Conductor & QA contact** — default to you (the signed-in user) and Valentin Bandac; confirm, or name someone else. + +Then show the resolved target version and the exact steps to run, and wait for one confirmation before proceeding. + +## Pre-conditions + +Run these checks at the start — don't ask the user to verify them. If something is off, explain it in plain language and wait. + +1. **In the Firefox checkout.** Confirm `browser/config/version.txt` exists in the working directory. If not, the workflow is running from the wrong place — ask the user to start it from their local Firefox source checkout (every step operates there). +2. **Clean tree on `main`.** Run `git status --porcelain` and `git rev-parse --abbrev-ref HEAD`. If there are uncommitted changes or the branch isn't `main`, stop and say so plainly (e.g. "there are unsaved changes in the Firefox repo" / "you're on branch X, not `main`") and ask how to proceed — do not run on a dirty tree. Once clean and on `main`, run `git pull` to get up to date. +3. **Bugzilla API key.** The key must be a non-empty `BUGZILLA_API_KEY` line in `~/.mozbuild/trainhop.env`. Check with: + ```bash + grep -qE '^BUGZILLA_API_KEY=.+' ~/.mozbuild/trainhop.env && echo ok + ``` + If that prints `ok`, continue. If not (file missing or value empty), the key isn't set up: point the user to the setup doc — https://mozilla-hub.atlassian.net/wiki/x/QoA4qg — and **stop** until they've created the file in their own terminal, then re-check. **Never ask for the key in the chat, prompt for it, or write it yourself** — the key must never enter the Claude session. You only verify it's present. +4. **Atlassian MCP** (only needed for step 5). The Atlassian MCP plugin must be installed and authenticated: `/plugin install atlassian@claude-plugins-official` then `/reload-plugins` (OAuth on first use, no token). See `references/credentials.md` for setup and the `${MCP}` tool-prefix note. + +## Steps + +Stop and report to the user if any step fails. Do not proceed past a failed step without explicit instruction. + +### 1. Create meta bug + +Follow `references/create-metabug.md`. Note the returned bug number — pass it to all subsequent steps. + +### 2. Update locales + +Follow `references/update-locales.md`, passing the meta bug number from step 1. + +### 3. Update metrics + +Follow `references/update-metrics.md`, passing the meta bug number from step 1. + +### 4. Generate the Nimbus recipe + +```bash +./mach newtab trainhop-recipe +``` + +Use the Ship task URL collected in the Inputs section. Display the full output. + +### 5. Create Confluence page and file QA ticket + +This is a three-substep flow. Do them in order: + +#### 5a. Create the Confluence page (with `QA-TBD` placeholder) + +Follow `references/create-confluence-page.md`, passing: +- The meta bug number from step 1 (full URL form) +- A placeholder for the QA ticket (`QA-TBD`) — the page will be updated in step 5c +- The dates (XPI Cut, QA Handoff, QA Sign-off, Release 50%/100%) as `YYYY-MM-DD` for HTML `