Skip to content

HYPERFLEET-1016 - refactor: Replace Ready condition references with Reconciled#110

Merged
openshift-merge-bot[bot] merged 3 commits intoopenshift-hyperfleet:mainfrom
tirthct:hyperfleet-1016
May 6, 2026
Merged

HYPERFLEET-1016 - refactor: Replace Ready condition references with Reconciled#110
openshift-merge-bot[bot] merged 3 commits intoopenshift-hyperfleet:mainfrom
tirthct:hyperfleet-1016

Conversation

@tirthct
Copy link
Copy Markdown
Contributor

@tirthct tirthct commented May 5, 2026

Summary

  • Update all CEL precondition expressions from c.type == "Ready" to c.type == "Reconciled" in production configs, helm examples, and test fixtures
  • Rename precondition variable names to match (readyConditionStatusreconciledConditionStatus, clusterNotReadyclusterNotReconciled, etc.)
  • Update mock API responses, integration test fixtures, and documentation examples
  • Update adapter-authoring-guide with Reconciled terminology throughout

The API now emits both Ready (deprecated backward-compat shim) and Reconciled (HYPERFLEET-853). This aligns adapter configs and tests with the canonical condition type.

Scope

  • Production config: configs/adapter-task-config-template.yaml
  • Helm chart examples: charts/examples/maestro/, maestro-two-resources/ configs and README
  • Dryrun test configs + mock responses: test/testdata/ YAML and JSON files
  • Integration tests: executor, config-loader, and mock API server Go files
  • Criteria tests: condition type maps in cel_evaluator_test.go and evaluator_test.go (6 + 4 lines only — generic ctx.Set("status", "Ready") tests left unchanged)
  • Documentation: adapter-authoring-guide.md, configloader/README.md, criteria/README.md, executor/README.md

Not changed

  • Nested K8s resource condition checks (resources.?namespace0, resources.?myResource) — these reference conditions on spoke cluster CRDs, not HyperFleet conditions
  • Generic criteria engine tests using "Ready" as an arbitrary test string
  • clusterPhase == "Ready" references — phase is separate from condition type
  • K8s fields (readyReplicas, minReadySeconds, /readyz)
  • NamespaceReady / NamespaceNotReady adapter status strings
  • AlreadyExists / already deleted error handling

Test plan

  • make test passes (unit tests)
  • make test-integration passes
  • make dryrun validates CEL expressions parse correctly with Reconciled

Summary by CodeRabbit

  • Bug Fixes

    • Preconditions and readiness gating now use the "Reconciled" condition type instead of "Ready" across configs and templates.
  • Documentation

    • Guides, examples, and READMEs updated to reflect "Reconciled" condition semantics and revised workflow wording.
  • Tests

    • Unit and integration test fixtures and assertions updated to validate and assert against the "Reconciled" condition type.

@openshift-ci openshift-ci Bot requested review from crizzo71 and mbrudnoy May 5, 2026 01:31
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: d860aece-9fa1-45f8-a4c8-ec3fa9adf238

📥 Commits

Reviewing files that changed from the base of the PR and between ac3026f and f9ab8d0.

📒 Files selected for processing (1)
  • test/integration/config-loader/config_criteria_integration_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/integration/config-loader/config_criteria_integration_test.go

Walkthrough

This change replaces the Kubernetes condition type "Ready" with "Reconciled" across the repository. It renames captured fields and template variables (e.g., readyConditionStatusreconciledConditionStatus, readyStatusreconciledStatus), updates CEL expressions and JSONPath/filters from c.type == "Ready" to c.type == "Reconciled", and adjusts test fixtures, mock responses, YAML configs, templates, and documentation. No public APIs or runtime control-flow logic were introduced; the modifications change which condition type is evaluated.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.89% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: replacing Ready condition references with Reconciled across the codebase.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/integration/config-loader/config_criteria_integration_test.go`:
- Around line 69-70: Update the misleading test text/messages that claim the
expected reconciled condition is "True" (or say “condition False”) to accurately
reflect the fixture value reconciledConditionStatus == "False"; specifically
change the comment near ctx.Set("reconciledConditionStatus", "False") and the
assertion/failure messages referenced around the block covering lines ~154–177
so they state that the precondition expects "False" (or say “condition False in
fixture”) to avoid confusing failure output. Ensure the text changes reference
the same test case and keep the actual assertion logic (which checks
reconciledConditionStatus == "False") unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 0b3f7268-46e2-4a99-bfa4-1b591032ec80

📥 Commits

Reviewing files that changed from the base of the PR and between 9d9be8a and 1d3e19f.

📒 Files selected for processing (25)
  • charts/examples/maestro-two-resources/adapter-task-config.yaml
  • charts/examples/maestro/README.md
  • charts/examples/maestro/adapter-task-config.yaml
  • configs/adapter-task-config-template.yaml
  • docs/adapter-authoring-guide.md
  • internal/configloader/README.md
  • internal/configloader/validator_test.go
  • internal/criteria/README.md
  • internal/criteria/cel_evaluator_test.go
  • internal/criteria/evaluator_test.go
  • internal/executor/README.md
  • test/integration/config-loader/config_criteria_integration_test.go
  • test/integration/config-loader/loader_template_test.go
  • test/integration/config-loader/testdata/adapter-config-template.yaml
  • test/integration/config-loader/testdata/templates/cluster-status-payload.yaml
  • test/integration/executor/executor_integration_test.go
  • test/integration/executor/executor_k8s_integration_test.go
  • test/integration/testutil/mock_api_server.go
  • test/testdata/dryrun/cel-showcase/dryrun-cel-showcase-api-responses.json
  • test/testdata/dryrun/cel-showcase/dryrun-cel-showcase-task-config.yaml
  • test/testdata/dryrun/dryrun-api-responses.json
  • test/testdata/dryrun/dryrun-delete-api-responses.json
  • test/testdata/dryrun/kubernetes/dryrun-kubernetes-task-config.yaml
  • test/testdata/dryrun/maestro/dryrun-maestro-adapter-task-config.yaml
  • test/testdata/task-config.yaml

Comment thread test/integration/config-loader/config_criteria_integration_test.go
t.Run("preconditions fail with Reconciled condition Unknown", func(t *testing.T) {
ctx := criteria.NewEvaluationContext()
ctx.Set("readyConditionStatus", "Unknown") // Not matching expected "True"
ctx.Set("reconciledConditionStatus", "Unknown") // Not matching expected "True"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Comment consistency (non-blocking)

Minor inconsistency in the comment.

The loaded test config expects reconciledConditionStatus == "False":
// NOTE: reconciledConditionStatus must match the condition in the template (False)

For consistency, this could arguably be:
ctx.Set("reconciledConditionStatus", "Unknown") // Does not match expected "False"

Copy link
Copy Markdown
Contributor Author

@tirthct tirthct May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for flagging this @ldornele . Line 177 is actually correct — the template expects "True" (line 153 in adapter-config-template.yaml), so "Unknown" does not match expected "True". The inconsistency was at line 69 where I incorrectly changed (True) to (False). Fixed that and removed the redundant comment at line 156 as well

@rafabene
Copy link
Copy Markdown
Contributor

rafabene commented May 6, 2026

/lgtm

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 6, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rafabene

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved label May 6, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 5d6f1d4 into openshift-hyperfleet:main May 6, 2026
9 checks passed
@tirthct tirthct deleted the hyperfleet-1016 branch May 6, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants