Skip to content

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

Merged
celdrake merged 1 commit into
flightctl:mainfrom
celdrake:EDM-4888-enable-restart-action-after-success
Aug 10, 2026
Merged

EDM-4888: Enable the restart action on success#762
celdrake merged 1 commit into
flightctl:mainfrom
celdrake:EDM-4888-enable-restart-action-after-success

Conversation

@celdrake

@celdrake celdrake commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

When the user attempts to "Restart" an already started application, the Backend just signals the intent with a new annotation called restartGeneration, and there is no observable field in status (or the annotation itself) that can be used to understand when the action is in progress or finished.

Given this, we clear the action after an arbitrary timeout to signal that the action has been received and was triggered.

Summary

  • Shared UI components: Updated lifecycle handling in libs/ui-components/.
  • Restart actions now clear after RESTART_PENDING_TIMEOUT_MS when the backend provides no completion status.
  • Start actions now clear on Completed.
  • The lifecycle error alert title now reads “The requested action failed”.
  • The change affects shared UI behavior used by platform applications.
  • No changes affect libs/types/, libs/i18n/, libs/cypress/, app-specific code, the Go auth proxy, container builds, E2E tests, or CI configuration.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The lifecycle utilities now define restart timeout handling and recognize completed start actions. The lifecycle hook clears pending restart state after 500 ms. The lifecycle error alert title now states that the requested action failed.

Changes

Application lifecycle action handling

Layer / File(s) Summary
Restart pending-action timeout
libs/ui-components/src/utils/applicationLifecycle.ts, libs/ui-components/src/hooks/useApplicationLifecycle.ts
The utilities define a 500 ms restart timeout. The hook clears pending restart state and the recorded restart count after the timeout. Start actions now clear on Completed.
Lifecycle failure alert wording
libs/ui-components/src/components/DetailsPage/Tables/ApplicationLifecycleActions.tsx
The error alert title changed from “An error occurred” to “The requested action failed.”

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: ui-components, i18n

Suggested reviewers: jgyselov

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Generated-Files-Not-Hand-Edited ⚠️ Warning The PR directly modifies generated file libs/i18n/locales/en/translation.json by adding "The requested action failed". Regenerate the locale file with npm run i18n instead of editing libs/i18n/locales/en/translation.json directly.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: enabling the restart action after a successful restart request.
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 three changed TypeScript files contain no API keys, tokens, passwords, credentials, private keys, embedded-credential URLs, or long base64-like literals.
No-Weak-Crypto ✅ Passed The 31 added lines only change lifecycle UI state and timeout handling; scans found no MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB, custom crypto, or secret comparisons.
No-Injection-Vectors ✅ Passed The PR adds only a timeout, lifecycle logic, and a translated literal. No eval/exec, dangerouslySetInnerHTML, shell command, or YAML loader appears in changed lines.
Container-Privileges ✅ Passed The commit changes only UI TypeScript and translation files; its patch contains no privileged, host*, SYS_ADMIN, or allowPrivilegeEscalation settings, and no tracked container/K8s manifest adds them.
No-Sensitive-Data-In-Logs ✅ Passed The PR adds no logging calls. Added code only manages restart state, timeout cleanup, and UI text; no passwords, tokens, API keys, PII, hostnames, or customer data enter logs.
Resource-Leaks ✅ Passed PASS: The pull request changes only TypeScript and JSON files; no Go file under proxy/ is modified, so this resource-leak check is not applicable.
Unchecked-Errors ✅ Passed HEAD changes UI TypeScript and i18n JSON only; no Go files under proxy/ changed, so this unchecked-errors check is not applicable.
Ai-Attribution ✅ Passed The PR tip commit records Made-with: Cursor, an accepted AI attribution trailer, and contains no AI-related Co-Authored-By trailer.
I18n-Compliance ✅ Passed The only changed .tsx line uses t('The requested action failed'); all other literal UI strings in the component use hardcoded t() keys, with no variable translation keys found.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@celdrake
celdrake force-pushed the EDM-4888-enable-restart-action-after-success branch from bce14e8 to 6ebe4c6 Compare August 10, 2026 14:03

@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/utils/applicationLifecycle.ts`:
- Around line 161-166: Prevent duplicate restart requests in the lifecycle
restart flow by keeping an in-flight guard active until the application restart
actually completes, rather than allowing the 500 ms RESTART_PENDING_TIMEOUT_MS
cleanup to clear pendingAction while isSubmitting is false. Update the relevant
restart action state handling, and add a test that issues a second restart
request after the timeout but before completion and verifies it is rejected.
🪄 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: d3d50e57-c466-4668-8639-d9eced856a25

📥 Commits

Reviewing files that changed from the base of the PR and between bce14e8 and 6ebe4c6.

⛔ 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 (2)
  • libs/ui-components/src/components/DetailsPage/Tables/ApplicationLifecycleActions.tsx
  • libs/ui-components/src/utils/applicationLifecycle.ts

Comment thread libs/ui-components/src/utils/applicationLifecycle.ts
@celdrake
celdrake merged commit 0e19b12 into flightctl:main Aug 10, 2026
10 checks passed
@celdrake
celdrake deleted the EDM-4888-enable-restart-action-after-success branch August 10, 2026 14:10
celdrake added a commit to celdrake/flightctl-ui that referenced this pull request Aug 11, 2026
Made-with: Cursor
(cherry picked from commit 0e19b12)
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