Skip to content

Commit 3180b52

Browse files
authored
Merge pull request #35 from cometapi-dev/agent/finalize-release-please-0.1.1
fix: finalize Release Please patch state
2 parents 0963e0e + ab5aa26 commit 3180b52

7 files changed

Lines changed: 72 additions & 52 deletions

File tree

‎.github/workflows/release-please.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,11 @@ jobs:
658658
"+refs/heads/${RELEASE_BRANCH}:refs/remotes/origin/${RELEASE_BRANCH}"
659659
release_ref="refs/remotes/origin/${RELEASE_BRANCH}"
660660
branch_sha="$(git rev-parse "$release_ref")"
661+
branch_parent="$(git rev-parse "${release_ref}^")"
662+
if [[ "$branch_parent" != "$GITHUB_SHA" ]]; then
663+
echo "The prepared Release Please branch is not based directly on current main." >&2
664+
exit 1
665+
fi
661666
gh api --paginate --slurp \
662667
"repos/${GITHUB_REPOSITORY}/pulls?state=open&base=main&per_page=100" \
663668
| jq 'add' > "$pull_requests_file"

‎AGENTS.md‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,17 @@ manually against the exact merged release commit, and the publish workflow
8686
completed exact-artifact verification, the bounded live smoke, npm OIDC
8787
publication, and registry verification.
8888

89-
Release Please remains disabled between releases after its post-0.1.0 run
90-
generated an unreviewed `0.2.0` temporary-branch commit and then failed to create
91-
a pull request. The temporary branch is failure evidence only. Do not merge it
92-
or use it as a 0.2 starting point. The authorized 0.1.1 maintenance task repairs
93-
the workflow around the current read-only-default Actions baseline with
89+
Release Please remains disabled between release operations after its post-0.1.0
90+
run generated an unreviewed `0.2.0` temporary-branch commit and then failed to
91+
create a pull request. That branch was verified as failure-only evidence before
92+
the authorized 0.1.1 operation replaced it with the action-owned patch branch.
93+
Do not use either branch as a 0.2 starting point. The 0.1.1 maintenance task
94+
repairs the workflow around the current read-only-default Actions baseline with
9495
action-created pull requests enabled; any later enablement still requires an
9596
explicit maintainer request and the fail-closed checks in `RELEASING.md`.
97+
For this repair, merge the anchor-removal finalization PR first, then use a new
98+
first-attempt manual dispatch to refresh the same action-owned 0.1.1 PR before
99+
its final CI and human-owner review.
96100

97101
## Product Contract
98102

‎README.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ defaulting the client to CometAPI.
99
> The supported API is limited to the contract-tested 0.1 surface documented
1010
> here and in [COMPATIBILITY.md](./COMPATIBILITY.md).
1111
>
12-
> A `0.1.1` maintenance release is being prepared to correct the public options
13-
> contract and restore the normal Release Please path. It is not released until
14-
> the immutable release, npm OIDC publication, and public-registry verification
15-
> complete.
12+
> **Approved maintenance candidate:** `0.1.1` is approved for npm publication
13+
> through the reviewed Release Please path. This approval is not a release
14+
> claim: `0.1.1` remains unpublished until the immutable release, npm OIDC
15+
> publication, and public-registry verification complete.
1616
1717
## Supported 0.1 surface
1818

@@ -58,9 +58,9 @@ For source-checkout testing, retain and verify one exact tarball:
5858
```bash
5959
mkdir -p .artifacts
6060
npm pack --pack-destination .artifacts
61-
npm run test:package -- --tarball .artifacts/cometapi-0.1.0.tgz
62-
npm run test:examples -- --tarball .artifacts/cometapi-0.1.0.tgz
63-
npm run test:fixtures -- --tarball .artifacts/cometapi-0.1.0.tgz
61+
npm run test:package -- --tarball .artifacts/cometapi-$(node -p 'require("./package.json").version').tgz
62+
npm run test:examples -- --tarball .artifacts/cometapi-$(node -p 'require("./package.json").version').tgz
63+
npm run test:fixtures -- --tarball .artifacts/cometapi-$(node -p 'require("./package.json").version').tgz
6464
```
6565

6666
Install that path in a separate consumer when needed. Do not treat a locally

‎RELEASING.md‎

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -454,12 +454,15 @@ executed README examples against the packed artifact, release-PR/tag/changelog/
454454
manifest version agreement, reviewed security and compatibility status, and
455455
post-publication registry evidence.
456456

457-
The 0.1.1 repair uses one explicit `last-release-sha` boundary at the immutable
458-
0.1.0 release commit, `1752cbb57f11dc6dca8dd1b13f0f8d5e8b5fdfca`. It exists
459-
only to prevent pre-0.1.0 features from being rediscovered while the normal
460-
Release Please history is repaired. The generated 0.1.1 PR must remove that
461-
temporary override before merge; future releases must discover the Release
462-
Please-created `v0.1.1` boundary normally.
457+
The 0.1.1 repair used one explicit `last-release-sha` boundary at the immutable
458+
0.1.0 release commit, `1752cbb57f11dc6dca8dd1b13f0f8d5e8b5fdfca`, only for
459+
the initial preparation dispatch. That dispatch proved the normal action-owned
460+
0.1.1 PR without rediscovering pre-0.1.0 features. A normal topic PR then removes
461+
the temporary override and records final candidate approval on `main`; a fresh
462+
preparation dispatch refreshes the action-owned release PR from that state. The
463+
finalization commit must use a releasable `fix:` subject so Release Please
464+
updates the generated notes and cannot treat the old branch as unchanged.
465+
Future releases discover the Release Please-created `v0.1.1` boundary normally.
463466

464467
Before enabling the repaired workflow, create the standard
465468
`autorelease: pending` and `autorelease: tagged` labels if they are still
@@ -494,8 +497,13 @@ The `GITHUB_TOKEN`-created PR's `pull_request` CI starts in GitHub's
494497
approval-required state. A human with write access must explicitly authorize
495498
those workflow runs before their results can satisfy required checks; this is
496499
separate from the final-head administrator review.
497-
Remove the one-cycle `last-release-sha` from that branch, complete the
498-
release-ready documentation, run the full matrix on its final head, and obtain
500+
After the finalization topic PR removes the one-cycle `last-release-sha` and
501+
completes the release-ready documentation on `main`, start a new first-attempt
502+
manual dispatch. Require it to refresh the same action-owned release PR with
503+
only the four generated release files and release notes identical to the
504+
generated CHANGELOG section. Require the refreshed release commit to have the
505+
post-finalization `main` commit as its direct parent; an unchanged older head is
506+
not a refreshed candidate. Run the full matrix on that final head and obtain
499507
approval from a different human repository administrator. The release-PR merge
500508
creates the `push` run that may tag and publish. A later push cannot tag an older
501509
outstanding release PR; its merge SHA must equal the triggering SHA before
@@ -518,13 +526,12 @@ mutate the release branch during that window. The workflow repeats those checks
518526
after the action and stops publication on any drift, but it cannot delete or
519527
replace an immutable Release created during an external race.
520528

521-
The stale branch
522-
`release-please--branches--main--components--cometapi` at
523-
`3f0949e5c0ccd0923d10595437f7a315f013af7c` is the failed run's evidence, not a
524-
release candidate. Immediately before replacing or deleting it, confirm that
525-
it still contains the documented generated 0.2.0 state, has no associated open
526-
PR, and contains no independent work. Do not delete or rewrite any other
527-
branch.
529+
The stale branch at `3f0949e5c0ccd0923d10595437f7a315f013af7c` was revalidated
530+
as the failed run's generated 0.2.0 evidence, with no associated open PR or
531+
independent work, then deleted. Release Please recreated the canonical
532+
`release-please--branches--main--components--cometapi` branch for the
533+
action-owned 0.1.1 PR. Do not use that branch as a 0.2 starting point or delete
534+
or rewrite any other branch.
528535
529536
For 0.1.1, `always-bump-patch` keeps every releasable Conventional Commit on the
530537
0.1.x maintenance line; changing that strategy requires a separately authorized
@@ -643,11 +650,9 @@ layers:
643650
`3f0949e5c0ccd0923d10595437f7a315f013af7c`, a generated `0.2.0` draft, but
644651
before creating a pull request. It did not modify `main`, create a tag, or
645652
publish a package. `RELEASE_PLEASE_ENABLED` was set to `false` before the
646-
closeout push; the branch is retained as failure evidence and must not be
647-
merged or treated as the start of 0.2. Release Please remains disabled until
648-
the authorized 0.1.1 repair is merged, the stale branch is revalidated and
649-
removed, and the normal action-created PR path is ready for one first-attempt
650-
preparation run.
653+
closeout push. During the authorized 0.1.1 repair, the branch was revalidated
654+
as failure-only evidence with no associated PR or independent work, deleted,
655+
and then recreated by Release Please for the normal action-owned 0.1.1 PR.
651656
652657
## Verification record
653658

‎ROADMAP.md‎

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,30 +106,33 @@ Actions to create or approve pull requests at that time. The run did not change
106106
`main`, create a tag or published Release, or publish to npm.
107107

108108
The 0.1.1 maintenance work makes the component and stable-patch policy
109-
explicit, anchors the one repair cycle at the exact 0.1.0 release commit, and
110-
restores Release Please ownership of the reviewed version/changelog PR plus the
111-
immutable tag and GitHub Release. The scoped Release Please job now uses the
112-
repository's enabled Actions PR authorization to create and label the normal PR;
109+
explicit, used the exact 0.1.0 release commit to anchor only the initial repair
110+
dispatch, and restores Release Please ownership of the reviewed
111+
version/changelog PR plus the immutable tag and GitHub Release. A normal topic
112+
PR removes that temporary anchor and records final candidate approval before a
113+
fresh preparation dispatch refreshes the action-owned release PR. The scoped
114+
Release Please job now uses the repository's enabled Actions PR authorization
115+
to create and label the normal PR;
113116
a human owner reviews its exact final head. Default workflow permissions remain
114117
read-only, bot approval is never accepted, and the workflow does not modify the
115118
repository setting. Patch-only versioning prevents an implicit 0.2 bump during
116-
this maintenance window. The temporary anchor must be removed in that release
117-
PR before merge. The explicit component identifies the temporary branch but,
118-
for this root package, does not enter the Release Please title or public tag;
119+
this maintenance window. The explicit component identifies the temporary
120+
branch but, for this root package, does not enter the Release Please title or public tag;
119121
the only accepted patch tag is `v0.1.1`. Publication is triggered from the
120122
successful attempt-qualified Release Please push run and independently verifies
121123
that run's schema-v2 result artifact, default-branch commit, tag, immutable
122124
Release, and package artifact before the existing bounded live smoke and npm
123-
OIDC steps. A
124-
push rerun is bounded to the same run ID, SHA, candidate, Release-producing
125+
OIDC steps. A push rerun is bounded to the same run ID, SHA, candidate,
126+
Release-producing
125127
attempt, and exact Release state; manual preparation remains attempt-1-only.
126-
The Release notes must equal the reviewed `CHANGELOG` entry. The post-merge run also
127-
requires an administrator's approval on the release PR's final head.
128-
129-
The exact stale branch remains failure evidence until its contents, lack of an
130-
open PR, and lack of independent work are reconfirmed immediately before
131-
cleanup. It must never be merged or treated as the start of 0.2. Repository
132-
foundation may become Complete only after the real 0.1.1 release flow, public
128+
The Release notes must equal the reviewed `CHANGELOG` entry. The post-merge run
129+
also requires an administrator's approval on the release PR's final head.
130+
131+
The exact stale 0.2 branch was revalidated as failure-only evidence with no
132+
associated PR or independent work, then deleted. Release Please recreated the
133+
canonical branch for the action-owned 0.1.1 PR; it must never be treated as the
134+
start of 0.2. Repository foundation may become Complete only after the real
135+
0.1.1 release flow, public
133136
registry installation, and a separate post-release documentation PR recording
134137
ROADMAP and RELEASING evidence succeed. Until then,
135138
`RELEASE_PLEASE_ENABLED` remains a temporary release-operation control,

‎release-please-config.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
33
"label": "autorelease: pending",
4-
"last-release-sha": "1752cbb57f11dc6dca8dd1b13f0f8d5e8b5fdfca",
54
"release-label": "autorelease: tagged",
65
"separate-pull-requests": true,
76
"packages": {

‎tests/workflow-contract.test.mjs‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ describe("GitHub Actions workflow contract", () => {
243243
"release-please-result-${{ github.run_id }}-${{ github.run_attempt }}",
244244
);
245245
expect(releasePlease).toContain("validateReleasePleaseActionResult");
246+
expect(releasePlease).toContain(
247+
'branch_parent="$(git rev-parse "${release_ref}^")"',
248+
);
249+
expect(releasePlease).toContain(
250+
'if [[ "$branch_parent" != "$GITHUB_SHA" ]]',
251+
);
246252
expect(releasePlease).toContain("schemaVersion: 2");
247253
expect(releasePlease).toContain("actionOutcome");
248254
expect(releasePlease).toContain("recovered");
@@ -268,9 +274,7 @@ describe("GitHub Actions workflow contract", () => {
268274
),
269275
).toBeLessThan(releasePlease.indexOf("Run Release Please"));
270276

271-
expect(releasePleaseConfig["last-release-sha"]).toBe(
272-
"1752cbb57f11dc6dca8dd1b13f0f8d5e8b5fdfca",
273-
);
277+
expect(releasePleaseConfig).not.toHaveProperty("last-release-sha");
274278
expect(releasePleaseConfig.label).toBe("autorelease: pending");
275279
expect(releasePleaseConfig["release-label"]).toBe("autorelease: tagged");
276280
expect(releasePleaseConfig["separate-pull-requests"]).toBe(true);

0 commit comments

Comments
 (0)