-
Notifications
You must be signed in to change notification settings - Fork 23
HYPERFLEET-1195 - docs: add common when patterns and combination guide #238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,8 @@ resources: | |
| post: | ||
| payloads: | ||
| - name: "clusterStatusPayload" | ||
| when: | ||
| expression: "!adapter.resourcesSkipped" | ||
| build: | ||
| adapter: "{{ .adapter.name }}" | ||
| conditions: | ||
|
|
@@ -163,6 +165,38 @@ post: | |
| expression: "generation" | ||
| observed_time: "{{ now | date \"2006-01-02T15:04:05Z07:00\" }}" | ||
|
|
||
| # Skipped path: preconditions not met — report simplified status without | ||
| # evaluating resources.* (which may not exist in this context) | ||
| - name: "skippedStatusPayload" | ||
| when: | ||
| expression: "adapter.resourcesSkipped" | ||
| build: | ||
| adapter: "{{ .adapter.name }}" | ||
| conditions: | ||
| - type: "Applied" | ||
| status: "False" | ||
| reason: "PreconditionsNotMet" | ||
| message: | ||
| expression: | | ||
| "Resources skipped: " + adapter.?skipReason.orValue("preconditions not met") | ||
| - type: "Available" | ||
| status: "False" | ||
| reason: "PreconditionsNotMet" | ||
| message: | ||
| expression: | | ||
| "Resources not available: " + adapter.?skipReason.orValue("preconditions not met") | ||
| - type: "Health" | ||
| status: "True" | ||
| reason: "NoErrors" | ||
| message: "Adapter is healthy, no work performed due to preconditions" | ||
|
Comment on lines
+171
to
+191
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift Do not classify every This payload hardcodes Use distinct outcome metadata: select this payload only for a successful As per path instructions: “Prioritize Critical and Major severity issues” and validate cross-layer contracts. 🤖 Prompt for AI AgentsSource: Path instructions |
||
| - type: "Finalized" | ||
| status: "False" | ||
| reason: "" | ||
| message: "" | ||
| observed_generation: | ||
| expression: "generation" | ||
| observed_time: "{{ now | date \"2006-01-02T15:04:05Z07:00\" }}" | ||
|
|
||
| post_actions: | ||
| - name: "reportClusterStatus" | ||
| when: | ||
|
|
@@ -174,3 +208,14 @@ post: | |
| - name: "Content-Type" | ||
| value: "application/json" | ||
| body: "{{ .clusterStatusPayload }}" | ||
|
|
||
| - name: "reportClusterStatusSkipped" | ||
| when: | ||
| expression: "adapter.resourcesSkipped" | ||
| api_call: | ||
| method: "PUT" | ||
| url: "/clusters/{{ .clusterId }}/statuses" | ||
| headers: | ||
| - name: "Content-Type" | ||
| value: "application/json" | ||
| body: "{{ .skippedStatusPayload }}" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: openshift-hyperfleet/hyperfleet-adapter
Length of output: 38076
🏁 Script executed:
Repository: openshift-hyperfleet/hyperfleet-adapter
Length of output: 8256
🏁 Script executed:
Repository: openshift-hyperfleet/hyperfleet-adapter
Length of output: 9582
🏁 Script executed:
Repository: openshift-hyperfleet/hyperfleet-adapter
Length of output: 1769
🏁 Script executed:
Repository: openshift-hyperfleet/hyperfleet-adapter
Length of output: 11862
🏁 Script executed:
Repository: openshift-hyperfleet/hyperfleet-adapter
Length of output: 3968
Add a real skip path to the Kubernetes example (CWE-561).
charts/examples/kubernetes/adapter-task-config.yamldocumentsskippedStatusPayload, but this example never defines anypreconditions:or other skip-triggering branch, soadapter.resourcesSkippedcannot drive that payload/post-action. WirecheckClusterStateinto a concrete precondition with both match and no-match cases, or drop the skipped branch from the example.🤖 Prompt for AI Agents
Source: Path instructions