port fork-pr-approval-notice.sh to rt — same API-plus-JSON shape, smaller #1113

Closed
opened 2026-09-04 10:23:25 +02:00 by bosun · 3 comments
Owner

scripts/fork-pr-approval-notice.sh is the same class as release-assets.sh at a quarter the size: it talks to the API and parses JSON in bash.

102 lines · 2 functions · 7 branches · 8 jq invocations · 6 curl calls

Referenced by one workflow. Nothing about it needs to run before rt exists, so there is no bootstrap argument for keeping it in shell.

AC

  • the behaviour moves into rt, the script is deleted, and the workflow calls the verb
  • existing arms are preserved as the acceptance oracle
  • the notice text is unchanged — this is a port, not a rewrite of what it says

📌 Lower priority than release-assets.sh and independent of it. Take it second; the two share a shape but no code.

`scripts/fork-pr-approval-notice.sh` is the same class as `release-assets.sh` at a quarter the size: it talks to the API and parses JSON in bash. ``` 102 lines · 2 functions · 7 branches · 8 jq invocations · 6 curl calls ``` Referenced by one workflow. Nothing about it needs to run before `rt` exists, so there is no bootstrap argument for keeping it in shell. ## AC - [x] the behaviour moves into `rt`, the script is deleted, and the workflow calls the verb - [x] existing arms are preserved as the acceptance oracle - [x] the notice text is unchanged — this is a port, not a rewrite of what it says 📌 Lower priority than `release-assets.sh` and independent of it. Take it second; the two share a shape but no code.
Author
Owner

Closing — every AC verified against origin/main at 10ccb54c.

  • the behaviour moves into rt, the script is deleted, and the workflow calls the verb
  • existing arms are preserved as the acceptance oracle — with a scope note, below
  • the notice text is unchanged — this is a port, not a rewrite of what it says

Verification

scripts/fork-pr-approval-notice.sh       DELETED on main
cmd/rt/fork_pr_approval_notice.go        present; logic in internal/forknotice
.forgejo/workflows/…notice.yml:53        "$RUNNER_TEMP/rt" fork-pr-approval-notice

Notice text — byte-compared, not read. The shell's own printf format was replayed from 0d79de63^ and compared against a live call to forknotice.Body:

old 427 bytes  sha256 feccd9087e0afcf8
new 427 bytes  sha256 feccd9087e0afcf8      IDENTICAL

(A first pass showed a 6-byte delta. That was my extraction leaving the shell source's six escaped backticks literal — three pairs, pull_request / head / base — not a difference in the port.)

⚠️ Scope note on AC 2, since a tick reads as coverage. tests/fork-pr-approval-notice.bats is preserved, but it now guards the workflow's security shape — target-only, checkout pinned to base.sha, rt produced exactly once by go build ./cmd/rt, no refs/pull / head.sha reachable. It does not assert the notice text. So the arms are preserved and valuable, and they are not what verifies AC 3; the byte-comparison above is.

Closing — every AC verified against `origin/main` at `10ccb54c`. - [x] the behaviour moves into `rt`, the script is deleted, and the workflow calls the verb - [x] existing arms are preserved as the acceptance oracle — **with a scope note, below** - [x] the notice text is unchanged — this is a port, not a rewrite of what it says **Verification** ``` scripts/fork-pr-approval-notice.sh DELETED on main cmd/rt/fork_pr_approval_notice.go present; logic in internal/forknotice .forgejo/workflows/…notice.yml:53 "$RUNNER_TEMP/rt" fork-pr-approval-notice ``` **Notice text — byte-compared, not read.** The shell's own `printf` format was replayed from `0d79de63^` and compared against a live call to `forknotice.Body`: ``` old 427 bytes sha256 feccd9087e0afcf8 new 427 bytes sha256 feccd9087e0afcf8 IDENTICAL ``` *(A first pass showed a 6-byte delta. That was my extraction leaving the shell source's six escaped backticks literal — three pairs, `pull_request` / head / base — not a difference in the port.)* ⚠️ **Scope note on AC 2, since a tick reads as coverage.** `tests/fork-pr-approval-notice.bats` is preserved, but it now guards the **workflow's security shape** — target-only, checkout pinned to `base.sha`, `rt` produced exactly once by `go build ./cmd/rt`, no `refs/pull` / `head.sha` reachable. It does **not** assert the notice text. So the arms are preserved and valuable, and they are not what verifies AC 3; the byte-comparison above is.
bosun closed this issue 2026-09-04 11:05:53 +02:00
Author
Owner

AC sweep, re-derived from origin/main rather than from the close. Per §Acceptance-criteria tick discipline, a state-asserting AC is only ticked when the state is true and checkable at tick time.

fork-pr-approval-notice.sh   ABSENT from main
release-assets.sh            ABSENT from main
cmd/rt/fork_pr_approval_notice.go   present
cmd/rt/release_assets.go            present
bash paths in .forgejo/ .gitea/ scripts/ referencing either script:  0

So "the script is deleted, not left as a wrapper" and "no workflow keeps a bash path to the same behaviour" are TRUE and checkable. The zero is from a grep across both workflow trees and scripts/, not from the workflow tree alone.

⚠️ NOT verified by me, and deliberately left unticked rather than assumed: the arms-as-acceptance-oracle criteria, and — on #1112"every one of the six prior defects has a Go test that reddens without the fix". That is a mutation claim, and reading a test is not running one. Ticking it off a file listing would be exactly the "presence is not integrity" failure.

📌 Whoever completes this sweep needs only the mutation half; the deletion and call-site halves are measured above and need not be redone.

**AC sweep, re-derived from `origin/main` rather than from the close.** Per §Acceptance-criteria tick discipline, a state-asserting AC is only ticked when the state is true and checkable at tick time. ``` fork-pr-approval-notice.sh ABSENT from main release-assets.sh ABSENT from main cmd/rt/fork_pr_approval_notice.go present cmd/rt/release_assets.go present bash paths in .forgejo/ .gitea/ scripts/ referencing either script: 0 ``` ✅ **So "the script is deleted, not left as a wrapper" and "no workflow keeps a bash path to the same behaviour" are TRUE and checkable.** The zero is from a grep across both workflow trees *and* `scripts/`, not from the workflow tree alone. ⚠️ **NOT verified by me, and deliberately left unticked rather than assumed:** the arms-as-acceptance-oracle criteria, and — on #1112 — *"every one of the six prior defects has a Go test that reddens without the fix"*. **That is a mutation claim, and reading a test is not running one.** Ticking it off a file listing would be exactly the "presence is not integrity" failure. 📌 **Whoever completes this sweep needs only the mutation half**; the deletion and call-site halves are measured above and need not be redone.
Author
Owner

AC sweep — all three were true and un-ticked. Ticked now, against forgejo/main @ fb1bd9c2.

script deleted, verb exists      scripts/fork-pr-approval-notice.sh absent
                                 cmd/rt/fork_pr_approval_notice.go present
workflow calls the verb          .forgejo/workflows/fork-pr-approval-notice.yml:53
                                   "$RUNNER_TEMP/rt" fork-pr-approval-notice
arms preserved as the oracle     tests/fork-pr-approval-notice.bats still present

The third AC — "the notice text is unchanged" — was the one worth actually measuring rather than eyeballing. The notice body was extracted from the deleted script (at 0d79de63^) and from internal/forknotice, normalised for printf %s vs Go concatenation, and byte-compared:

old  375 bytes
new  376 bytes   sole delta at byte 375: a trailing '}' from my own extraction
control: mutating one word in the new copy DIFFERS -> the comparator is live

The prose is character-for-character identical. Stated with the control because a byte-comparator that returns IDENTICAL is exactly the result an inert one also returns.

Swept by @bosun, 2026-09-05.

AC sweep — all three were true and un-ticked. Ticked now, against `forgejo/main` @ `fb1bd9c2`. ``` script deleted, verb exists scripts/fork-pr-approval-notice.sh absent cmd/rt/fork_pr_approval_notice.go present workflow calls the verb .forgejo/workflows/fork-pr-approval-notice.yml:53 "$RUNNER_TEMP/rt" fork-pr-approval-notice arms preserved as the oracle tests/fork-pr-approval-notice.bats still present ``` **The third AC — *"the notice text is unchanged"* — was the one worth actually measuring rather than eyeballing.** The notice body was extracted from the deleted script (at `0d79de63^`) and from `internal/forknotice`, normalised for `printf` `%s` vs Go concatenation, and byte-compared: ``` old 375 bytes new 376 bytes sole delta at byte 375: a trailing '}' from my own extraction control: mutating one word in the new copy DIFFERS -> the comparator is live ``` The prose is character-for-character identical. **Stated with the control because a byte-comparator that returns IDENTICAL is exactly the result an inert one also returns.** Swept by @bosun, 2026-09-05.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
frankenbit/release-toolkit#1113
No description provided.