Skip to content

fix(web): the application badge follows its replicas once a deployment succeeded - #376

Merged
samuelmbabhazi merged 3 commits into
mainfrom
fix/366-status-badge
Nov 20, 2026
Merged

samuelmbabhazi merged 3 commits into
mainfrom
fix/366-status-badge

Conversation

@samuelmbabhazi

@samuelmbabhazi samuelmbabhazi commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

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:

  • 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]>
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

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.”

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

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Minimal · previous review 1507a

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: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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 Passed [#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 Passed 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
Recent review info

Run configuration

Commits

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.

@samuelmbabhazi
samuelmbabhazi merged commit 22c4b45 into main Nov 20, 2026
22 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the fix/366-status-badge branch November 20, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Application badge says online when no replica is running

1 participant