Repository navigation
Conversation
8ce9046 to
b485525
Compare
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
Add a leaf package that maps a live object to a health tier: paused (the crossplane.io/paused annotation, overriding conditions), failing (Synced=False), notReady (Ready=False) or healthy, carrying the Synced and Ready conditions it was classified from. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
Record the health of each XR's live object and of the composed resources the diff engine already fetched to render it, on XRDiffGroup and XRImpact. No new cluster reads: the XR comes from the resolved composite's cluster copy, and composed resources from the observed resources render consumes, before --eventual-state synthesizes any Ready condition. A nested XR's observed resources merge into its parent's once, keyed by identity. DiffSingleResource now returns the RenderedResources it built, so the composition path gets health along with the unchanged renderings. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
Each plan with a live object carries its health; each composite carries the health of its live XR and lists the not-healthy composed resources that have no plan of their own. The summary counts unhealthy composites and failing, notReady and paused resources, each once. Bump the result format version to 0.2 and document the new fields. Text and diff output are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
…health once A claim mirrors only part of its backing XR's conditions, so the composite health of a claim input is now its backing XR's. RenderedResources classifies health as it records the live objects instead of retaining them. Merge now records each nested composite's health, with the nested composite as the via of what it composes directly, so every composed resource is listed once with the composite that composes it. That also covers a nested XR found by name rather than in its parent's observed set, which previously lost its health when it had no plan. The comp path stores each XR's computed health rather than its render. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
…ummary health Each unhealthy entry names the nested composite that composes it under via. The health counts move under summary.health, and a composite in two entries is counted once. The help documents via, summary.health, a claim's health, and that a composite that was not simulated has no health. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
PR 1 reports each composite's live health, so the project simulate integration cases now see Health: healthy on every composite. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
A composition run gives a nested composite of the diffed composition's type an entry of its own, now marked composedBy. Its parent's health also lists it and what it composes, so each of those appeared in two unhealthy lists. A nested composite with an entry and health of its own now shows its health there and lists what it composes itself; its parent lists neither. One whose entry has no health, because it wasn't simulated, stays listed under its parent and counts there as a resource. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
355e2c8 to
a1a5d40
Compare
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
@coderabbitai Thanks for the review. Two follow-ups on the Breaking Changes and Feature Gate notes:
Posted by an AI agent (Claude Code) acting on behalf of @jcogilvie. |
|
Tip For best results, initiate chat on the files or code changes. Analysis chain
Consumers that ignore the new fields must also accept the The alpha status is consistent with the existing command-maturity guidance. The schema is also described as alpha in Learnings added
Learnings used
You are interacting with an AI system. |
Description of your changes
First of three stacked PRs for #539:
crossplane {xr,composition,project} simulateshowed only the spec diff, so an XR whose composed resources were all failing looked like a harmless small change. This PR reads the current health of the XR and its composed resources from the live objects simulate already fetches, and adds it to the-o json|yamlresult. Text and-o diffoutput and the exit codes are unchanged here; they come in the next PR.feat(health). A new leaf package,internal/health, classifies a live object from its conditions:paused: carriescrossplane.io/paused: "true", whatever its conditions.failing: Synced=False.notReady: Ready=False.healthy: anything else, including objects with no Synced or Ready condition, such as a ConfigMap.It has no dependency on
internal/diff,internal/planorinternal/simulate, so all three can use it, and so can resource simulate later.feat(diff)/fix(diff).XRDiffGroupandXRImpactcarry aCompositeHealth: the XR's health, plus the health of every composed resource in the observed set the engine already fetches, unchanged ones included. There are no new cluster reads.Via.--eventual-statesynthesizes between renders.DiffSingleResourcenow returns theRenderedResourcesinstead of the bare unchanged map.XRDiffResultkeeps only the unchanged map and the health, not the observed objects.feat(simulate). The structured result gains:health(stateplus thesyncedandreadyconditions) on each plan and each composite.composites[].unhealthy[], listing non-healthy composed resources that have no plan of their own. Each is listed once, withvianaming the nested XR that composes it.summary.health(unhealthyComposites,failing,notReady,paused).formatVersiongoes from0.1to0.2, andhelp/output.mddocuments the new fields.Points for review:
notReady) to match the other machine-output enums (webhookUnavailable,manualPolicy,missingSchema).via. In composition simulate a nested XR can have its own entry (since Improve nested-XR output in simulate #541), and then it carries its ownhealthandunhealthylist, and counts inunhealthyComposites. A nested XR whose entry has no health (it errored, or was skipped or deferred) stays under its parent and counts as a resource.Stack (#539):
-o diffrendering, the always-on exit bit 4 for failing resources (exit 3 = changes, 4 = failing, 7 = both) and--full-messages, for xr/composition/project simulate.crossplane resource simulate.I have:
RunRan./nix.sh flake checkto ensure this PR is ready for review.go build,go vet,go test ./internal/... ./cmd/...(with envtest) andgolangci-lint run ./...(with and without the integration tag) instead.Linked a PR or a docs tracking issue to document this change.The output help (internal/simulate/help/output.md) is updated in this PR.AddedNot a backport candidate.backport release-x.ylabels to auto-backport this PR.Need help with this checklist? See the cheat sheet.
🤖 Generated with Claude Code