Feat: add observedGeneration; simplify conditions#416
Conversation
pdettori
left a comment
There was a problem hiding this comment.
LGTM — clean status simplification. All 15/16 checks pass; the failing E2E (should populate linkedSkills from annotation) is a pre-existing flaky test that also fails on main (run 27172754436, Jun 8) due to missing authbridge-config data in the skill-discovery namespace.
Two minor suggestions below (non-blocking).
| updated := &agentv1alpha1.AgentRuntime{} | ||
| Expect(k8sClient.Get(ctx, nn, updated)).To(Succeed()) | ||
| Expect(updated.Status.ObservedGeneration).To(Equal(updated.Generation)) | ||
| }) |
There was a problem hiding this comment.
nit: ~180 lines of CardFetched/SkillsDiscovered tests correctly removed. Consider adding a small test that verifies Ready=False is set when applyWorkloadConfig returns an error (the ConfigApplyError path) — this error path is currently untested and interacts with the TargetResolved relocation above.
Addressing review feedback from @pdettori1. TargetResolved semantics (controller.go:243)Agreed — moved Fixed in 6be4120. 2. ConfigApplyError test coverage (controller_test.go:235)Good point. The |
0cb654f to
6be4120
Compare
|
@r3v5 CI has been fixed - please rebase from upstream main / resolve conflicts and force push so we can check now with full CI |
Tracks the most recent metadata.generation processed by the controller, enabling clients to detect stale status via generation skew. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Ian Miller <milleryan2003@gmail.com>
Phase (Pending/Active/Error) was redundant with conditions. Clients should use Ready condition and observedGeneration instead. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Ian Miller <milleryan2003@gmail.com>
These fine-grained conditions added noise without actionable signal. Card fetch and skill discovery status is still observable via status.card and status.linkedSkills fields respectively. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Ian Miller <milleryan2003@gmail.com>
…er column TargetResolved=True now set after applyWorkloadConfig succeeds, not merely after resolveTargetRef. Replaces the CardFetched printer column with Ready for a cleaner `kubectl get agentruntime` output. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Ian Miller <milleryan2003@gmail.com>
…nup) - api-reference.md: add observedGeneration, remove phase, remove SkillsDiscovered condition, update kubectl examples - GETTING_STARTED.md: replace PHASE column with READY - test/e2e/README.md: update scenario descriptions for new status shape - test/e2e/e2e_test.go: replace Phase assertions with Ready/TargetResolved condition checks Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Ian Miller <milleryan2003@gmail.com>
The skill discovery e2e test could observe Ready=True from a reconcile that ran before the controller restarted with skillDiscovery enabled, causing linkedSkills to appear empty. Combining both assertions in a single Eventually block ensures the test waits for a reconcile that reflects the enabled feature gate. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Ian Miller <milleryan2003@gmail.com>
Moves TargetResolved=True back to immediately after resolveTargetRef succeeds, preserving the clear semantic: "I found the deployment." The Ready condition gates the full success path. Addresses review feedback from @pdettori. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Ian Miller <milleryan2003@gmail.com>
Uses an updateFailClient wrapper to simulate Deployment update failures, verifying that Ready=False with reason ConfigApplyError is set when applyWorkloadConfig fails. Addresses review feedback from @pdettori. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Ian Miller <milleryan2003@gmail.com>
Main added SCC RoleBinding error path and skill status update code that still referenced removed symbols (setPhase, RuntimePhaseError, ConditionTypeSkillsDiscovered). Aligned with status simplification. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Ian Miller <milleryan2003@gmail.com>
a415f84 to
bb9b9d2
Compare
Summary
Implements RHAIENG-4938: simplify AgentRuntime status by adding
observedGenerationand removing redundant fields/conditions.status.observedGeneration— tracks the most recentmetadata.generationprocessed by the controllerstatus.phase(Pending/Active/Error) — redundant withReadyconditionCardFetchedandSkillsDiscoveredconditions — card/skill status is observable viastatus.cardandstatus.linkedSkillsfieldsTargetResolved=Trueto afterapplyWorkloadConfigsucceeds (not just after resolveTargetRef)Phaseprinter column withReady—kubectl get agentruntimenow showsNAME TYPE TARGET READY AGEFinal status shape
Deviation from ticket
ConfigResolved kept — ticket AC says "exactly two conditions" but PR #405 (config merge) depends on
ConfigResolved. Keeping it avoids cross-PR conflicts. Can be removed in a follow-up once #405 merges. Jira comment posted noting this deviation.IstioMeshEnrolled — added by PR #403 (merged into main). Not part of this PR, but appears in the conditions list after rebase. Three states:
True/NamespaceLabeled,False/OptedOut,False/PatchFailed.Test plan
make test— all unit tests passmake test-e2e(AgentRuntime focus) — 8/8 specs passmake manifests generate— no driftmake lint— pre-existing warnings onlyManual Verification Results (Kind + Podman)
Click to expand full verification output
AC1: Printer columns show NAME, TYPE, TARGET, READY, AGE
PASS — Phase column gone, Ready column present.
AC2: status.observedGeneration == metadata.generation
kubectl get agentruntime test-runtime -n ac-test \ -o jsonpath='generation={.metadata.generation} observedGeneration={.status.observedGeneration}'PASS
AC3: status.phase removed
PASS
AC4: Conditions present (TargetResolved, ConfigResolved, Ready)
kubectl get agentruntime test-runtime -n ac-test \ -o jsonpath='{range .status.conditions[*]}{.type}={.status} reason={.reason}{"\n"}{end}'PASS — All 3 required conditions present.
IstioMeshEnrolledis from PR #403 (merged into main), not from this PR.AC5: CardFetched condition absent
PASS
AC6: SkillsDiscovered condition absent
PASS
AC7: Error case — missing target sets TargetResolved=False, no Phase
PASS
Full status YAML (happy path)
Summary