Repository navigation
Record and expose per-resource history - #9
Merged
Merged
Conversation
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.
Increment 2 of the observability work: a persistent per-resource history, so you
can see when each resource synced, drifted, was applied or failed, and from which
commit.
Stacked on #8 (Git commit) — base this on that branch; merge #8 first.
What it does
resource_eventstable in SQLite (kind, name, type, reason, commit_, at) withAppendEvent/EventsFor.drifted,synced,removed) bycomparing the previous snapshot, tagged with the pass commit. A resource
already in sync on boot is not logged (avoids a synced burst).
applied/failedwhen an action finishes; theActioncarries the commit set at plan time so events attribute correctly.EventSink), nil-safe; theplancommand records nothing.GET /api/v1/resources/{kind}/{name}/events(newest first).(event, reason, short commit, relative time), colour-dotted by type.
Tests
(drifted with reason/commit/timestamp), read back through the store.
golangci-lint (v2) clean, gofmt clean, Go + vitest suites green.
Next (increment 3)
Daemon logs in the UI via an in-memory ring buffer over SSE.