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
44 changes: 44 additions & 0 deletions .github/workflows/block-test-promotion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Block test-branch promotion

# updates-test.simplerisk.com and updates.simplerisk.com are NOT meant to
# converge. They differ on purpose:
# - the testing pipeline retracts unpromoted RCs, keeps their upgrade hops, and
# blanks bundle_sha256 for bundles the test channel no longer serves;
# - the prod feed has a single writer (update_feeds.sh in sync_code_repo.yml)
# that records the real GA asset hashes.
# Merging the test branch into prod therefore replaces GA truth with RC truth.
# That happened on 2026-08-21 (#140, fixed by #141) and was attempted again in
# #144; simplerisk/docker fails closed on the resulting checksum mismatch.
#
# Validate feed catches some of the damage after the fact. This refuses the
# promotion path itself. To change the prod feed by hand (VM digests, a fix),
# use a topic branch off updates.simplerisk.com, as #139 and #145 did.
#
# Make this a REQUIRED status check on the prod ruleset only. It only runs on PRs
# into prod, so it must not be required on the test branch. Admins can still
# bypass a required check; that is a deliberate act, not an accident.

on:
pull_request:
branches: [updates.simplerisk.com]

permissions:
contents: read

jobs:
block_test_promotion:
name: Block test-branch promotion into prod
runs-on: ubuntu-latest
steps:
- name: Refuse a head branch that is the test feed
env:
HEAD_REF: ${{ github.head_ref }}
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
BASE_REPO: ${{ github.repository }}
run: |
set -euo pipefail
if [ "$HEAD_REPO" = "$BASE_REPO" ] && [ "$HEAD_REF" = "updates-test.simplerisk.com" ]; then
echo "::error title=Do not promote the test feed::This PR merges updates-test.simplerisk.com into the prod feed, which would overwrite GA bundle checksums and add upgrade hops for RCs that never shipped. Open a topic branch off updates.simplerisk.com containing only the change you need (see README.md)."
exit 1
fi
echo "head '$HEAD_REF' is not the test feed branch"
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# updates.simplerisk.com

Two long-lived branches, one per update channel:

| Branch | Channel | Written by |
|---|---|---|
| `updates.simplerisk.com` | GA (prod) | `update_feeds.sh` in `sync_code_repo.yml`, with the real GA asset hashes |
| `updates-test.simplerisk.com` | testing | `update_feeds.sh` in `publish-bundle.yml`, plus the RC retraction step |

**The branches are not meant to converge. Do not merge one into the other.**
They differ on purpose: the test feed keeps hops for withdrawn RCs and blanks
checksums for bundles `bundles-test` no longer serves, while prod records real GA
hashes. Merging `updates-test` into prod overwrites GA truth with RC truth, and
`simplerisk/docker` fails closed on the resulting checksum mismatch. The
`Block test-branch promotion` check refuses that PR.

## Making a change to the prod feed by hand

For one-off changes such as VM appliance digests:

1. Branch off `updates.simplerisk.com`.
2. Change only the values you mean to (for VM digests, the four
`virtualbox_*` / `vmware_*` values of that release).
3. `python3 scripts/validate_feed.py prod`
4. Open a PR into `updates.simplerisk.com`. `Validate feed against its channel`
must pass.

If the same values belong on the test feed, make a separate change there. See #139
and #145 for worked examples.
Loading