You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): the application badge follows its replicas once a deployment succeeded - #376
On the application page, once the latest deployment succeeded, the header badge comes from the replicas, from the same list as the "n of m replicas running" line:
no replica running: not running (red), French "ne tourne pas";
some running: degraded (amber), French "dégradée";
all running: live, as before.
Any other deployment state (deploying, failed, stopping, stopped) keeps its badge. Until the replica list has loaded, the badge shows the deployment's status, as today.
Why
The badge said "online" while the line under it said "0 of 1 replicas running", for example after the agent stopped the only replica for its disk budget.
How it was tested
servingStatus unit test (0 of 1, 0 of 0, 1 of 3, 3 of 3).
Page tests: an exited replica gives "not running" next to "0 of 1 replicas running"; one of two gives "degraded"; two of two give "live".
web:test (208) and web:lint: green.
Security considerations
Display only.
Not in this pull request
The applications list in an environment still shows the latest deployment's status: it does not load replicas. A follow-up can add a replica summary to the list endpoint.
Summary by CodeRabbit
New Features
Application status now reflects replica availability after deployment. The status shows Live when all replicas are running, Degraded when only some are running, and Not running when none are running.
French translations are available for the Degraded and Not running statuses.
…t succeeded
A succeeded deployment no longer says live when no replica runs: the badge says not running or degraded, from the same replica list as the line under it (#366).
Signed-off-by: samuel mbabhazi <[email protected]>
Reviewing files that changed from the base of the PR and between a905e96 and de6e16d.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The application headline now reflects replica counts when the latest deployment is live and replica data is ready. New status labels distinguish applications with no running replicas from those with partial or full replica availability.
Changes: Replica-aware application status
Layer / File(s)
Summary
Replica status mapping apps/web/src/app/dashboard/format.ts, apps/web/src/app/dashboard/format.spec.ts
servingStatus returns “not running” for zero running replicas, “degraded” when fewer than the configured count are running, and “live” otherwise. Unit tests cover zero, partial, and full counts.
Application headline and coverage apps/web/src/app/delivery/application-page.ts, apps/web/src/app/delivery/delivery-pages.spec.ts, apps/web/src/app/ui/fr.ts
The headline returns no status without a latest deployment. For a live deployment with ready replica data, it uses the replica counts to determine status. Delivery tests cover the badge and replica count; French translations are added for “degraded” and “not running.”
The application badge now shows not running, degraded, or live according to replica counts once a deployment has succeeded. The change is display-only and covered by tests, including French labels, and no concrete merge risk was identified.
Security architecture risk: Minimal · up to 1507a
The change updates a status badge using data the page already loads. No introduced or worsened risk to security, failure containment, rollback, or ownership was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: the application badge on the application page now follows the replica list once a deployment has succeeded. It matches the changed files (servingStatus in format.ts, t…
Linked Issues check
[#366] requires the application-page header badge to stop saying "online" when no replica runs, and to match the replica count. In apps/web/src/app/delivery/application-page.ts, the headline computed …
Out of Scope Changes check
All changes serve #366. The servingStatus function and its unit test in format.ts and format.spec.ts, the headline change in application-page.ts, the page tests in delivery-pages.spec.ts, and the Fren…
Full details: Title check
Explanation
The title names the main change: the application badge on the application page now follows the replica list once a deployment has succeeded. It matches the changed files (servingStatus in format.ts, the headline logic in application-page.ts, and the related tests and French translations) and the linked objectives (issue #366). The title is specific and concise, and it does not use vague terms.
Full details: Linked Issues check
Explanation
[#366] requires the application-page header badge to stop saying "online" when no replica runs, and to match the replica count. In apps/web/src/app/delivery/application-page.ts, the headline computed now calls servingStatus(this.running(), this.replicas.items().length) when the deployment status is live and the replica list is ready. servingStatus in apps/web/src/app/dashboard/format.ts returns "not running" (red) for zero running, "degraded" (amber) for some running, and "live" (green) otherwise. The badge and the "n of m replicas running" line both use the same replica list. The change does not depend on the disk limit, so it covers any application whose replicas all exited, as the issue asks. Page tests cover 0 of 1, 1 of 2, and 2 of 2. Before the replica list loads, the badge shows the deployment status. This is a transient state and the issue does not address it directly. The environment applications list is excluded by the issue and the PR description. No unmet coding requirement is found.
Full details: Out of Scope Changes check
Explanation
All changes serve #366. The servingStatus function and its unit test in format.ts and format.spec.ts, the headline change in application-page.ts, the page tests in delivery-pages.spec.ts, and the French labels "dégradée" and "ne tourne pas" in ui/fr.ts all implement or verify the application-page badge. The PR does not modify the environment applications list, which the issue and PR description exclude. No unrelated change is found in the reviewed diff hunks.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Fix failing CI checks
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between a9f2cf2 and 1507acb.
Files selected for processing: 5
apps/web/src/app/dashboard/format.spec.ts
apps/web/src/app/dashboard/format.ts
apps/web/src/app/delivery/application-page.ts
apps/web/src/app/delivery/delivery-pages.spec.ts
apps/web/src/app/ui/fr.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #366.
What changed
On the application page, once the latest deployment succeeded, the header badge comes from the replicas, from the same list as the "n of m replicas running" line:
Any other deployment state (deploying, failed, stopping, stopped) keeps its badge. Until the replica list has loaded, the badge shows the deployment's status, as today.
Why
The badge said "online" while the line under it said "0 of 1 replicas running", for example after the agent stopped the only replica for its disk budget.
How it was tested
servingStatusunit test (0 of 1, 0 of 0, 1 of 3, 3 of 3).web:test(208) andweb:lint: green.Security considerations
Display only.
Not in this pull request
The applications list in an environment still shows the latest deployment's status: it does not load replicas. A follow-up can add a replica summary to the list endpoint.
Summary by CodeRabbit