Skip to content

Move the examples to SDK v0.4.0 and the released-revision vocabulary - #212

Merged
bgrant0607 merged 3 commits into
mainfrom
last-released-revision-num
Aug 27, 2026
Merged

Move the examples to SDK v0.4.0 and the released-revision vocabulary#212
bgrant0607 merged 3 commits into
mainfrom
last-released-revision-num

Conversation

@bgrant0607

@bgrant0607 bgrant0607 commented Aug 27, 2026

Copy link
Copy Markdown
Member

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.

A behavior fix, not just a rename

managerkit's UnitMeta.Unapplied() compared against LiveRevisionNum. No bridge has advanced that field since the bridge sunset, so it was zero on every Unit — which means the predicate returned true for all of them, and every manager's "unapplied units" count was really "all units."

It is now Unreleased(), comparing against LastReleasedRevisionNum, 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 UnappliedUnits counter to UnreleasedUnits, and the JSON key unappliedUnits to unreleasedUnits. Anything parsing that output by key needs the new one.

What changed

managerkit — the Unit select drops LiveRevisionNum and asks for LastReleasedRevisionNum; UnitMeta.LiveRevisionNum is removed and LastAppliedRevisionNum renamed along with its JSON key; Unapplied()Unreleased().

A field UnitMeta reads but does not select comes back zero with nothing to indicate it was never fetched, so TestUnitSelectCoversUnitMeta is the guard that keeps the select and the struct in step — it is updated with them.

The eight managersUnreleased() at the call sites, their counters, JSON keys, and the human-readable %d gated, %d unreleased summary lines.

eks-manager — also used the field directly, in plan.go and replace.go, in the --other-data-source guardrail 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 --noEmit clean, 29 + 298 + 166 tests pass, lint clean, fleet-ql and configboard build (webkit has no build script; it is consumed through a file: link).

Three 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, 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.

  • Revision.LeadTimeHours was LiveAt − CreatedAt. It is removed, but not because the data is goneRelease carries CreatedAt, so publish time is recorded. It is not reachable from a Revision row: Revision.Releases holds ReleaseIDs and no timestamps. The two delivery-health panels built on it go with it, and restoring them needs a Release source configboard does not have:

    • "Releases per day" would be that source alone, binned by Release.CreatedAt — a new source, no join.
    • Lead time needs 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.ApplyStateUnit.ReleaseState (values Never released / Unreleased changes / Released and current), which three bundled dashboards group by. fleet-ql's query language drops the liveRevisionNum column and the symbolic revision = 'live' selector — both named a field that no longer exists — in favour of lastReleasedRevisionNum and revision = 'released'.

How Revision.LiveAt was 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's node_modules to 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, gofmt clean.

🤖 Generated with Claude Code

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
@bgrant0607 bgrant0607 changed the title Move the Go managers to SDK v0.4.0 and the released-revision vocabulary Move the examples to SDK v0.4.0 and the released-revision vocabulary Aug 27, 2026
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
bgrant0607 force-pushed the last-released-revision-num branch from 03470bd to aa55470 Compare August 27, 2026 04:37
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
@bgrant0607
bgrant0607 merged commit 1344060 into main Aug 27, 2026
7 checks passed
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