Skip to content

HYPERFLEET-707 - doc: update adapter configs to add time-based stability precondition#20

Merged
xueli181114 merged 3 commits intoopenshift-hyperfleet:mainfrom
86254860:HYPERFLEET-707
Mar 18, 2026
Merged

HYPERFLEET-707 - doc: update adapter configs to add time-based stability precondition#20
xueli181114 merged 3 commits intoopenshift-hyperfleet:mainfrom
86254860:HYPERFLEET-707

Conversation

@86254860
Copy link
Contributor

@86254860 86254860 commented Mar 13, 2026

Summary by CodeRabbit

  • Configuration Updates

    • Renamed Google Pub/Sub config keys to snake_case (subscription_id, dead_letter_topic).
    • Added TTL_EXPIRY_THRESHOLD (default 300s) for readiness-based expiry.
  • Improvements

    • Replaced status-string readiness checks with a boolean-style not-ready evaluation.
    • Validation now passes on sustained not-ready state OR when the readiness TTL is exceeded to allow automated recovery.

@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Two Helm adapter task configs replace a Ready string-status check with a boolean not-ready precondition and a TTL-based precondition: readyConditionStatus was renamed to clusterNotReady / nodepoolNotReady and treats absent Ready as not-ready; a new ...ReadyTTL precondition computes elapsed seconds since the Ready condition's lastTransitionTime (defaults to now()) and compares it to 300 seconds; validationCheck now passes when not-ready OR TTL expired. Two values files rename Pub/Sub keys: deadLetter_topicdead_letter_topic and subscriptionIdsubscription_id.

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 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 changes: adding time-based stability preconditions (clusterReadyTTL/nodepoolReadyTTL) to adapter configs, with config key renames as supporting changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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

Copy link

@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 the current code and only fix it if needed.

Inline comments:
In `@helm/adapter3/adapter-task-config.yaml`:
- Around line 64-67: Update the inline comment above the precondition expression
to reflect the actual comparison used in the expression: change the text to
indicate ">= TTL_EXPIRY_THRESHOLD seconds" (i.e., passing when stable for
greater than or equal to the threshold) so the comment matches the logic using
readyCondition, readyCondition.last_transition_time and TTL_EXPIRY_THRESHOLD in
the expression.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8fa61e23-328c-4483-9b6c-bb7dd38ec389

📥 Commits

Reviewing files that changed from the base of the PR and between 78a4f67 and 8d502f8.

📒 Files selected for processing (2)
  • helm/adapter1/adapter-task-config.yaml
  • helm/adapter3/adapter-task-config.yaml

Copy link

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@helm/adapter1/adapter-task-config.yaml`:
- Around line 42-53: clusterNotReady and clusterReadyTTL assume
status.conditions and last_transition_time exist; make the CEL expressions
null-safe by first checking status.conditions != null and that the filtered list
has >0 elements before indexing, and for clusterReadyTTL also check the
existence of last_transition_time and fall back to now() if missing. Update the
clusterNotReady expression used in the "clusterNotReady" rule to:
status.conditions != null && status.conditions.filter(c, c.type ==
"Ready").size() > 0 ? status.conditions.filter(c, c.type == "Ready")[0].status
!= "True" : true; and update "clusterReadyTTL" to compute the timestamp using a
guarded last_transition_time: (timestamp(now()) - timestamp(status.conditions !=
null && status.conditions.filter(c, c.type == "Ready").size() > 0 &&
status.conditions.filter(c, c.type == "Ready")[0].last_transition_time != null ?
status.conditions.filter(c, c.type == "Ready")[0].last_transition_time :
now())).getSeconds() >= 300 so accesses in clusterReadyTTL and clusterNotReady
(status.conditions and last_transition_time) are protected.

In `@helm/adapter3/adapter-task-config.yaml`:
- Around line 47-58: The CEL expressions for nodepoolNotReady and
nodepoolReadyTTL assume status.conditions and last_transition_time exist; make
them defensive by first checking status and conditions are present and non-empty
and that last_transition_time is present before indexing or calling timestamp.
Update the nodepoolNotReady expression to use a guard like status != null &&
status.conditions != null && status.conditions.size() > 0 ?
status.conditions.filter(c, c.type == "Ready")[0].status != "True" : true, and
update nodepoolReadyTTL to compute the reference time only when
status/conditions and last_transition_time exist (fallback to now() otherwise),
e.g. check status != null && status.conditions != null &&
status.conditions.size() > 0 && status.conditions.filter(c, c.type ==
"Ready")[0].last_transition_time != null ? timestamp(status.conditions.filter(c,
c.type == "Ready")[0].last_transition_time) : timestamp(now()), then compare
getSeconds() >= 300; apply these guards in the nodepoolNotReady and
nodepoolReadyTTL expressions to avoid runtime errors.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c6898181-f2c9-48b0-9b31-0822173bc160

📥 Commits

Reviewing files that changed from the base of the PR and between 8d502f8 and 04cff6b.

📒 Files selected for processing (2)
  • helm/adapter1/adapter-task-config.yaml
  • helm/adapter3/adapter-task-config.yaml

Copy link

@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.

♻️ Duplicate comments (2)
helm/adapter3/adapter-task-config.yaml (1)

45-54: ⚠️ Potential issue | 🟠 Major

Add null-safe guards in CEL readiness checks.

Line 45 and Line 51 assume status.conditions exists, and Line 52 assumes last_transition_time exists. Missing fields can make precondition evaluation fail at runtime instead of safely falling back.

Suggested hardening
       - name: "nodepoolNotReady"
         expression: |
-          status.conditions.filter(c, c.type == "Ready").size() > 0
-            ? status.conditions.filter(c, c.type == "Ready")[0].status != "True"
+          status.?conditions.orValue([]).filter(c, c.type == "Ready").size() > 0
+            ? status.?conditions.orValue([]).filter(c, c.type == "Ready")[0].status != "True"
             : true
       - name: "nodepoolReadyTTL"
         expression: |
           (timestamp(now()) - timestamp(
-            status.conditions.filter(c, c.type == "Ready").size() > 0
-              ? status.conditions.filter(c, c.type == "Ready")[0].last_transition_time
+            status.?conditions.orValue([]).filter(c, c.type == "Ready").size() > 0 &&
+            has(status.?conditions.orValue([]).filter(c, c.type == "Ready")[0].last_transition_time)
+              ? status.?conditions.orValue([]).filter(c, c.type == "Ready")[0].last_transition_time
               : now()
           )).getSeconds() > TTL_EXPIRY_THRESHOLD

As per coding guidelines, **: -Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@helm/adapter3/adapter-task-config.yaml` around lines 45 - 54, The CEL
expressions in the nodepoolReadyTTL check assume status.conditions and each
condition.last_transition_time exist; make them null-safe by first testing that
status.conditions is defined and non-empty and that the Ready condition and its
last_transition_time are present before accessing them (used in the expression
for nodepoolReadyTTL and the Ready readiness check), and fall back to now() or
true when those fields are missing; update the expressions referencing
status.conditions, the Ready condition lookup, and last_transition_time so they
short-circuit on null/empty values and continue to compare against
TTL_EXPIRY_THRESHOLD safely.
helm/adapter1/adapter-task-config.yaml (1)

40-49: ⚠️ Potential issue | 🟠 Major

Harden clusterNotReady / clusterReadyTTL against partial status payloads.

Line 40, Line 46, and Line 47 access nested readiness fields without null-safe guards. If status.conditions or last_transition_time is missing, CEL evaluation can fail and block the task.

Suggested hardening
       - name: "clusterNotReady"
         expression: |
-          status.conditions.filter(c, c.type == "Ready").size() > 0
-            ? status.conditions.filter(c, c.type == "Ready")[0].status != "True"
+          status.?conditions.orValue([]).filter(c, c.type == "Ready").size() > 0
+            ? status.?conditions.orValue([]).filter(c, c.type == "Ready")[0].status != "True"
             : true
       - name: "clusterReadyTTL"
         expression: |
           (timestamp(now()) - timestamp(
-            status.conditions.filter(c, c.type == "Ready").size() > 0
-              ? status.conditions.filter(c, c.type == "Ready")[0].last_transition_time
+            status.?conditions.orValue([]).filter(c, c.type == "Ready").size() > 0 &&
+            has(status.?conditions.orValue([]).filter(c, c.type == "Ready")[0].last_transition_time)
+              ? status.?conditions.orValue([]).filter(c, c.type == "Ready")[0].last_transition_time
               : now()
           )).getSeconds() > TTL_EXPIRY_THRESHOLD

As per coding guidelines, **: -Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@helm/adapter1/adapter-task-config.yaml` around lines 40 - 49, The expressions
for clusterNotReady and clusterReadyTTL access nested fields like
status.conditions and last_transition_time without null-safe checks, risking
failures if these fields are missing. Update these expressions in the
adapter-task-config.yaml to include null or existence checks before accessing
nested properties, ensuring the CEL evaluation does not fail on partial or
missing status data.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@helm/adapter1/adapter-task-config.yaml`:
- Around line 40-49: The expressions for clusterNotReady and clusterReadyTTL
access nested fields like status.conditions and last_transition_time without
null-safe checks, risking failures if these fields are missing. Update these
expressions in the adapter-task-config.yaml to include null or existence checks
before accessing nested properties, ensuring the CEL evaluation does not fail on
partial or missing status data.

In `@helm/adapter3/adapter-task-config.yaml`:
- Around line 45-54: The CEL expressions in the nodepoolReadyTTL check assume
status.conditions and each condition.last_transition_time exist; make them
null-safe by first testing that status.conditions is defined and non-empty and
that the Ready condition and its last_transition_time are present before
accessing them (used in the expression for nodepoolReadyTTL and the Ready
readiness check), and fall back to now() or true when those fields are missing;
update the expressions referencing status.conditions, the Ready condition
lookup, and last_transition_time so they short-circuit on null/empty values and
continue to compare against TTL_EXPIRY_THRESHOLD safely.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 44ced8de-ee11-43ce-ad95-b942940698c6

📥 Commits

Reviewing files that changed from the base of the PR and between 04cff6b and 6ddc7c9.

📒 Files selected for processing (2)
  • helm/adapter1/adapter-task-config.yaml
  • helm/adapter3/adapter-task-config.yaml

Copy link

@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.

♻️ Duplicate comments (2)
helm/adapter3/adapter-task-config.yaml (1)

37-48: ⚠️ Potential issue | 🟠 Major

Add null-safe guards in readiness CEL expressions to prevent runtime failures.

Line 39 and Line 45/46 index into readiness data without guarding missing fields, which can break precondition evaluation on partial responses.

Suggested fix
       - name: "nodepoolNotReady"
         expression: |
-          status.conditions.filter(c, c.type == "Ready").size() > 0
-            ? status.conditions.filter(c, c.type == "Ready")[0].status != "True"
+          status.?conditions.orValue([]).filter(c, c.type == "Ready").size() > 0
+            ? status.?conditions.orValue([]).filter(c, c.type == "Ready")[0].status != "True"
             : true
       - name: "nodepoolReadyTTL"
         expression: |
           (timestamp(now()) - timestamp(
-            status.conditions.filter(c, c.type == "Ready").size() > 0
-              ? status.conditions.filter(c, c.type == "Ready")[0].last_transition_time
+            status.?conditions.orValue([]).filter(c, c.type == "Ready").size() > 0 &&
+            has(status.?conditions.orValue([]).filter(c, c.type == "Ready")[0].last_transition_time)
+              ? status.?conditions.orValue([]).filter(c, c.type == "Ready")[0].last_transition_time
               : now()
           )).getSeconds() > 300

As per coding guidelines, **: -Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@helm/adapter3/adapter-task-config.yaml` around lines 37 - 48, The CEL
expressions for the conditions "nodepoolNotReady" and "nodepoolReadyTTL" index
into readiness arrays without null-safe guards; update both expressions so they
first verify the Ready-condition element exists and its fields are non-null
before indexing: for "nodepoolNotReady" ensure size() > 0 and that the selected
element has a non-null status before comparing to "True", and for
"nodepoolReadyTTL" ensure size() > 0 and that the selected element has a
non-null last_transition_time (falling back to now() only if missing) before
computing timestamp(now()) - timestamp(...); apply these guards to avoid runtime
evaluation failures when fields are missing.
helm/adapter1/adapter-task-config.yaml (1)

32-43: ⚠️ Potential issue | 🟠 Major

Harden CEL preconditions against missing status.conditions / last_transition_time.

Line 34 and Line 40/41 assume fields always exist; partial API payloads can fail precondition evaluation instead of falling back safely.

Suggested fix
       - name: "clusterNotReady"
         expression: |
-          status.conditions.filter(c, c.type == "Ready").size() > 0
-            ? status.conditions.filter(c, c.type == "Ready")[0].status != "True"
+          status.?conditions.orValue([]).filter(c, c.type == "Ready").size() > 0
+            ? status.?conditions.orValue([]).filter(c, c.type == "Ready")[0].status != "True"
             : true
       - name: "clusterReadyTTL"
         expression: |
           (timestamp(now()) - timestamp(
-            status.conditions.filter(c, c.type == "Ready").size() > 0
-              ? status.conditions.filter(c, c.type == "Ready")[0].last_transition_time
+            status.?conditions.orValue([]).filter(c, c.type == "Ready").size() > 0 &&
+            has(status.?conditions.orValue([]).filter(c, c.type == "Ready")[0].last_transition_time)
+              ? status.?conditions.orValue([]).filter(c, c.type == "Ready")[0].last_transition_time
               : now()
           )).getSeconds() > 300

As per coding guidelines, **: -Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@helm/adapter1/adapter-task-config.yaml` around lines 32 - 43, The CEL
preconditions for clusterNotReady and clusterReadyTTL assume status.conditions
and last_transition_time exist; update both expressions in the rules named
"clusterNotReady" and "clusterReadyTTL" to null-safe check status.conditions
(e.g., ensure status.conditions != null and is a list or use a size() guard)
before filtering, and when reading the Ready condition use a fallback if
last_transition_time is missing (e.g., treat missing last_transition_time as
now()); in short, add explicit existence checks for status.conditions and
last_transition_time in the clusterNotReady and clusterReadyTTL expressions so
evaluation falls back safely instead of failing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@helm/adapter1/adapter-task-config.yaml`:
- Around line 32-43: The CEL preconditions for clusterNotReady and
clusterReadyTTL assume status.conditions and last_transition_time exist; update
both expressions in the rules named "clusterNotReady" and "clusterReadyTTL" to
null-safe check status.conditions (e.g., ensure status.conditions != null and is
a list or use a size() guard) before filtering, and when reading the Ready
condition use a fallback if last_transition_time is missing (e.g., treat missing
last_transition_time as now()); in short, add explicit existence checks for
status.conditions and last_transition_time in the clusterNotReady and
clusterReadyTTL expressions so evaluation falls back safely instead of failing.

In `@helm/adapter3/adapter-task-config.yaml`:
- Around line 37-48: The CEL expressions for the conditions "nodepoolNotReady"
and "nodepoolReadyTTL" index into readiness arrays without null-safe guards;
update both expressions so they first verify the Ready-condition element exists
and its fields are non-null before indexing: for "nodepoolNotReady" ensure
size() > 0 and that the selected element has a non-null status before comparing
to "True", and for "nodepoolReadyTTL" ensure size() > 0 and that the selected
element has a non-null last_transition_time (falling back to now() only if
missing) before computing timestamp(now()) - timestamp(...); apply these guards
to avoid runtime evaluation failures when fields are missing.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 01e02e1c-f6a5-4c3b-b000-9994760e96e0

📥 Commits

Reviewing files that changed from the base of the PR and between dfd0a4d and 3781b96.

📒 Files selected for processing (4)
  • helm/adapter1/adapter-task-config.yaml
  • helm/adapter1/values.yaml
  • helm/adapter3/adapter-task-config.yaml
  • helm/adapter3/values.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • helm/adapter1/values.yaml

@xueli181114
Copy link
Contributor

/lgtm

@xueli181114 xueli181114 merged commit eb3670d into openshift-hyperfleet:main Mar 18, 2026
1 check passed
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