Skip to content

feat: show valid/total relations count in status after haproxy-route reconciliation#559

Open
Copilot wants to merge 4 commits into
mainfrom
copilot/show-valid-relations-haproxy
Open

feat: show valid/total relations count in status after haproxy-route reconciliation#559
Copilot wants to merge 4 commits into
mainfrom
copilot/show-valid-relations-haproxy

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What this PR does

After haproxy-route reconciliation, displays a unified count of valid vs total relations (combining both haproxy-route and haproxy-route-tcp) in the unit's ActiveStatus message. Example output:

active: 2/3 valid relations

When no relations exist, the status message is empty.

Changes:

  • _configure_haproxy_route now returns a status message string
  • Added _get_haproxy_route_status_message helper that computes combined valid/total across both haproxy-route and haproxy-route-tcp using relation_ids_with_invalid_data and relation_ids_with_invalid_data_tcp
  • _reconcile passes the message to ActiveStatus

Why we need it

Operators currently have no visibility into which haproxy-route/haproxy-route-tcp relations are valid after config reconciliation. This makes debugging misconfigured requirers harder than necessary.

Test plan

  • Updated existing unit tests (test_spoe_auth, test_two_spoe_auth) to assert the new status message format
  • Full unit test suite passes

Review focus

  • Status message format: "x/y valid relations" — single combined count for both interfaces
  • Edge case: when no relations exist at all, the message is empty

Checklist

  • I followed the contributing guide
  • I added or updated the documentation (if applicable)
  • I updated docs/changelog.md with user-relevant changes
  • I added a change artifact for user-relevant changes in docs/release-notes/artifacts. If no change artifact is necessary, I tagged the PR with the label no-release-note.
  • I used AI to assist with preparing this PR
  • I added or updated tests as needed (unit and integration)
  • If integration test modules are used: I updated the workflow configuration
    (e.g., in .github/workflows/integration_tests.yaml, ensure the modules list is correct)
  • If this PR involves a Grafana dashboard: I added a screenshot of the dashboard
  • If this PR involves Terraform: terraform fmt passes and tflint reports no errors

…reconciliation

After reconciling haproxy-route and haproxy-route-tcp configurations,
the unit status now displays how many relations are valid vs total,
e.g. "2/3 haproxy-route, 1/1 haproxy-route-tcp".

Closes #558
Copilot AI changed the title [WIP] Show valid relations count after reconciliation for haproxy route feat: show valid/total relations count in status after haproxy-route reconciliation Jun 16, 2026
Copilot AI requested a review from Thanhphan1147 June 16, 2026 10:10
Comment thread haproxy-operator/src/charm.py Outdated
Show a unified "x/y valid relations" message instead of separate
counts per interface type.
@Thanhphan1147 Thanhphan1147 marked this pull request as ready for review June 22, 2026 05:53
@Thanhphan1147 Thanhphan1147 requested a review from a team as a code owner June 22, 2026 05:53
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