Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/integration-governance.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const MAX_COMMITS = 1000;
const MAX_AUTHOR_BATCH = 50;
// This literal is inside the enrolled .github closure. A caller-supplied
// preparedBy.sourceSHA must never choose a new executable verifier tree.
const TRUSTED_SCRIPTS_TREE = '630082873462479b5777ebc7d5dc255bae6f8df2';
const TRUSTED_SCRIPTS_TREE = 'b60380f8d0040628eba73ad17c108b1be87c7fdd';
const SOURCE = 'https://github.com/kubernetes-sigs/kubebuilder-release-tools/tree/012269a88fa4c034a0acf1ba84c26b195c0dbab4';
const sha = value => crypto.createHash('sha256').update(value).digest('hex');
const git = (args, cwd = process.cwd()) =>
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ These rules apply to every AI agent (hive agents, Copilot CLI, Claude Code, Code

- Keep changes surgical and PR-sized; one concern per PR.
- Sign commits (`git commit -s`); PR titles start with an emoji (`✨` feature, `🐛` fix, `📖` docs or proposal, `🌱` chore, `⚠️` breaking); `📝` fails the PR Type gate.
- Every PR with a user-visible `src/` code change needs a `changelog.d/<category>-<slug>.md` fragment at the repository root whose body is a single `- ` bullet.
- Every PR with a user-visible `src/` code change needs a `changelog.d/<category>-<slug>.md` fragment at the repository root whose body is a single `- ` bullet. From inside `src/` (the Go module) that path is `../changelog.d/`; anything written to `src/changelog.d/` is never compiled into `CHANGELOG.md`, fails the guard, and fails the release (#18264).
- Do not hand-edit `src/docs` file:line citations; when CI's citation guard reports drift, run `python3 src/scripts/check-docs-citations.py --fix`.

## Project knowledge is scoped, not global
Expand Down
4 changes: 3 additions & 1 deletion changelog.d/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ deleting the fragments in the same release commit.

- **Location:** this directory, at the repository root. Never `src/changelog.d/`:
the compiler does not read it, and the guard rejects fragments there with
the `git mv` that fixes it (#11919).
the `git mv` that fixes it (#11919). When working from `src/`, write
`../changelog.d/<file>.md`. If a stray ever slips past the guard, the release
compile fails until it is moved here (#18264).

- **Filename:** `<category>-<pr-or-slug>.md`, where `<category>` is one of
`added`, `changed`, `deprecated`, `fixed`, `security` — it picks the `###`
Expand Down
1 change: 1 addition & 0 deletions changelog.d/fixed-18264-stranded-fragments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Release: 14 changelog entries from late-October PRs (#13280, #13486, #13609, #13758, #13760, #13805, #13807, #13821, #13822, #14208, #14220, #14322, #14580, #14585) were written to `src/changelog.d/`, which the release compiler never reads, so they shipped without release notes; they are moved to the repo-root `changelog.d/` and land in this release. The release compile now fails loudly while any fragment sits under `src/changelog.d/`, so a stray can no longer disappear silently ([#18264](https://github.com/hivecommons/hive/issues/18264)).
1 change: 1 addition & 0 deletions changelog.d/fixed-supersession-sweep-stage-machine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Supersession sweep: escalation now goes through the stage engine (`needs-human` + `Parked` fact → `stage/085-needs-decision` in the same pass) instead of a bare `needs-human` beside an active lane stage, and a hive-authored PR at L6 whose claimed issue another merged PR closed but which touches files that PR did not is resolved by the hive itself — update-branch onto base, re-measure, rewrite `Closes #N` to `Refs #N (closed by #M; …)` and continue, or self-close when nothing meaningful remains — rather than handed to a person.
4 changes: 3 additions & 1 deletion src/changelog.d/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
Changelog fragments go in [`changelog.d/`](../../changelog.d/README.md) at the
**repository root**, not here under `src/`. `src/scripts/compile-changelog.sh`
only reads the root directory, so a fragment placed here is never compiled into
`CHANGELOG.md`, and the `changelog-fragment-guard` check rejects it (#11919).
`CHANGELOG.md`, the `changelog-fragment-guard` check rejects it (#11919), and
`compile-changelog.sh` refuses to cut a release while one sits here (#18264).
From inside `src/`, the right path is `../changelog.d/`.

Name the file `changelog.d/<added|changed|deprecated|fixed|security>-<pr-or-slug>.md`
and make its content a single `- ` bullet. If you already added one here, move it:
Expand Down
1 change: 0 additions & 1 deletion src/changelog.d/fixed-supersession-sweep-stage-machine.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/docs/knowledge/changelog-fragment-exemptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Exempt automatically — no fragment and no label needed:

Other test-adjacent changes (`testdata/` fixtures, non-`_test.go` test helpers) and non-user-visible `src/` code changes (refactors, dependency bumps) need the `no-changelog` label instead of a fragment.

`changelog.d/` is at the repository root, not under `src/` — `src/changelog.d/` is never compiled and the guard rejects it.
`changelog.d/` is at the repository root, not under `src/` — `src/changelog.d/` is never compiled, the guard rejects it, and the release compile fails while any fragment sits there (#18264). From inside `src/`, write `../changelog.d/`.
28 changes: 28 additions & 0 deletions src/scripts/compile-changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
# release, so one such fragment silently freezes every later merge.
# - Each fragment is deleted after a successful compile, so `git add -A
# changelog.d` in the release commit records the consumption.
# - Any fragment (other than README.md) under src/changelog.d/ next to the
# changelog is a LOUD failure before anything else runs: that directory
# is never compiled, so its entries would otherwise be lost (#18264).
# Override the checked path with STRANDED_FRAGDIR.
#
# Usage: src/scripts/compile-changelog.sh [changelog-path] [fragments-dir]
# changelog-path default CHANGELOG.md
Expand Down Expand Up @@ -76,6 +80,30 @@ if [[ ! -f "$CHANGELOG" ]]; then
exit 1
fi

# Release-time backstop for misplaced fragments (#11919, #18264). Only the
# repo-root changelog.d/ is compiled; a fragment under src/changelog.d/ is
# never read, so its entry silently never reaches CHANGELOG.md. The PR guard
# rejects such fragments, but twice PRs merged with it red (161 strays cleaned
# by #11928, 14 more on v5 and 81 on v6 by #18264). Fail loudly here, before
# the no-op exits below, so a stray shows up as a red release job on the very
# next merge instead of disappearing for weeks. The directory is resolved next
# to the changelog so fixture runs in a temp dir never see the real repo.
STRANDED_FRAGDIR="${STRANDED_FRAGDIR:-$(dirname -- "$CHANGELOG")/src/changelog.d}"
if [[ -d "$STRANDED_FRAGDIR" ]]; then
stranded=0
shopt -s nullglob
for f in "$STRANDED_FRAGDIR"/*.md; do
[[ "$(basename "$f")" == "README.md" ]] && continue
echo "::error file=${f}::fragment is under src/changelog.d/, which is never compiled — run: git mv ${f} ${FRAGDIR}/$(basename "$f")" >&2
stranded=1
done
shopt -u nullglob
if [[ "$stranded" -ne 0 ]]; then
echo "::error::refusing to compile while fragments sit in ${STRANDED_FRAGDIR}/ — move them to ${FRAGDIR}/ (see ${FRAGDIR}/README.md)." >&2
exit 1
fi
fi

if [[ ! -d "$FRAGDIR" ]]; then
echo "No ${FRAGDIR}/ directory — nothing to compile."
exit 0
Expand Down
48 changes: 48 additions & 0 deletions src/scripts/test-compile-changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
# would change the derived semver bump);
# - the compiled result is exactly what derive-release-version.sh needs:
# an added- fragment flips an empty Unreleased to a minor release.
# - a fragment stranded under src/changelog.d/ (never compiled) fails the
# compile loudly, and the repository itself carries none (#18264);
# - the release move targets the real `## Unreleased` heading line, not a
# prose/backtick mention that appears before it.
#
Expand Down Expand Up @@ -206,6 +208,52 @@ else
fi
fi

# ---------------------------------------------------------------------------
# Case 5d: a fragment stranded under src/changelog.d/ fails the compile
# (#18264). That directory is never compiled, so 14 v5 and 81 v6 entries sat
# there unreleased; the release job must go red instead of shipping without
# them. This holds even with no root fragments at all (the stray alone must
# not look like a no-op), and README.md there is the pointer, not a fragment.
# ---------------------------------------------------------------------------
dir=$(new_case 5d)
mkdir -p "$dir/src/changelog.d"
printf -- 'pointer to the real directory\n' > "$dir/src/changelog.d/README.md"
cp "$dir/CHANGELOG.md" "$tmp/case5d.before"
if ( cd "$dir" && bash "$compile" CHANGELOG.md changelog.d ) > "$tmp/case5d-readme.out" 2>&1; then
note_ok "a README.md alone under src/changelog.d/ is not a stranded fragment"
else
note_fail "README.md under src/changelog.d/ must not fail the compile: $(cat "$tmp/case5d-readme.out")"
fi
printf -- '- a stranded fix ([#14](https://example.invalid/14)).\n' > "$dir/src/changelog.d/fixed-14-stranded.md"
if ( cd "$dir" && bash "$compile" CHANGELOG.md changelog.d ) > "$tmp/case5d.out" 2>&1; then
note_fail "a fragment under src/changelog.d/ must fail the compile even with no root fragments"
else
if grep -q 'src/changelog.d/fixed-14-stranded.md' "$tmp/case5d.out" \
&& cmp -s "$dir/CHANGELOG.md" "$tmp/case5d.before" \
&& [[ -f "$dir/src/changelog.d/fixed-14-stranded.md" ]]; then
note_ok "a stranded src/changelog.d/ fragment fails loudly, naming the file, with CHANGELOG.md untouched"
else
note_fail "stranded-fragment failure must name the file and leave everything untouched: $(cat "$tmp/case5d.out")"
fi
fi
printf -- '- a real fix ([#15](https://example.invalid/15)).\n' > "$dir/changelog.d/fixed-15-real.md"
if ( cd "$dir" && bash "$compile" CHANGELOG.md changelog.d ) > "$tmp/case5d-mixed.out" 2>&1; then
note_fail "a stranded fragment must fail the compile even beside valid root fragments"
elif [[ -f "$dir/changelog.d/fixed-15-real.md" ]] && cmp -s "$dir/CHANGELOG.md" "$tmp/case5d.before"; then
note_ok "a stranded fragment blocks the compile before any root fragment is consumed"
else
note_fail "a stranded fragment must leave root fragments and CHANGELOG.md untouched"
fi

# The repository itself must carry no stranded fragments: the live
# src/changelog.d/ holds only its README pointer (#18264).
repo_stranded=$(find "$script_dir/../changelog.d" -maxdepth 1 -type f -name '*.md' ! -name README.md 2>/dev/null | sort)
if [[ -z "$repo_stranded" ]]; then
note_ok "the repository has no fragments under src/changelog.d/"
else
note_fail "fragments under src/changelog.d/ are never compiled; git mv them to the repo-root changelog.d/: $(echo "$repo_stranded" | tr '\n' ' ')"
fi

dir=$(new_case 5c)
git init -q "$dir"
git -C "$dir" config user.email test@example.com
Expand Down
Loading