Skip to content

Fix deployment replica count reporting - #371

Open
AlexVulaj wants to merge 1 commit into
mainfrom
fix/218-replica-count-reporting
Open

AlexVulaj wants to merge 1 commit into
mainfrom
fix/218-replica-count-reporting

Conversation

@AlexVulaj

@AlexVulaj AlexVulaj commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #218

  • Report Deployment readiness as ready replicas versus the desired count, using .spec.replicas.
  • Show unset status counts as zero, so new Deployments report values such as 0/3 replicas ready.
  • Track replica state by count to avoid misleading progress messages when only the available count changes.

Summary by CodeRabbit

  • Bug Fixes
    • Deployment progress reports now compare ready and available replicas against the desired replica count, providing clearer status as deployments advance.
    • Availability is reported when the desired number of replicas is available. Changes to availability alone update deployment status without generating a new progress report.
    • Missing replica counts use sensible defaults, while invalid counts produce an error identifying the affected deployment and field.

@AlexVulaj
AlexVulaj requested a review from mclasmeier November 30, 2026 20:49
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review.

Walkthrough

Deployment progress reporting now tracks desired, ready, and available replica counts as integers. The deployer queries desired replicas from the deployment specification, parses replica counts, and reports progress or availability based on state changes. Tests cover initial, progressing, and available deployment states.

Changes: Deployment Progress Reporting

Layer / File(s) Summary
Replica state and reporting
internal/deployer/deployer.go, internal/deployer/deploy_via_operator.go, internal/deployer/deployment_progress_test.go
The deployer queries desired replicas from .spec.replicas and tracks desired, ready, and available counts. It reports progress or availability when the tracked state changes. Tests cover initial reporting, ready-count changes, available-count-only changes, and availability.

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

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: mclasmeier

Merge Risk: Minimal · up to b3803

Deployment progress messages now report ready replicas against the desired count, and unset counts show as zero. The change is confined to log reporting and does not affect whether a wait completes. Merge risk is minimal.

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 "Fix deployment replica count reporting" matches the main change. The PR changes how Deployment progress is reported: it uses ready replicas against the desired count from .spec.replicas, de…
Linked Issues check Passed Issue #218 requires Deployment progress messages to show ready replicas against a desired total, and new Deployments must not show blank counts. The PR changes internal/deployer/deployer.go so that de…
Out of Scope Changes check Passed All changes relate to the replica count reporting objective of #218. The changed files are internal/deployer/deployer.go (progress tracking, kubectl query, and the new parseReplicaCount helper), inter…
Full details: Title check

Explanation

The title "Fix deployment replica count reporting" matches the main change. The PR changes how Deployment progress is reported: it uses ready replicas against the desired count from .spec.replicas, defaults unset counts to zero, and tracks progress by replica counts so an available-only change does not log misleading progress. The title is specific and concise, and it does not use vague terms.

Full details: Linked Issues check

Explanation

Issue #218 requires Deployment progress messages to show ready replicas against a desired total, and new Deployments must not show blank counts. The PR changes internal/deployer/deployer.go so that desired replicas come from .spec.replicas. Missing ready and available counts default to 0, so a new Deployment reports 0/N. Progress is reported when a Deployment is first seen or when its ready or desired counts change. Availability is reported when available replicas meet the desired count. The summary of internal/deployer/deployment_progress_test.go describes a test that checks zero initial ready replicas, a ready-count change logged against desired replicas, a silent available-only change, and an availability message when all replicas are ready. The map type change in internal/deployer/deploy_via_operator.go supports this tracking. The issue has no other coding acceptance criteria. Limitation: the repository diff could not be read because changed blobs were unavailable, so this verdict relies on the supplied AI-generated summaries and the PR description, not on direct inspection of the changed hunks.

Full details: Out of Scope Changes check

Explanation

All changes relate to the replica count reporting objective of #218. The changed files are internal/deployer/deployer.go (progress tracking, kubectl query, and the new parseReplicaCount helper), internal/deployer/deploy_via_operator.go (map type change to deploymentProgress in waitForComponentReady), and internal/deployer/deployment_progress_test.go (new test coverage). No unrelated files or behavior changes appear in the supplied summaries. Limitation: the repository diff was unavailable, so the scope check relies on the supplied summaries and file list rather than direct inspection of every hunk.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: stackrox/roxie
  • Branch: main
  • File: .coderabbit.yml
  • Commit: d93f82b
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: c9fa4636-04a6-4011-8ea1-cad4d916b0d0
Commits

Reviewing files that changed from the base of the PR and between d93f82b and b38035e.

Files selected for processing: 3

  • internal/deployer/deploy_via_operator.go
  • internal/deployer/deployer.go
  • internal/deployer/deployment_progress_test.go

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@AlexVulaj
AlexVulaj requested a review from porridge November 30, 2026 20:49
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.

Improve replica count reporting

2 participants