Move the examples to SDK v0.4.0 and the released-revision vocabulary - #212
Merged
Conversation
SDK v0.4.0 renames Unit.LastAppliedRevisionNum to LastReleasedRevisionNum and removes Unit.LiveRevisionNum, Unit.PreviousLiveRevisionNum, and Revision.LiveAt. Publishing a Release is what advances the surviving pointer, so the name now says so. managerkit is the substantive change, since every manager reads its UnitMeta: - The Unit select drops LiveRevisionNum and asks for LastReleasedRevisionNum. A field UnitMeta reads but does not select comes back zero with nothing to say it was never fetched, which TestUnitSelectCoversUnitMeta guards. - UnitMeta.LiveRevisionNum is gone; LastAppliedRevisionNum is renamed, and its JSON key with it. - Unapplied() becomes Unreleased() -- and this is a behavior fix, not just a rename. It compared against LiveRevisionNum, which no bridge has advanced since the bridge sunset, so it was zero on every Unit and the predicate returned true for all of them. It now compares against LastReleasedRevisionNum, which is what the question was always asking. The eight managers follow: Unreleased() at the call sites, and their own UnreleasedUnits counters and unreleasedUnits JSON keys. Anything parsing that output by key needs the new one. eks-manager also carried the field directly, in its plan and replace paths and in the comment explaining why a disruption baseline reads this pointer rather than the live one -- a distinction that no longer needs drawing. The TypeScript examples are not in this change. They read the API through @confighub/api, whose published schema still carries the old names, so they move when that package does. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016s3Jj8PRGDi7rtDjNsCHzS
The v0.4.0 API renames Unit.LastAppliedRevisionNum to LastReleasedRevisionNum and removes Unit.LiveRevisionNum, Revision.LiveAt, and Space.IncompleteApplyUnitCount. Space.UnappliedUnitCount is now UnreleasedUnitCount. Two things had no replacement and are removed rather than repointed: - Space.IncompleteApplyUnitCount counted Units mid-apply, which is not a state a Unit can be in now. configboard's dimension and tile are gone. - Revision.LiveAt recorded when a bridge put a revision on a cluster. Nothing records that. Revision.Landed, which was derived from it, becomes Revision.Released, read from Revision.Releases -- a claim about publication rather than about what a cluster is running, which is the weaker claim ConfigHub can actually support. The two delivery-health panels built on Revision.LiveAt -- "Deploy lead time" and "Applies landed per day" -- are removed here, but not because the data is gone. Release carries CreatedAt, so publish time is recorded; it just is not reachable from a Revision row, since Revision.Releases holds ReleaseIDs and no timestamps. Restoring them needs a Release source configboard does not have: - "Releases per day" would be that source alone, binned by Release.CreatedAt. - Lead time needs Release.CreatedAt minus Revision.CreatedAt, which is a join across two sources, and a query here names exactly one. Both are worth doing and neither belongs in a rename sweep. The dashboard's other four panels stand. configboard's Unit.ApplyState becomes Unit.ReleaseState, and its values move from Never applied / Unapplied changes / Applied and current to the released equivalents. Three bundled dashboards group by it. fleet-ql's query language drops the `liveRevisionNum` column and the symbolic `revision = 'live'` selector, which named a field that no longer exists; `lastReleasedRevisionNum` and `revision = 'released'` replace them. Verified by building the v0.4.0 clients from the js-sdk branch and type-checking all three apps against them: tsc clean, 166 + 298 + 29 tests pass. The apps still declare @confighub/api ^0.1.2, so this needs the package published with a v0.4.0 spec before it can merge. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016s3Jj8PRGDi7rtDjNsCHzS
bgrant0607
force-pushed
the
last-released-revision-num
branch
from
August 27, 2026 04:37
03470bd to
aa55470
Compare
0.1.3 is the first release carrying the v0.4.0 spec, so it is what the previous commit's field names need. The ranges were ^0.1.2, which admits 0.1.3 already; naming it means a fresh install cannot resolve back to a package whose types still declare the removed fields. Re-verified against the published package rather than a local build: tsc clean and 29 + 298 + 166 tests pass on all three apps, lint clean, and fleet-ql and configboard build. webkit has no build script -- it is consumed through a file: link. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016s3Jj8PRGDi7rtDjNsCHzS
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.
SDK v0.4.0 renames
Unit.LastAppliedRevisionNumtoLastReleasedRevisionNumand removesUnit.LiveRevisionNum,Unit.PreviousLiveRevisionNum, andRevision.LiveAt. Publishing a Release is what advances the surviving pointer, so the name now says so.A behavior fix, not just a rename
managerkit'sUnitMeta.Unapplied()compared againstLiveRevisionNum. No bridge has advanced that field since the bridge sunset, so it was zero on every Unit — which means the predicate returnedtruefor all of them, and every manager's "unapplied units" count was really "all units."It is now
Unreleased(), comparing againstLastReleasedRevisionNum, which is what the question was always asking. Expect these tools' counts to drop to something meaningful.Breaking output change
Each of the eight managers renames its
UnappliedUnitscounter toUnreleasedUnits, and the JSON keyunappliedUnitstounreleasedUnits. Anything parsing that output by key needs the new one.What changed
managerkit— the Unit select dropsLiveRevisionNumand asks forLastReleasedRevisionNum;UnitMeta.LiveRevisionNumis removed andLastAppliedRevisionNumrenamed along with its JSON key;Unapplied()→Unreleased().A field
UnitMetareads but does not select comes back zero with nothing to indicate it was never fetched, soTestUnitSelectCoversUnitMetais the guard that keeps the select and the struct in step — it is updated with them.The eight managers —
Unreleased()at the call sites, their counters, JSON keys, and the human-readable%d gated, %d unreleasedsummary lines.eks-manager— also used the field directly, inplan.goandreplace.go, in the--other-data-sourceguardrail examples, and in the comment explaining why a disruption baseline reads this pointer rather than the live one. That distinction no longer needs drawing, so the comment is shorter.All nine modules move to
github.com/confighub/sdk/core v0.4.0.The TypeScript examples (
03470bd)Unblocked.
@confighub/{api,rtk-query,react-auth}0.1.3 is published and is the first release carrying the v0.4.0 spec; the three apps now take it explicitly. Re-verified against the published package rather than a local build —tsc --noEmitclean, 29 + 298 + 166 tests pass, lint clean, fleet-ql and configboard build (webkit has no build script; it is consumed through afile:link).Three things had no replacement and are removed rather than repointed:
Space.IncompleteApplyUnitCountcounted Units mid-apply, which is not a state a Unit can be in now. configboard's dimension and tile are gone.Revision.LiveAtrecorded when a bridge put a revision on a cluster; nothing records that.Revision.Landed, derived from it, becomesRevision.Releasedread fromRevision.Releases— a claim about publication rather than about what a cluster is running, which is the weaker claim ConfigHub can actually support.Revision.LeadTimeHourswasLiveAt − CreatedAt. It is removed, but not because the data is gone —ReleasecarriesCreatedAt, so publish time is recorded. It is not reachable from a Revision row:Revision.Releasesholds ReleaseIDs and no timestamps. The twodelivery-healthpanels built on it go with it, and restoring them needs aReleasesource configboard does not have:Release.CreatedAt— a new source, no join.Release.CreatedAt − Revision.CreatedAt, a join across two sources, and a configboard query names exactly one. That is an architectural change, not a new source.Neither belongs in a rename sweep, and per maintainer direction no new configboard charts are being added right now, so both stay removed. The dashboard's other four panels stand.
Renames: configboard's
Unit.ApplyState→Unit.ReleaseState(valuesNever released/Unreleased changes/Released and current), which three bundled dashboards group by. fleet-ql's query language drops theliveRevisionNumcolumn and the symbolicrevision = 'live'selector — both named a field that no longer exists — in favour oflastReleasedRevisionNumandrevision = 'released'.How
Revision.LiveAtwas found. It did not appear in the original grep. Before the package was published I built the v0.4.0 clients from the js-sdk branch and overlaid them into each app'snode_modulesto type-check against the real shapes; that surfaced it. The final verification above is against the published 0.1.3.Verification
All nine Go modules:
go build ./...clean,go test ./...green,gofmtclean.🤖 Generated with Claude Code