[t-mmyx6d0xfp0x] fix: open a pull request when main is protected #1

Merged
dfritz merged 1 commits from dev/t-mmyx6d0xfp0x/protected-main-pr into main 2026-11-11 17:48:39 +00:00
Owner

What and why

Ticket t-mmyx6d0xfp0x (W9). cascade-from pushes the FROM bump straight to the target's main. fritzlab/runner, fritzlab/base-dev and fritzlab/base-agent protect main against every push (enable_push: false, no ci-bot allowlist), so the push is refused three times and the upstream release job fails:

  • base-dev release runs 20 (2026-08-24) and 22 (2026-10-16): Not allowed to push to protected branch main on fritzlab/runner. The base-agent step after it never ran, so base-agent stayed on base-dev:20 and the Agent image never got base:41's AgentHub Secrets hook.
  • base release run 41 (2026-09-26): the same refusal on fritzlab/base-dev (worked around by hand in base-dev#8).

fritzlab/agent allowlists ci-bot, so base-agent's cascade to it works and keeps working unchanged.

Change: when the push is refused for branch protection, push the commit to cascade/<name>-<tag> and open a pull request against main with the same title. A re-run reuses the branch and treats the 409 for an existing pull request as success. Any other API answer fails the step as before. The script moves out of action.yaml into cascade.sh (same pattern as action/check-naming) so it can be tested.

Tests

New tests/run (CI: .gitea/workflows/test.yaml, as in check-naming) drives cascade.sh against local bare repositories, with a pre-receive hook standing in for branch protection and tests/bin/curl for the Gitea API. Run inside fritzlab/base-dev:20 (the runner's toolchain):

  • after: 5 passed, 0 failed
  • before (same tests, original inline script): 2 passed, 3 failed (protected main gets a pull request, a re-run reuses the open pull request, a refused pull request fails the step)

Rollout

Consumers pin @v1, so this takes effect only when the v1 tag is moved to the merge commit (git tag -f v1 <sha> && git push -f origin v1). No consumer workflow changes. The next cascade into a protected repository then opens a pull request that goes through normal review.

The alternative is a forge setting, not code: allowlist ci-bot for direct pushes on runner, base-dev and base-agent the way fritzlab/agent and the playbooks new_protection default already do. That lets bumps land unreviewed; this PR keeps review.

🤖 Generated with Claude Code

## What and why Ticket t-mmyx6d0xfp0x (W9). `cascade-from` pushes the FROM bump straight to the target's `main`. fritzlab/runner, fritzlab/base-dev and fritzlab/base-agent protect `main` against every push (`enable_push: false`, no ci-bot allowlist), so the push is refused three times and the upstream release job fails: - base-dev release runs 20 (2026-08-24) and 22 (2026-10-16): `Not allowed to push to protected branch main` on fritzlab/runner. The base-agent step after it never ran, so base-agent stayed on base-dev:20 and the Agent image never got base:41's AgentHub Secrets hook. - base release run 41 (2026-09-26): the same refusal on fritzlab/base-dev (worked around by hand in base-dev#8). fritzlab/agent allowlists ci-bot, so base-agent's cascade to it works and keeps working unchanged. Change: when the push is refused for branch protection, push the commit to `cascade/<name>-<tag>` and open a pull request against `main` with the same title. A re-run reuses the branch and treats the 409 for an existing pull request as success. Any other API answer fails the step as before. The script moves out of `action.yaml` into `cascade.sh` (same pattern as action/check-naming) so it can be tested. ## Tests New `tests/run` (CI: `.gitea/workflows/test.yaml`, as in check-naming) drives `cascade.sh` against local bare repositories, with a pre-receive hook standing in for branch protection and `tests/bin/curl` for the Gitea API. Run inside `fritzlab/base-dev:20` (the runner's toolchain): - after: 5 passed, 0 failed - before (same tests, original inline script): 2 passed, 3 failed (`protected main gets a pull request`, `a re-run reuses the open pull request`, `a refused pull request fails the step`) ## Rollout Consumers pin `@v1`, so this takes effect only when the `v1` tag is moved to the merge commit (`git tag -f v1 <sha> && git push -f origin v1`). No consumer workflow changes. The next cascade into a protected repository then opens a pull request that goes through normal review. The alternative is a forge setting, not code: allowlist ci-bot for direct pushes on runner, base-dev and base-agent the way fritzlab/agent and the playbooks `new_protection` default already do. That lets bumps land unreviewed; this PR keeps review. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
dfritz added 1 commit 2026-11-10 17:33:42 +00:00
Every cascade from base and base-dev has failed since August: runner,
base-dev and base-agent protect main against all pushes, so the direct
push is refused three times and the release job fails, and a refused
first target also skips the next cascade step. Push the bump to
cascade/<name>-<tag> and open a pull request instead, so it lands
through the target's review. Targets that still allow ci-bot to push
(fritzlab/agent) keep the direct push.

The script moves out of action.yaml into cascade.sh so tests/run can
drive it against local bare repositories and a stubbed API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
architect approved these changes 2026-11-10 21:57:13 +00:00
architect left a comment
Owner

LGTM

Authored-By: Claude Code (Sonnet 5) noreply@anthropic.com

LGTM Authored-By: Claude Code (Sonnet 5) <noreply@anthropic.com>
security approved these changes 2026-11-10 21:58:27 +00:00
security left a comment
Member

LGTM

Authored-By: Claude (Sonnet 5) noreply@anthropic.com

LGTM Authored-By: Claude (Sonnet 5) <noreply@anthropic.com>
dfritz merged commit f8ea90faaa into main 2026-11-11 17:48:39 +00:00
Sign in to join this conversation.
No Reviewers
No labels
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: action/cascade-from#1