Skip to content

HYPERFLEET-1017 - refactor: update for LastKnownReconciled rename#107

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift-hyperfleet:mainfrom
rafabene:rbenevid/HYPERFLEET-1017/rename-available-to-last-known-reconciled
May 8, 2026
Merged

HYPERFLEET-1017 - refactor: update for LastKnownReconciled rename#107
openshift-merge-bot[bot] merged 1 commit into
openshift-hyperfleet:mainfrom
rafabene:rbenevid/HYPERFLEET-1017/rename-available-to-last-known-reconciled

Conversation

@rafabene
Copy link
Copy Markdown
Contributor

@rafabene rafabene commented May 5, 2026

Summary

Dependencies

Changed files

  • internal/client/client_test.go — test fixtures
  • internal/config/config_test.go — CEL expression in default config test
  • internal/engine/decision_test.go — decision engine test fixtures and assertions
  • test/integration/integration_test.go — integration test fixtures
  • test/mock-hyperfleet-api/main.go — mock server condition type

Test plan

  • All unit tests pass (go test ./...)
  • Integration tests pass

Summary by CodeRabbit

  • Tests
    • Updated unit, integration, and mock tests to replace the "Available" status condition with "LastKnownReconciled", and adjusted test expectations, lookups, and assertions to match the new condition name.

@openshift-ci openshift-ci Bot requested review from ma-hill and rh-amarin May 5, 2026 23:14
@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: 7f3d62e5-226b-4c35-8afc-2114527f77f1

📥 Commits

Reviewing files that changed from the base of the PR and between cb05508 and 00b573a.

📒 Files selected for processing (5)
  • internal/client/client_test.go
  • internal/config/config_test.go
  • internal/engine/decision_test.go
  • test/integration/integration_test.go
  • test/mock-hyperfleet-api/main.go
🚧 Files skipped from review as they are similar to previous changes (5)
  • internal/config/config_test.go
  • test/integration/integration_test.go
  • test/mock-hyperfleet-api/main.go
  • internal/engine/decision_test.go
  • internal/client/client_test.go

Walkthrough

This change updates test fixtures and mock data across multiple test files, replacing occurrences of the "Available" status condition type with "LastKnownReconciled". Modifications appear in cluster and nodepool mocks, configuration tests, decision engine tests (including an added subtest variant), integration test mocks, and the mock API generator. No production logic, API signatures, or exported declarations are modified.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% 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 directly reflects the main change: updating references from 'Available' to 'LastKnownReconciled' across the codebase, which matches all file modifications shown in the summary.
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.

@rafabene rafabene force-pushed the rbenevid/HYPERFLEET-1017/rename-available-to-last-known-reconciled branch from 1ee97d4 to e8e6647 Compare May 5, 2026 23:17
@rafabene rafabene force-pushed the rbenevid/HYPERFLEET-1017/rename-available-to-last-known-reconciled branch from e8e6647 to cb05508 Compare May 6, 2026 00:03
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.

🧹 Nitpick comments (1)
internal/client/client_test.go (1)

44-45: ⚡ Quick win

Assert the renamed condition is actually parsed and present

Line 44 and Line 590 update fixtures to LastKnownReconciled, but the tests still only validate generic condition status/indexes. That means this rename can regress without failing this test file. Add an explicit assertion that at least one parsed condition has Type == "LastKnownReconciled" in both cluster and nodepool test paths.

Proposed test assertion pattern
+	foundLastKnownReconciled := false
+	for _, cond := range resources[0].Status.Conditions {
+		if cond.Type == "LastKnownReconciled" {
+			foundLastKnownReconciled = true
+			break
+		}
+	}
+	if !foundLastKnownReconciled {
+		t.Fatal("Expected LastKnownReconciled condition to be present")
+	}

Also applies to: 590-591

🤖 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 `@internal/client/client_test.go` around lines 44 - 45, Tests updated fixtures
to use "LastKnownReconciled" but never assert the renamed condition is actually
parsed; add an explicit check in the cluster and nodepool test paths in
internal/client/client_test.go that verifies at least one parsed condition has
Type == "LastKnownReconciled". Locate the places where conditions are parsed
into a slice (e.g., variables named parsedConditions / conditions /
clusterConditions / nodepoolConditions or the test helpers that call the parsing
function) and add an assertion that iterates that slice and expects at least one
condition.Type == "LastKnownReconciled" (fail the test if none found).
🤖 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.

Nitpick comments:
In `@internal/client/client_test.go`:
- Around line 44-45: Tests updated fixtures to use "LastKnownReconciled" but
never assert the renamed condition is actually parsed; add an explicit check in
the cluster and nodepool test paths in internal/client/client_test.go that
verifies at least one parsed condition has Type == "LastKnownReconciled". Locate
the places where conditions are parsed into a slice (e.g., variables named
parsedConditions / conditions / clusterConditions / nodepoolConditions or the
test helpers that call the parsing function) and add an assertion that iterates
that slice and expects at least one condition.Type == "LastKnownReconciled"
(fail the test if none found).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: b82262c2-eeae-438a-a5a9-228abe68af65

📥 Commits

Reviewing files that changed from the base of the PR and between e8e6647 and cb05508.

📒 Files selected for processing (5)
  • internal/client/client_test.go
  • internal/config/config_test.go
  • internal/engine/decision_test.go
  • test/integration/integration_test.go
  • test/mock-hyperfleet-api/main.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/engine/decision_test.go

Comment thread test/mock-hyperfleet-api/main.go Outdated
…ciled rename

The HyperFleet API renamed the aggregated Available condition to
LastKnownReconciled. Update all test fixtures, CEL expressions,
and the mock API server to match.
@rafabene rafabene force-pushed the rbenevid/HYPERFLEET-1017/rename-available-to-last-known-reconciled branch from cb05508 to 00b573a Compare May 8, 2026 17:06
Copy link
Copy Markdown
Contributor

@pnguyen44 pnguyen44 left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 8, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pnguyen44

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 8, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 36b9830 into openshift-hyperfleet:main May 8, 2026
9 checks passed
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