|
| 1 | +# Agent Instructions for NNF Software Release |
| 2 | + |
| 3 | +> **Agent entry point:** In VS Code, invoke the `@release` agent from the chat picker (defined in `.github/agents/release.agent.md`). The agent automatically loads this file and `RELEASE-PLAN.md` as context. |
| 4 | +
|
| 5 | +## Overview |
| 6 | + |
| 7 | +Execute the release plan defined in `RELEASE-PLAN.md` (in this same directory). That document is the authoritative, self-contained reference for the release process. Read it completely before starting. |
| 8 | + |
| 9 | +## Goal |
| 10 | + |
| 11 | +Create a release of the NNF software while ensuring the release process documented in `RELEASE-PLAN.md` is correct and repeatable. If you discover gaps, errors, or missing details in the plan, update it. |
| 12 | + |
| 13 | +## Agent Behavior |
| 14 | + |
| 15 | +### Execution Model |
| 16 | + |
| 17 | +- Run all commands in a terminal window so the user can see them. |
| 18 | +- Append `2>&1 | cat` to all `release-all.sh` and `gh` commands to avoid pager issues. |
| 19 | +- Execute one phase per repo at a time. Do not parallelize across repos. |
| 20 | +- Complete steps 4a–4d for each repo before moving to the next. |
| 21 | + |
| 22 | +### Approval Gates |
| 23 | + |
| 24 | +- **Wait for the user to approve** after each step before proceeding. |
| 25 | +- After each step, clearly state: |
| 26 | + 1. What you did |
| 27 | + 2. Whether you believe it succeeded |
| 28 | + 3. The evidence (command output, exit codes, API responses) |
| 29 | +- The user will respond with "approved", "approved. continue", or will coach you if something is wrong. |
| 30 | + |
| 31 | +### Error Handling |
| 32 | + |
| 33 | +- If a command fails, do **not** retry blindly. Analyze the error, explain it, and propose a fix. |
| 34 | +- If `merge-pr` produces no output, verify via: `gh api repos/<owner>/<repo>/pulls/<pr_number> 2>&1 | grep -o '"merged":[^,]*'` |
| 35 | +- If `tag-release` shows "Bypassed rule violations for refs/tags/..." — this is expected (tag protection rulesets allow admin/maintain bypass). |
| 36 | +- If a vendoring check fails, investigate the submodule pointer or vendor directory before proceeding. |
| 37 | +- Never use `--force`, `--no-verify`, or destructive operations without asking the user first. |
| 38 | + |
| 39 | +### Release Process |
| 40 | + |
| 41 | +The release process is the same regardless of how many repos have changes. The `release` phase automatically detects which repos have new commits since the last release. Repos with no changes report "No new changes to release" and are skipped in subsequent phases. Simply run all phases on all repos — the script handles the rest. |
| 42 | + |
| 43 | +### Key Gotchas (Learned from Experience) |
| 44 | + |
| 45 | +- `nnf_sos` requires the `-M` flag on ALL phases (not just `master`). |
| 46 | +- `nnf_mfu` and `nnf_ec` often have no changes — "No new changes to release" is normal, skip them. |
| 47 | +- `nnf_doc` must wait until after `nnf_deploy`'s GitHub Release is published (~60s after tagging). Verify with: `gh release view $NNF_RELEASE -R NearNodeFlash/nnf-deploy` |
| 48 | +- `nnf_doc` uses the `main` branch (not `master`). Its repo is `NearNodeFlash/NearNodeFlash.github.io`. |
| 49 | +- When a dependency changes (e.g., `nnf-sos`), all downstream repos that vendor it (`nnf-dm`, `nnf-integration-test`) must be revendored and their PRs merged **before** starting the release. If the vendoring check (Step 2) fails with "Peer modules are behind", follow Step 2a in RELEASE-PLAN.md to fix it. The check output prints the exact `go get` commands needed. |
| 50 | +- Always run vendoring checks on ALL repos — this catches stale submodule pointers. |
| 51 | +- After completing all releases, finalize release notes with `final-release-notes.sh` and run `compare-releases.sh` for verification. |
| 52 | + |
| 53 | +### Updating the Plan |
| 54 | + |
| 55 | +If you encounter an issue not covered by RELEASE-PLAN.md, or if a step's success criteria are unclear: |
| 56 | + |
| 57 | +1. Resolve the issue with the user's guidance. |
| 58 | +2. Update RELEASE-PLAN.md with what you learned. |
| 59 | +3. Note the update to the user. |
| 60 | + |
| 61 | +## Quick Start |
| 62 | + |
| 63 | +```sh |
| 64 | +# 1. Read the plan |
| 65 | +cat RELEASE-PLAN.md |
| 66 | + |
| 67 | +# 2. Ask the user: release type? (patch/minor/major, default patch) |
| 68 | + |
| 69 | +# 3. Source the helper: source ./setup-release-env.sh -B patch |
| 70 | +# Confirm the printed summary with the user |
| 71 | + |
| 72 | +# 4. Follow RELEASE-PLAN.md step by step, waiting for approval at each gate. |
| 73 | +``` |
0 commit comments