Repository navigation
feat(apps): deliver proxy host lifecycle events to covered apps - #602
Closed
RentnerKev wants to merge 3 commits into
Closed
RentnerKev wants to merge 3 commits into
RentnerKev wants to merge 3 commits into
Conversation
Every platform write path now records exactly one event per change for each installation whose published read or probe grant covers the host, in the transaction that makes the change: proxyHostCreated, proxyHostUpdated, proxyHostEnabled, proxyHostDisabled and proxyHostRemoved. A save that changes nothing records nothing. The central create, update and delete helpers record the events, so the host form, Docker discovery, imports, certificate job creation and app-owned hosts are covered. The paths that write hosts directly do too: enable and disable, bulk actions, certificate job requests and bindings, certificate deletion and trusted CA replacement, which changes the probe revision of the hosts that verify against it. An app that changes its own host through an owned-host operation keeps receiving only its operation event. Replay lets a grant for all proxy hosts see the events of every host. Refs #591 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Move the event log writes into event-log.server.ts and let the change check take stored rows, so certificate and admin write paths do not load the runtime authority or the proxy host mutation helpers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
5 of 13 tasks
Member
Author
|
Replaced by #603: the same change as one commit, without the test UUID that Gitleaks flagged as a key in this branch's history. |
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.
Summary
PR 2 of 2 for #591, stacked on #601. Apps now receive durable host lifecycle events for changes from every platform write path, on the existing event stream with cursors.
Events (
server/AppRuntime/host-events.server.ts)proxyHostCreated,proxyHostUpdated,proxyHostEnabled,proxyHostDisabledandproxyHostRemoved, with the platform host ID asresourceId.recordProxyHostEventsInTransactionruns in the transaction that makes the change. For every installation whose published read or probe grant covers the host, it records one event per change, so an event exists exactly when the change commits.proxyHostChangedecides the event type from the stored settings before and after:proxyHostUpdatedwhen anything the listing reflects besides the enabled state changed;Write paths
proxyHostChanged/proxyHostRemoved), never a second one for the same change.Replay
Related issue
Closes #591 together with #601 (merge #601 first).
Refs RentnerProxy/app-monitoring#1
Type of change
Testing
bun run typecheckandbun run lintare clean; the changed files are formatted.test:tson Windows: 2272 passed. The 41 failures are thetests/toolingDocker, release and backup script tests that fail the same way onmainin this environment; CI runs them on Linux.host-events.test.ts: a save without a change records nothing; an enabled transition alone is reported as such; any other change, also with an enabled transition, is one update.proxy-hosts.db.test.ts: the host form records the following events, in this order, for an app with all proxy hosts: create, an unchanged save (no event), an update, disable, enable, a bulk disable, delete. An app with a per-host probe grant gets the changes after its grant, and an app without one gets nothing. Replay from a cursor continues after it without repeating an event.trusted-cas.db.test.ts: replacing a CA records one update for the host that verifies against it, and none for the other host.certificates.db.test.ts: deleting a certificate records one update for each detached proxy host.certificate-jobs-worker.db.test.ts: binding an issued certificate records one update.host-events.db.test.ts: the acting installation is left out; read wins over probe with one event per change and app; a rolled-back change leaves no event.host-operations.db.test.ts,proxy-host-listing.db.test.ts,authority.db.test.tsandcertificate-jobs-creation.db.test.tsstill pass.Checklist
Breaking changes
None. Apps without a read or probe grant see no new events.
🤖 Generated with Claude Code