Repository navigation
feat(web): agent upgrades on the Servers page (part of #240) - #448
Merged
Merged
Conversation
Release versions with the agent's rules, the servers a rollout lists, and the pure decision for the server whose turn it is: send, wait, skip, move on, or stop with a reason (ADR 0028). Signed-off-by: samuel mbabhazi <[email protected]>
Signed-off-by: samuel mbabhazi <[email protected]>
One row per rollout, at most one running per organization (partial unique index), under forced row security. The runtime role reads, inserts and updates rollouts, and never deletes them. Signed-off-by: samuel mbabhazi <[email protected]>
A pg-boss queue runs each turn: it waits for an idle, connected server, sends UpgradeAgent with the release's digest and bundle, waits for the new version, and stops at the first failure. Every change is audited. Signed-off-by: samuel mbabhazi <[email protected]>
Signed-off-by: samuel mbabhazi <[email protected]>
A card shows how many agents run an older release than the control plane, the rollout in progress server by server, or where and why the last one stopped, and starts a rollout with the version it saw. Signed-off-by: samuel mbabhazi <[email protected]>
Signed-off-by: samuel mbabhazi <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 14 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Signed-off-by: samuel mbabhazi <[email protected]>
The start reads GitHub between two access checks, outside any transaction. A failed run is queued again after 60 s and the overview queues a running rollout, so none stays without a run. The integration test upgrades two servers in turn, behind an unfinished action. Signed-off-by: samuel mbabhazi <[email protected]>
…t/240-agent-upgrades-web
…es-web Signed-off-by: samuel mbabhazi <[email protected]> # Conflicts: # apps/api/openapi.json # apps/api/src/modules/fleet/domain/events.ts # packages/api-client/src/gen/openapi.ts
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 25, 2026
…ed (closes #480) (#502) ## What changed The evidence #480 asks for, for the replacement release `v0.1.0-alpha.5`. - **`docs/security/image-triage-2026-11.md`, new section "Rescan of the published v0.1.0-alpha.5 image".** - Trivy 0.70.0, database of 2026-11-25 13:07 UTC, linux/amd64 and linux/arm64, without the release gate's filters: 121 distinct advisories, 1 critical, 11 high, none with a fix, no secret. - One disposition per high or critical advisory, based on what the image actually loads (checked in the published image): - every service runs `node` as `node`; - `node` links only glibc and libstdc++, and bundles zlib 1.3.1 and zstd 1.5.7; - argon2 is the only native addon, and links none of the flagged packages; - the `migrate` shim runs `readlink`, `uname` and `sed` on its own path; - Node's bundled copies are checked against the same advisories. Its zstd 1.5.7 is affected by CVE-2026-124851, and the API reached it in alpha.5 through compressed request bodies. #503 removes that path. Its zlib 1.3.1 is in CVE-2026-85091's range, but Node does not use the `gz*` file functions where the flaw is (after CodeRabbit's review). - alpha.4 is named for what it is: same code, no image. - **`docs/security/scans/control-plane-v0.1.0-alpha.5.json`.** The findings per platform: id, severity, package, installed and fixed versions. It also records the manifest digests, the scan command and the database date, so the counts can be reproduced. - **`docs/INSTALL.md`.** - Status line and "What has been tested" for alpha.5: single-machine install, deployment, logs and metrics, backup and restore, and the upgrade from alpha.3 with a separate server. - Fixes the tests found: - step 3 lists the first question, "Run applications on this machine too?", and the organization; - without a terminal, `--single-machine` and `--organization` are needed, and `--smtp-from` and `--smtp-user` with SMTP. The documented `--domain --email` form stopped at "Answer yes or no."; #499 makes the installer say what is missing; - **Upgrade:** take the backup after `docker compose pull`, with the new bundle's `backup.sh`. Before that, an alpha.3 installation has neither the `backup` service nor `backup.js` ("no such service: backup"); - **Upgrade:** agent upgrades exist now (#447, #448). An alpha.3 agent makes the rollout stop with "not supported by this agent", and nothing changes on its server; - **Restore:** a deployment made after the backup makes the next deployment fail once (#501). - The bundle's provenance attestation is no longer "not tested": `gh attestation verify` passed. ## Why #480 asks for a replacement release after its checks, a rescan of the exact new digests on every architecture with reproducible results, and verification of startup, migrations, backups, Caddy routing, metrics and logs, and the documented upgrade path. ## How it was tested Everything in "What has been tested" was run on 25 November 2026, in fresh Ubuntu 24.04 containers with systemd: - the alpha.5 bundle downloaded and verified as the page says; - the installer through a real terminal; - the API flows over HTTPS; - the upgrade from the published alpha.3 bundle, with an alpha.3 server enrolled through the command and token copied from the Servers page. The scan JSON comes from the published image by digest. ## Security considerations No change to code or behavior. The scan file lists package versions only, and no lab secret appears in any document. Closes #480. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Documentation** * Updated prerelease installation, deployment, backup, restore, and upgrade guidance for alpha.5, including installer options and requirements for noninteractive and SMTP-configured setups. * Clarified restore behavior for deployments created after a backup, agent upgrade procedures, and compatibility limitations. * Expanded alpha.5 security guidance with platform-specific scan results and details on compressed request handling. * Updated testing results and clarified which upgrade scenarios have been tested. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: samuel mbabhazi <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
Part of #240, step 1c of ADR 0028: the web side of the agent rollout. It is stacked on #447, which adds
GETandPOST /organizations/{organizationId}/agent-upgrades. UI change: waiting for the maintainer's visual validation before merge.Captures, desktop and phone, English and French: https://claude.ai/artifact/D18ej9YP9bVKXj7xWXr5mw
What changed
A card on the Servers page (
sk-agent-upgrades), above the servers table, shown only when there is something to say:action_failed, the agent's own reason label from the action history is added. The pills show where the rollout stopped, and the button comes back.{version}, the version the overview gave. Every refusal code of feat(api): roll agent upgrades out, one server at a time (part of #240) #447 gets its own sentence, in English and French; any other failure uses the page's usual message.Smaller parts:
FleetApi.agentUpgradesandFleetApi.startAgentUpgrade.actionReasonLabel, exported from the action history's labels. It picks up theupgrade_*reasons of feat(api): the agent version from each Hello, and why an upgrade was refused (part of #240) #445 once that merges.Why
ADR 0028 section 2: "The UI shows the version of each agent and offers the upgrade once a release is newer." The servers table already shows each agent's version; this card offers the upgrade and follows it.
How it was tested
agent-upgrade-view.spec.ts: every state, names falling back to ids, a stale failure hidden once nothing waits, a French sentence for every stop reason and every refusal code.agent-upgrades.spec.ts:servers-page.spec.ts: the card on the real page, and its POST.pnpm nx run-many -t lint,typecheck,test -p web apipasses (331 web tests), and so doespnpm format:check.vitest.browser.config.mts, Chromium, production build, PostgreSQL): 28 tests pass, including the new one. The card shows up, axe finds nothing, the POST answers 202 with{version}, the card turns into the rollout, and the console stays clean.agent_upgradesrow in each state, with no console error and Outfit loaded. They are in the page linked above.Security considerations
node.manage, and the API checks it again.[style.background]bindings, which go through the CSSOM.