fix: add consecutiveFailures tracking to useKyverno; remove stale TODOs#4562
fix: add consecutiveFailures tracking to useKyverno; remove stale TODOs#4562
Conversation
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hey @Copilot — thanks for opening this PR!
This is an automated message. |
Agent-Logs-Url: https://github.com/kubestellar/console/sessions/4aac931c-3566-46a5-b153-8f7972351f28 Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
This PR modifies the MSW-generated service worker to add a top-of-file ESLint disable directive.
Changes:
- Add
/* eslint-disable */header toweb/public/mockServiceWorker.js.
Comments suppressed due to low confidence (1)
web/public/mockServiceWorker.js:7
- This file is MSW-generated and explicitly says “Please do NOT modify this file.” Adding a blanket
/* eslint-disable */changes the generated artifact and can be lost/overwritten on the nextmsw init(and makes it harder to detect genuine regeneration diffs). Since the repo’sweb/eslint.config.jsonly lints**/*.{ts,tsx}, this JS file shouldn’t need ESLint suppression; please revert this change, or (if some other lint step is actually targeting it) excludepublic/mockServiceWorker.jsvia the relevant lint ignore config instead of editing the generated file.
/* eslint-disable */
/* tslint:disable */
/**
* Mock Service Worker.
* @see https://github.com/mswjs/msw
* - Please do NOT modify this file.
| /* eslint-disable */ | ||
| /* tslint:disable */ | ||
|
|
||
| /** |
There was a problem hiding this comment.
The PR title/description indicate changes around TODOs in LogsDrillDown / CrossClusterPolicyComparison and adding consecutiveFailures to useKyverno, but the only diff shown here is an ESLint directive added to public/mockServiceWorker.js. Please update the PR description to reflect this change (and why it’s needed), or split it into a separate PR to keep the scope aligned.
🔄 Auto-Applying Copilot Code ReviewCopilot code review found 0 code suggestion(s) and 1 general comment(s). Also address these general comments:
Push all fixes in a single commit. Run Auto-generated by copilot-review-apply workflow. |
…parison - Add consecutiveFailures tracking to useKyverno hook (state, increment on all-cluster-error, reset on success, expose isFailed=consecutiveFailures>=3) - CrossClusterPolicyComparison: use real consecutiveFailures/isFailed from hook - LogsDrillDown: remove stale TODO (placeholder already self-documented) - useKyverno test: verify consecutiveFailures and isFailed in returned shape Signed-off-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Agent-Logs-Url: https://github.com/kubestellar/console/sessions/4aac931c-3566-46a5-b153-8f7972351f28 Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
|
Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits. 📝 Please follow instructions in the contributing guide to update your commits with the DCO Full details of the Developer Certificate of Origin can be found at developercertificate.org. The list of commits missing DCO signoff: DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
Closing — fixing directly. |
Two Auto-QA flagged TODOs: one stale placeholder comment in
LogsDrillDown, one pointing to a genuine gap —useKyvernohad no consecutive-failure tracking, soCrossClusterPolicyComparisonwas passing a hardcoded proxy (hasError ? 1 : 0) instead of real data.📌 Fixes
📝 Summary of Changes
useKyvernonow natively tracksconsecutiveFailuresand derivesisFailed(>= 3), matching the pattern used byuseCrossplaneManagedResourcesand other hooksCrossClusterPolicyComparisonconsumes the real values instead of the proxy; TODO removedLogsDrillDownremoved — surrounding comments already document the placeholder intentChanges Made
consecutiveFailuresstate touseKyverno: increments when every cluster errors in a round, resets on any success, also reset on cache-clear (mode transitions)consecutiveFailuresandisFailed(consecutiveFailures >= 3) fromuseKyvernoreturnCrossClusterPolicyComparisonto destructure and passconsecutiveFailures/isFailedtouseCardLoadingState— eliminates the duplicated error-detection logic// TODO: When real API is added…fromLogsDrillDown(no actionable work, placeholder is self-documenting)useKyvernoshape test to assertconsecutiveFailuresandisFailedare presentChecklist
git commit -s)Screenshots or Logs (if applicable)
N/A — logic-only changes; no UI visual impact.
👀 Reviewer Notes
hasError(all clusters errored right now) is intentionally kept in the component for the error-view rendering gate — it's a point-in-time check.isFailedfrom the hook (consecutiveFailures >= 3) is used foruseCardLoadingState, consistent with how other cards handle persistent failure state.