Skip to content

HYPERFLEET-1017 - feat: rename aggregated condition Available to LastKnownReconciled#38

Open
rafabene wants to merge 1 commit intoopenshift-hyperfleet:mainfrom
rafabene:HYPERFLEET-1017-rename-available-to-last-known-reconciled
Open

HYPERFLEET-1017 - feat: rename aggregated condition Available to LastKnownReconciled#38
rafabene wants to merge 1 commit intoopenshift-hyperfleet:mainfrom
rafabene:HYPERFLEET-1017-rename-available-to-last-known-reconciled

Conversation

@rafabene
Copy link
Copy Markdown
Contributor

@rafabene rafabene commented May 6, 2026

Summary

  • Adds LastKnownReconciled to the ConditionType union in the shared model (keeps Available for adapter-level use)
  • Renames the aggregated condition from Available to LastKnownReconciled in all cluster and nodepool status examples (core + GCP)
  • Updates doc comments in cluster/nodepool models and cluster service to reference the new condition name
  • Regenerates all 4 schema variants (core openapi, core swagger, gcp openapi, gcp swagger)

The adapter-level Available condition (reported by adapters) is not renamed — only the API-computed aggregated condition changes.

Test plan

  • ./build-schema.sh gcp compiles successfully
  • ./build-schema.sh gcp --swagger compiles successfully
  • ./build-schema.sh core compiles successfully
  • ./build-schema.sh core --swagger compiles successfully
  • Generated schemas reference LastKnownReconciled for aggregated conditions
  • Generated schemas still reference Available for adapter-level conditions
  • models/statuses/example_adapter_status.tsp is unchanged

Relates to: https://redhat.atlassian.net/browse/HYPERFLEET-1017

Summary by CodeRabbit

  • New Features

    • Introduced a LastKnownReconciled status condition for Clusters and NodePools to improve reconciliation visibility.
  • Documentation

    • Updated API schemas, creation flow descriptions, examples, and docs to list LastKnownReconciled as a mandatory condition (replacing the prior condition) and updated example reason/message text.

@openshift-ci openshift-ci Bot requested review from jsell-rh and mbrudnoy May 6, 2026 16:58
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 6, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign aredenba-rh for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Caution

Review failed

Failed to post review comments

Walkthrough

This PR replaces the "Available" status condition type with "LastKnownReconciled" across models, examples, documentation, and OpenAPI/Swagger schemas. It adds LastKnownReconciled to the ConditionType union, replaces example constants and example payloads for Cluster and NodePool (live and deleted) to use the new condition with reason/message fields, and updates in-code documentation and API schema descriptions to list LastKnownReconciled as a mandatory status condition alongside Ready and Reconciled.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: renaming the aggregated condition from Available to LastKnownReconciled across cluster and nodepool status definitions, which is the primary focus of all modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
schemas/core/openapi.yaml (1)

1260-1267: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Align the schema with the new “three mandatory conditions” contract.

This block now documents 3 mandatory conditions, but minItems is still 2 here (and the same mismatch remains in NodePoolStatus at Line 1626). That leaves the published contract looser than the docs and lets clients/codegen accept incomplete statuses.

Suggested fix
         conditions:
           type: array
           items:
             $ref: '#/components/schemas/ResourceCondition'
-          minItems: 2
+          minItems: 3

Apply the same change to NodePoolStatus in the source model and regenerate the schema variants.

🤖 Prompt for 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.

In `@schemas/core/openapi.yaml` around lines 1260 - 1267, Update the schema to
reflect the new three-mandatory-conditions contract by changing minItems from 2
to 3 for the conditions arrays: specifically update ClusterStatus.conditions
(the block currently showing minItems: 2 and the three documented conditions
Ready/Reconciled/LastKnownReconciled) and likewise update
NodePoolStatus.conditions to minItems: 3 in the source model, then regenerate
the OpenAPI/schema variants so the published schema enforces the three required
conditions.
🧹 Nitpick comments (1)
models-gcp/nodepool/example_nodepool.tsp (1)

61-70: 💤 Low value

Consider using shared constants for consistency.

The nodepool examples use hardcoded strings ("ResourceLastKnownReconciled") for the reason, while cluster examples use the shared ExampleLastKnownReconciledReason constant. This inconsistency could cause maintenance overhead if the reason text needs to change.

🤖 Prompt for 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.

In `@models-gcp/nodepool/example_nodepool.tsp` around lines 61 - 70, Replace the
hardcoded reason string "ResourceLastKnownReconciled" used in the nodepool
example Condition object with the shared constant
ExampleLastKnownReconciledReason so examples stay consistent; locate the
Condition entry where ConditionType.LastKnownReconciled and
ResourceConditionStatus.True are set and change the reason field to
ExampleLastKnownReconciledReason, adding/importing that constant if needed so
the example compiles and matches cluster examples.
🤖 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.

Outside diff comments:
In `@schemas/core/openapi.yaml`:
- Around line 1260-1267: Update the schema to reflect the new
three-mandatory-conditions contract by changing minItems from 2 to 3 for the
conditions arrays: specifically update ClusterStatus.conditions (the block
currently showing minItems: 2 and the three documented conditions
Ready/Reconciled/LastKnownReconciled) and likewise update
NodePoolStatus.conditions to minItems: 3 in the source model, then regenerate
the OpenAPI/schema variants so the published schema enforces the three required
conditions.

---

Nitpick comments:
In `@models-gcp/nodepool/example_nodepool.tsp`:
- Around line 61-70: Replace the hardcoded reason string
"ResourceLastKnownReconciled" used in the nodepool example Condition object with
the shared constant ExampleLastKnownReconciledReason so examples stay
consistent; locate the Condition entry where ConditionType.LastKnownReconciled
and ResourceConditionStatus.True are set and change the reason field to
ExampleLastKnownReconciledReason, adding/importing that constant if needed so
the example compiles and matches cluster examples.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 7e279f64-f604-4e19-9537-50c4d0da2063

📥 Commits

Reviewing files that changed from the base of the PR and between 2807639 and 31740f5.

📒 Files selected for processing (12)
  • models-core/cluster/example_cluster.tsp
  • models-core/nodepool/example_nodepool.tsp
  • models-gcp/cluster/example_cluster.tsp
  • models-gcp/nodepool/example_nodepool.tsp
  • models/clusters/model.tsp
  • models/common/model.tsp
  • models/nodepools/model.tsp
  • schemas/core/openapi.yaml
  • schemas/core/swagger.yaml
  • schemas/gcp/openapi.yaml
  • schemas/gcp/swagger.yaml
  • services/clusters.tsp

@rafabene rafabene force-pushed the HYPERFLEET-1017-rename-available-to-last-known-reconciled branch 2 times, most recently from b4991c6 to 8b2c696 Compare May 6, 2026 18:00
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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
schemas/gcp/swagger.yaml (1)

1404-1412: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Update minItems to match the 3 mandatory conditions

Line 1404/Line 1918 document three mandatory conditions, but Line 1411 and Line 1925 still permit only two entries. This leaves the schema less strict than its own contract.

Proposed fix
-        minItems: 2
+        minItems: 3
...
-        minItems: 2
+        minItems: 3

Also applies to: 1918-1926

🤖 Prompt for 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.

In `@schemas/gcp/swagger.yaml` around lines 1404 - 1412, The schema currently
defines the resource conditions array (items: $ref:
'#/definitions/ResourceCondition') with minItems: 2 but the spec/doc text
requires three mandatory conditions; update every occurrence of minItems: 2 to
minItems: 3 for the conditions array so the OpenAPI schema enforces the three
required conditions (ensure you change both places mentioned around the
ResourceCondition definition in swagger.yaml).
schemas/core/openapi.yaml (1)

1266-1274: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Align schema cardinality with documented mandatory conditions

Line 1270 and Line 1636 describe 3 mandatory conditions, but Line 1266 and Line 1632 still allow only 2. This weakens the API contract and validation for status payloads.

Proposed fix
-          minItems: 2
+          minItems: 3
...
-          minItems: 2
+          minItems: 3

Also applies to: 1632-1640

🤖 Prompt for 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.

In `@schemas/core/openapi.yaml` around lines 1266 - 1274, Update the OpenAPI
schema for the cluster status "conditions" array to require three items instead
of two: change the minItems value from 2 to 3 for the schema that contains the
"List of status conditions for the cluster" description (the "conditions" array
where the description lists the three mandatory conditions: Ready, Reconciled,
LastKnownReconciled), and make the same change for the second occurrence of that
schema later in the file so both locations enforce minItems: 3.
🤖 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.

Outside diff comments:
In `@schemas/core/openapi.yaml`:
- Around line 1266-1274: Update the OpenAPI schema for the cluster status
"conditions" array to require three items instead of two: change the minItems
value from 2 to 3 for the schema that contains the "List of status conditions
for the cluster" description (the "conditions" array where the description lists
the three mandatory conditions: Ready, Reconciled, LastKnownReconciled), and
make the same change for the second occurrence of that schema later in the file
so both locations enforce minItems: 3.

In `@schemas/gcp/swagger.yaml`:
- Around line 1404-1412: The schema currently defines the resource conditions
array (items: $ref: '#/definitions/ResourceCondition') with minItems: 2 but the
spec/doc text requires three mandatory conditions; update every occurrence of
minItems: 2 to minItems: 3 for the conditions array so the OpenAPI schema
enforces the three required conditions (ensure you change both places mentioned
around the ResourceCondition definition in swagger.yaml).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 55123c3a-35b2-4886-9821-d834ac2dfdce

📥 Commits

Reviewing files that changed from the base of the PR and between 31740f5 and 8b2c696.

📒 Files selected for processing (12)
  • models-core/cluster/example_cluster.tsp
  • models-core/nodepool/example_nodepool.tsp
  • models-gcp/cluster/example_cluster.tsp
  • models-gcp/nodepool/example_nodepool.tsp
  • models/clusters/model.tsp
  • models/common/model.tsp
  • models/nodepools/model.tsp
  • schemas/core/openapi.yaml
  • schemas/core/swagger.yaml
  • schemas/gcp/openapi.yaml
  • schemas/gcp/swagger.yaml
  • services/clusters.tsp
✅ Files skipped from review due to trivial changes (1)
  • services/clusters.tsp
🚧 Files skipped from review as they are similar to previous changes (1)
  • models-core/cluster/example_cluster.tsp

@rafabene rafabene force-pushed the HYPERFLEET-1017-rename-available-to-last-known-reconciled branch from 8b2c696 to a23333d Compare May 6, 2026 18:16
Comment thread models/common/model.tsp
Comment on lines 178 to +181
Available: "Available",
Ready: "Ready",
Reconciled: "Reconciled"
Reconciled: "Reconciled",
LastKnownReconciled: "LastKnownReconciled"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we remove Available from here?

ConditionType.Available appears in example_adapter_status.tsp but it may be better defined as a new AdapterConditionType and define also Applied, Health, Finalized for reuse

@rh-amarin
Copy link
Copy Markdown
Collaborator

One required change is to update the version at main.tsp

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.

2 participants