Skip to content

feat(web): agent upgrades on the Servers page (part of #240) - #448

Merged
samuelmbabhazi merged 11 commits into
mainfrom
feat/240-agent-upgrades-web
Nov 24, 2026
Merged

samuelmbabhazi merged 11 commits into
mainfrom
feat/240-agent-upgrades-web

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

Task

Part of #240, step 1c of ADR 0028: the web side of the agent rollout. It is stacked on #447, which adds GET and POST /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:

  • Development build (no version), or every agent already on the control plane's version: nothing. The page looks as it does today.
  • Agents to upgrade: "N servers run an older agent than the control plane, X", an Upgrade agents button, and a note on what happens: one server at a time, the signature checked, applications kept running.
  • Rollout running: "server n of N, name", then one pill per server in turn order: upgraded, upgrading, waiting.
    • The card reads the overview again every 5 seconds while the rollout runs.
    • It stops when the rollout ends, or when the page goes away.
    • When the rollout ends, it refreshes the servers table, whose versions changed.
  • Rollout stopped, with servers still waiting: an alert naming the server, with one sentence per reason. For 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.
  • The button sends {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:

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

  • Unit:
    • 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:
      • hidden on a development build;
      • the POST carries the version;
      • polling every 5 seconds and stopping when the rollout ends or the page is destroyed;
      • the stopped state;
      • a refused start explained in French;
      • no rollout of one organization shown under another.
    • servers-page.spec.ts: the card on the real page, and its POST.
  • Checks: pnpm nx run-many -t lint,typecheck,test -p web api passes (331 web tests), and so does pnpm format:check.
  • Browser (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.
  • Captures: the real app in Chromium, seeded with three servers and an agent_upgrades row in each state, with no console error and Outfit loaded. They are in the page linked above.

Security considerations

  • The page is behind node.manage, and the API checks it again.
  • The card shows ids, names, versions and fixed sentences only: nothing the agent sent is repeated, since reasons are codes mapped to fixed labels.
  • No inline style: the dot colors are [style.background] bindings, which go through the CSSOM.

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]>
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]>
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]>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5a2fa8b and 8506aeb.

Files selected for processing: 11

  • apps/api/src/testing/browser-app.ts
  • apps/api/src/testing/tenant.browser.spec.ts
  • apps/web/src/app/delivery/agent-action-rows.ts
  • apps/web/src/app/fleet/agent-upgrade-view.spec.ts
  • apps/web/src/app/fleet/agent-upgrade-view.ts
  • apps/web/src/app/fleet/agent-upgrades.spec.ts
  • apps/web/src/app/fleet/agent-upgrades.ts
  • apps/web/src/app/fleet/fleet-api.ts
  • apps/web/src/app/fleet/servers-page.spec.ts
  • apps/web/src/app/fleet/servers-page.ts
  • apps/web/src/app/ui/fr.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

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]>
@samuelmbabhazi
samuelmbabhazi changed the base branch from feat/240-agent-rollout to main November 24, 2026 11:41
…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
samuelmbabhazi merged commit b226a19 into main Nov 24, 2026
25 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the feat/240-agent-upgrades-web branch November 24, 2026 11:58
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]>
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