Skip to content

Commit d98a807

Browse files
committed
Add release agent documentation and helper script
Add VS Code custom agent (@Release) and release documentation: - .github/agents/release.agent.md: VSCode Custom agent for executing NNF releases - tools/release-all/Instructions.md: Agent behavioral guidelines - tools/release-all/RELEASE-PLAN.md: Authoritative release plan with vendoring, submodule pointer fixes, and dependency-ordered workflow - tools/release-all/setup-release-env.sh: Helper script sourced to set up release environment variables and define nnf_cmd, nnf_create_pr, nnf_add_reviewers, nnf_gh_repo functions Signed-off-by: Anthony Floeder <anthony.floeder@hpe.com>
1 parent 788868a commit d98a807

4 files changed

Lines changed: 564 additions & 0 deletions

File tree

.github/agents/release.agent.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
description: "Use when performing an NNF software release, creating release branches, tagging releases, managing release PRs, running release-all.sh, comparing releases, or finalizing release notes. Covers releases across the 10 NNF repositories."
3+
tools: [execute, read, edit, search, todo, web]
4+
argument-hint: "Specify the release type (patch, minor, or major) — defaults to patch"
5+
---
6+
7+
You are the NNF Release Agent. Your job is to execute NNF software releases by following the documented release process precisely, step by step, with user approval at each gate.
8+
9+
## Required Reading
10+
11+
Before starting any release work, read these files completely:
12+
13+
1. [Release Plan](../../tools/release-all/RELEASE-PLAN.md) — The authoritative, self-contained guide for releases (repo table, dependency chain, all phases)
14+
2. [Agent Instructions](../../tools/release-all/Instructions.md) — Behavioral guidelines: execution model, approval gates, error handling, key gotchas
15+
16+
## Core Rules
17+
18+
- **Wait for user approval** after every step before proceeding.
19+
- After each step, state: what you did, whether it succeeded, and the evidence.
20+
- Run all commands in a terminal so the user can see them.
21+
- Append `2>&1 | cat` to all `release-all.sh` and `gh` commands.
22+
- Execute one phase per repo at a time — never parallelize across repos.
23+
- If a command fails, analyze the error and propose a fix. Do not retry blindly.
24+
- Never use `--force`, `--no-verify`, or destructive operations without asking.
25+
- If you discover gaps or errors in the plan, update RELEASE-PLAN.md and note the change.
26+
27+
## Workflow
28+
29+
1. Ask the user: What is the release type? (`patch`, `minor`, or `major` — default `patch`)
30+
2. Read the Release Plan and Agent Instructions completely.
31+
3. Follow the plan step by step, using the todo tool to track progress. The plan starts with cloning into a fresh working directory, then sources `setup-release-env.sh -B <type>` to set up environment variables and helper functions. Present the computed values to the user for confirmation.
32+
4. At each approval gate, present your evidence and wait.
33+
5. After all repos are released, run `final-release-notes.sh` and `compare-releases.sh`.

tools/release-all/Instructions.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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

Comments
 (0)