Skip to content

Updater: Update pressed while the release check runs starts by itself; one press applies role changes - #496

Merged
nambok merged 5 commits into
mainfrom
update-press-while-checking
Nov 6, 2026
Merged

nambok merged 5 commits into
mainfrom
update-press-while-checking

Conversation

@nambok

@nambok nambok commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Pressing Update while a new release's signature and model check was still running showed a red error toast ("Checking vX's signature and the models it calls first; try Update now again in a few minutes."). The updater raised ModelsBlocked, the gateway turned it into a 400, and the dashboard showed it as an error, although nothing was wrong. Pressing again a few minutes later then worked, which is the "click Update twice" the owner saw.

Now the press is recorded and carried through: the update starts by itself once the check passes, exactly as if the admin pressed again.

Changes

  • lambda/updater/handler.py
    • update_now with a pending check records UPDATE_REQUEST (who, which version, when) and answers ok with state: "checking", the request and the check. A release still publishing, or whose template isn't verified yet (ReleaseNotReady), is recorded the same way instead of being refused.
    • follow_request carries a waiting press on whenever the check result arrives: confirm_check (after models_verified), the failed models_verified branch, model_check, status and the hourly tick. A passing check calls begin with the admin as the actor, so the update then applies or waits for the OK as usual. A failed or stalled check, a refused model or a refusal from begin ends the press with its reason (status: ended). A newer release, or another press, replaces the waiting press. A press whose check never ends is dropped after 2 hours.
    • Pressing Update again for the update already in progress answers with that update (state: "started"), never "an update is already running". Another version running is refused with a sentence that says what to do.
    • status returns update_request (while it waits, and for a day after it ended) for the dashboard card.
    • The scheduled window path is unchanged; a press and the window never start two updates.
  • services/gateway/src/routes/system.rs: an ok answer is a 200 whatever state it names. A refusal that is the install's state (the model check holds it, or the release isn't ready, waiting) is a 409 carrying that state; other refusals stay 400.
  • One decision per update (begin(consent=), consented, native_hold): the dashboard sends accept_permissions with Update, next to text saying one press includes changes to what CoderHelm's own roles may do. The updater records consent (who, when) on the update; a prepared change set whose only holds are permission_changes then applies at once, and confirmed records what the press agreed to. data_changes still stop for the confirm token of exactly those changes; admin_changes (deploy role, boundary) still go to an AWS admin; the maintenance window never carries a press's consent, so a scheduled update still holds for permission changes. The waiting press (UPDATE_REQUEST) keeps the consent.
  • services/gateway/src/routes/setup_checks.rs: the next release's check, running or stalled, is no longer an install check (it was a Warning with a How to fix linking to the same page); the update card shows it, and the preflight still holds the update. A refused model stays a failing check.
  • services/gateway/src/routes/system.rs: passes accept_permissions through.
  • docs/self-host/updates.md, troubleshooting.md: the one-decision flow; what pressing Update while the check runs does, and that a newer release is only mentioned while an update runs.

The dashboard side is CoderHelm/coderhelm#329 (merged as 3f185a6); selfhost/versions.json pins it (scripts/bump-dashboard.sh). Main (with #495) is merged into this branch, no force push.

Verification

  • python3 -m unittest discover -s lambda/tests: 371 tests pass. New PressDuringCheck class:
    • the press is recorded, not refused (state: "checking", actor, version, time, status shows it);
    • it starts by itself once CodeBuild confirms the check, from the tick and from status;
    • a refused model, and a failed signature check, end it with the reason;
    • a check that never ends drops it;
    • another press, and a newer release, replace it;
    • a press after the check passed starts at once;
    • the scheduled window is unchanged, and a press plus the window start one update.
    • Existing tests updated: pressing again while an update runs returns the same update; a press during the check answers checking instead of raising.
  • test_updater_native.py: a press that agreed applies a permission-only change set in one go and records it; the press never agrees to data changes or a role or boundary change; the window never carries it; update_now passes it on. 376 tests pass.
  • cargo test (gateway, 745 pass): the pending and stalled release check are no install check.
  • cargo fmt, cargo clippy --all-targets -- -D warnings and cargo test system:: on the gateway pass. New test: a recorded press is a 200; a waiting release and a model-check refusal are 409s with their state.

… once it passes

Pressing Update before the release's signature and model check finished
raised ModelsBlocked, the gateway turned it into a 400 and the dashboard
showed a red toast, although nothing was wrong. The updater now records the
press (who, which version, when) and answers state checking; when the check
passes (confirm_check, models_verified, model_check, status or the tick) it
carries on into begin as if the admin pressed again, and a failed check ends
the press with the check's reason. Another press or a newer release replaces
it; a press for the update in progress answers with that update. The gateway
answers the remaining state refusals (model check, release not ready) with a
409 that carries the state.
…an install check

The next release's release check, while it ran or after it stopped
without an answer, was listed under Install health as a Warning with a
How to fix and a link to the page it was on, repeating the update card.
It is now no install check at all: the Version card shows it, and the
preflight still holds the update. A model the release calls that is
refused stays a failing check.
…plies

An update that changed what CoderHelm's own roles may do took three
steps: Update, Review and apply, Confirm and apply. The dashboard now
says next to Update that one press includes those changes (always inside
the permissions boundary), and sends accept_permissions; the updater
records that consent on the update and applies a permission-only change
set as soon as it is prepared. Data changes still stop for an explicit
confirm of exactly those changes, a change to the deploy role or the
boundary still goes to an AWS admin, and the maintenance window never
carries a press's consent.
@nambok nambok changed the title Updater: Update pressed while the release check runs starts by itself, never an error Updater: Update pressed while the release check runs starts by itself; one press applies role changes Nov 6, 2026
@nambok
nambok merged commit f5ff4e1 into main Nov 6, 2026
10 checks passed
@nambok
nambok deleted the update-press-while-checking branch November 6, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant