diff --git a/.agents/skills/release-changelog/SKILL.md b/.agents/skills/release-changelog/SKILL.md index 55e7b360ea..022df4ae5b 100644 --- a/.agents/skills/release-changelog/SKILL.md +++ b/.agents/skills/release-changelog/SKILL.md @@ -168,6 +168,11 @@ Guidelines: - write from the user perspective - keep highlights short and concrete - spell out upgrade actions for breaking changes +- **write at full stable depth from the first pass**: the beta-keyed + draft ships verbatim as the stable's notes, so the previous stable's + file is the density bar the moment the draft is first written — never + leave it at generated-skeleton density for the soak. The skeleton's + nested PR summaries are raw material to rewrite, not a format to keep. - **describe deltas, not repeats**: read the previous stable's notes (`releases/v.md`) before writing. When they already introduced a feature, this release's entry covers only what changed — diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29abc996c5..1f0511e051 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -647,6 +647,9 @@ jobs: timeout-minutes: 10 permissions: contents: write + # gh pr view needs PR read for the skeleton's nested summaries; + # without it the enrichment silently degrades to bare subjects. + pull-requests: read steps: - name: Checkout repository uses: actions/checkout@v7 @@ -661,6 +664,9 @@ jobs: - name: Draft stable notes from the published beta env: + # gh needs a token so the generator can nest each PR's summary + # under its subject line (best-effort thoroughness). + GH_TOKEN: ${{ github.token }} BETA_VERSION: ${{ needs.publish_beta.outputs.beta_version }} SOURCE_SHA: ${{ needs.select_beta.outputs.sha }} run: | diff --git a/scripts/draft-stable-notes.sh b/scripts/draft-stable-notes.sh index 5bd42e9ba1..45be29edc3 100755 --- a/scripts/draft-stable-notes.sh +++ b/scripts/draft-stable-notes.sh @@ -123,6 +123,26 @@ fi subjects="$(git -C "$repo_dir" log --no-merges --format='%s' "$range")" +# Best-effort thoroughness: nest each referenced PR's own summary under its +# subject line, so the skeleton is a genuinely thorough raw document at +# creation time instead of a bare commit list. Prefers the PR template's +# "What Changed" bullets, falls back to the first prose lines. Degrades +# silently when gh or the network is unavailable (tests, offline runs); +# set DRAFT_NOTES_SKIP_PR_ENRICHMENT=1 to disable explicitly. +enrich_pr() { + local pr_num="$1" pr_body excerpt + [ "${DRAFT_NOTES_SKIP_PR_ENRICHMENT:-0}" = "1" ] && return 0 + pr_body="$(cd "$repo_dir" && gh pr view "$pr_num" --json body --jq .body 2>/dev/null || true)" + [ -n "$pr_body" ] || return 0 + if printf '%s\n' "$pr_body" | grep -q '^## What Changed'; then + excerpt="$(printf '%s\n' "$pr_body" | sed -n '/^## What Changed/,/^## /p' | grep -E '^- ' | head -3 || true)" + else + excerpt="$(printf '%s\n' "$pr_body" | grep -vE '^[[:space:]]*$|^#|^>|^