Skip to content

EDM-5034: Show restart app loop warnings - #764

Merged
celdrake merged 1 commit into
flightctl:mainfrom
celdrake:EDM-5034-show-restart-loop-warning
Aug 10, 2026
Merged

EDM-5034: Show restart app loop warnings#764
celdrake merged 1 commit into
flightctl:mainfrom
celdrake:EDM-5034-show-restart-loop-warning

Conversation

@celdrake

@celdrake celdrake commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Display a warning for applications that appear to be in a restart loop, to raise awareness for the user that the application may be misbehaving.

Threshold for the warning to appear is set to 20+ restarts.

Screenshot From 2026-08-10 09-53-44

Summary

  • Shared UI components: Updated libs/ui-components/ with session-based restart-spike detection.
  • Applications that restart at least 20 times show a warning popover or expanded alert.
  • The alert provides a Stop application action when lifecycle state, permissions, and application status allow it.
  • Refactored ApplicationLifecycleActions to receive lifecycle controls through ApplicationLifecycleControls.
  • The shared behavior affects both standalone and OCP plugin applications.
  • No changes affect libs/types/, libs/i18n/, libs/cypress/, the Go auth proxy, container builds, or CI configuration.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The application table now detects repeated application restarts, displays warnings, and can stop eligible applications. Lifecycle controls are injected into ApplicationLifecycleActions through a new exported type.

Changes

Application restart lifecycle

Layer / File(s) Summary
Restart spike detection
libs/ui-components/src/hooks/useRestartSpikes.ts
Added session-scoped restart baseline tracking. The hook reports applications that exceed the restart threshold and preserves stable results when inputs do not change.
Lifecycle warning integration
libs/ui-components/src/components/DetailsPage/Tables/ApplicationsTable.tsx, libs/ui-components/src/components/DetailsPage/Tables/ApplicationLifecycleActions.tsx
ApplicationsTable now computes restart deltas, renders restart warnings, checks stop eligibility, and passes lifecycle controls to row actions. ApplicationLifecycleActions now consumes the exported ApplicationLifecycleControls contract instead of calling useApplicationLifecycle.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ApplicationsTable
  participant useRestartSpikes
  participant ApplicationTableRow
  participant ApplicationLifecycleActions
  ApplicationsTable->>useRestartSpikes: application restart counters
  useRestartSpikes-->>ApplicationsTable: restart deltas
  ApplicationsTable->>ApplicationTableRow: restart delta and lifecycle controls
  ApplicationTableRow->>ApplicationLifecycleActions: render lifecycle actions
  ApplicationLifecycleActions->>ApplicationsTable: invoke supplied lifecycle callback
Loading

Possibly related PRs

Suggested labels: ui-components, i18n

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: displaying warnings for applications that enter a restart loop.
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.
No-Hardcoded-Secrets ✅ Passed The PR adds no API keys, tokens, passwords, private keys, embedded credentials, or suspicious base64 strings; credential-pattern scans found no matches in added lines or changed files.
No-Weak-Crypto ✅ Passed The commit adds restart-warning UI and React state logic; scans of all added lines and changed files found no weak algorithms, crypto APIs, custom crypto, or secret comparisons.
No-Injection-Vectors ✅ Passed The PR adds no eval/exec, dangerouslySetInnerHTML, os.system, exec.Command, or yaml.load calls; dynamic values render through React text and i18n interpolation.
Container-Privileges ✅ Passed The PR changes only React, hook, and translation files; its added lines contain no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation, or root settings.
No-Sensitive-Data-In-Logs ✅ Passed The PR adds UI warnings and restart tracking only; changed source files contain no console, logger, telemetry, or other logging calls and no sensitive-data payloads.
Resource-Leaks ✅ Passed HEAD changes only four frontend files under libs/; no Go files in proxy/ changed, so this resource-leak check is not applicable.
Unchecked-Errors ✅ Passed The pull request changes only UI and i18n files; the parent-to-head diff contains no Go files under proxy/, so this check is not applicable.
Ai-Attribution ✅ Passed The PR commit uses the acceptable Made-with: Cursor trailer and does not use Co-Authored-By for AI attribution.
Generated-Files-Not-Hand-Edited ✅ Passed The only protected change is translation.json; all seven additions match new t() literals, including parser-style _one/_other keys. No OpenAPI generated files changed.
I18n-Compliance ✅ Passed Changed TSX user-facing text is passed to t(), and structural/regex checks found no t() calls with variable keys.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@libs/ui-components/src/components/DetailsPage/Tables/ApplicationsTable.tsx`:
- Around line 125-151: Replace the non-interactive Label trigger in the
restart-loop Popover with a PatternFly Button, using t('Restart loop detected')
as its accessible name while preserving the warning styling and displayed
restarts value. Keep the existing Popover content and behavior unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 89b27c21-f9bb-43d0-a963-ed7803fb132a

📥 Commits

Reviewing files that changed from the base of the PR and between e17bc30 and 3550ffa.

⛔ Files ignored due to path filters (1)
  • libs/i18n/locales/en/translation.json is excluded by !libs/i18n/locales/en/translation.json
📒 Files selected for processing (3)
  • libs/ui-components/src/components/DetailsPage/Tables/ApplicationLifecycleActions.tsx
  • libs/ui-components/src/components/DetailsPage/Tables/ApplicationsTable.tsx
  • libs/ui-components/src/hooks/useRestartSpikes.ts

@celdrake
celdrake force-pushed the EDM-5034-show-restart-loop-warning branch from 3550ffa to 00a0ed2 Compare August 10, 2026 09:51
@celdrake
celdrake force-pushed the EDM-5034-show-restart-loop-warning branch from 00a0ed2 to 6ef0104 Compare August 10, 2026 13:52

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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)
libs/ui-components/src/components/DetailsPage/Tables/ApplicationLifecycleActions.tsx (1)

112-112: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use one status-aware stop predicate for all stop controls.

useRestartSpikes does not filter by status. For Starting or Preparing, the restart warnings expose Stop while the lifecycle dropdown hides it because those statuses are not in stoppableStatuses. Reuse the status-aware predicate for both controls.

🤖 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
`@libs/ui-components/src/components/DetailsPage/Tables/ApplicationLifecycleActions.tsx`
at line 112, Update the stop-control logic in ApplicationLifecycleActions so
both the lifecycle dropdown and useRestartSpikes restart warnings use the same
canStop status-aware predicate. Ensure Starting and Preparing consistently
follow that predicate instead of allowing the restart warnings to expose Stop
independently.
🤖 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
`@libs/ui-components/src/components/DetailsPage/Tables/ApplicationLifecycleActions.tsx`:
- Line 112: Update the stop-control logic in ApplicationLifecycleActions so both
the lifecycle dropdown and useRestartSpikes restart warnings use the same
canStop status-aware predicate. Ensure Starting and Preparing consistently
follow that predicate instead of allowing the restart warnings to expose Stop
independently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: f25c4231-4b2b-48be-9fd5-545d6d847445

📥 Commits

Reviewing files that changed from the base of the PR and between 00a0ed2 and 6ef0104.

📒 Files selected for processing (1)
  • libs/ui-components/src/components/DetailsPage/Tables/ApplicationLifecycleActions.tsx

@celdrake
celdrake merged commit 51bac50 into flightctl:main Aug 10, 2026
10 checks passed
@celdrake
celdrake deleted the EDM-5034-show-restart-loop-warning branch August 10, 2026 14:02
celdrake added a commit to celdrake/flightctl-ui that referenced this pull request Aug 11, 2026
Made-with: Cursor
(cherry picked from commit 51bac50)
celdrake added a commit that referenced this pull request Aug 11, 2026
* Bump fast-uri from 3.1.4 to 3.1.5 (#759)

Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/fastify/fast-uri/releases)
- [Commits](fastify/fast-uri@v3.1.4...v3.1.5)

Made-with: Cursor

---
updated-dependencies:
- dependency-name: fast-uri
  dependency-version: 3.1.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit e17bc30)

* EDM-4999: Redefine which statuses allow start/stop actions (#763)

Made-with: Cursor
(cherry picked from commit a5959d8)

* EDM-4987: Do not send wrong frame that causes the session logout (#760)

Made-with: Cursor
(cherry picked from commit ae99129)

* EDM-5034: Show restart app loop warnings (#764)

Made-with: Cursor
(cherry picked from commit 51bac50)

* EDM-4888: Enable the restart action on success (#762)

Made-with: Cursor
(cherry picked from commit 0e19b12)

* EDM-4726: Explain updated behaviour for VM apps (#766)

Made-with: Cursor

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

2 participants