Repository navigation
[M2.6b] Live updates per environment - #179
Merged
Merged
Conversation
added 3 commits
November 7, 2026 13:26
GET …/environments/{id}/events follows audit_events rather than the
event bus, which publishes before commit. Each change event carries
identifiers only. Session and permission are rechecked on every poll,
streams are bounded per account and in lifetime, and shutdown ends them.
Signed-off-by: review <[email protected]>
The application page reloads its deployments when an event names it, falling back to a slower poll while connected and the usual one if the stream is unavailable. Signed-off-by: review <[email protected]>
Signed-off-by: review <[email protected]>
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 7, 2026
## What changed M1.6b3: what agents report (#175) is now visible. - **`GET …/applications/{a}/replicas`** (`environment.read`) lists placed replicas with node name, container and the last observed state (null until seen). - **Application page:** a Replicas table, with "not reported yet" for a container the agent has not seen. It reloads with deployments. - **`allocation.observed`** events now carry `environmentId`, so the live stream of #179 includes them and the page updates when a container stops. ## How it was tested - Web test for the table. Full local gate: 302 API and 69 web tests, Go race tests, lint, drift, Semgrep, Prettier. - **Not run:** the integration assertion added to `allocation-observations.integration.spec.ts`, because Docker is not reachable here. ## Security considerations Same read permission as the other application routes. It reveals node names and container names to `environment.read` holders, and no environment values. --------- Signed-off-by: review <[email protected]> Co-authored-by: review <[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.
What changed
M2.6b: live updates per environment.
GET …/environments/{e}/eventsis a server-sent event stream (environment.read, sessions or scoped tokens).audit_events, not the in-process bus, which publishes before commit and could announce a rolled-back change.changeevent per committed audit event of the environment: type, target, application and time. No metadata. Clients reload through the normal API, so nothing bypasses its authorization.Last-Event-ID, validated as a UUID.Accept: text/event-streamanswers 406, so nothing hangs on it by accident. The route-role matrix uses this to test the route's guards.LiveEventswrapsEventSource. The application page reloads its deployments when an event names it, and keeps a 15 s poll while connected, or the usual 3 s otherwise./api/v1/eventsis replaced by this per-environment route, which has one clear permission. Organization-wide events are not streamed.How it was tested
EventSource: reloads only for its own application, closes on leaving.Known limit
A transaction committing late can carry an older id than the stream's cursor, so an event can be missed. Events are only hints, and the slow poll covers this.
Security considerations
environment.readalready see these resources.