Skip to content

feat: add PubsubReport to healthsdk HealthcheckReport - #31620

Merged
spikecurtis merged 3 commits into
mainfrom
spike/gru-100-pubsub-healthsdk
Nov 13, 2026
Merged

spikecurtis merged 3 commits into
mainfrom
spike/gru-100-pubsub-healthsdk

Conversation

@spikecurtis

@spikecurtis spikecurtis commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Adds pubsub to the deployment health report types in healthsdk:

  • New top-level pubsub section (PubsubReport) in HealthcheckReport. It embeds BaseReport and adds one field, backend (string).
  • New HealthSectionPubsub constant, added to HealthSections so the section can be dismissed.
  • HealthcheckReport.Summarize includes pubsub errors and warnings, which coder support bundle prints.

This is the first PR in a stack for GRU-100. It only changes the SDK and the files generated from it (Swagger, API docs, typesGenerated.ts), plus the two frontend health mocks that need the new required field. The server does not fill in this section yet. That comes in a follow-up PR.

Plan
  • Add PubsubReport { BaseReport; Backend string } to codersdk/healthsdk.
  • Add Pubsub PubsubReport \json:"pubsub"`toHealthcheckReport`.
  • Add HealthSectionPubsub and include it in HealthSections.
  • Include Pubsub in HealthcheckReport.Summarize, with test coverage.
  • Regenerate TS types, Swagger and API docs.
  • Follow-up PRs: populate the report in coderd/healthcheck (including severity and dismissal handling) and update the health UI.

Generated by Coder Agents on behalf of @spikecurtis.

@linear-code

linear-code Bot commented Nov 2, 2026

Copy link
Copy Markdown

GRU-100

@spikecurtis
spikecurtis added this pull request to stack #31622 November 2, 2026 13:38
@spikecurtis
spikecurtis marked this pull request as ready for review November 5, 2026 13:47
@spikecurtis
spikecurtis requested a review from cstyan November 5, 2026 13:47
@spikecurtis
spikecurtis force-pushed the spike/gru-100-pubsub-healthsdk branch 2 times, most recently from 14d1723 to ad04cd8 Compare November 5, 2026 14:49
@spikecurtis
spikecurtis force-pushed the spike/gru-100-pubsub-healthsdk branch from ad04cd8 to 0c97d2c Compare November 12, 2026 13:09
@spikecurtis
spikecurtis temporarily deployed to main November 12, 2026 13:09 — with GitHub Actions Inactive
bpmct added a commit that referenced this pull request Nov 12, 2026
…the wait (#32097)

The doc-check chat keeps running in Coder after the job stops waiting at
40 minutes, and it posts its own comment when it is done. When the local
model is busy, reviews run past the wait and the check goes red even
though nothing failed. 33 of 46 doc-check runs today ended red this way,
including on #32088, #31788, #31621 and #31620.

## Changes

- `continue-on-error` on the agents-chat-action step.
- New step that ends with a notice when the wait timed out and the chat
is still `running` or `pending`, and fails the job for every other
error.

Generated by Coder Agents on behalf of @bpmct.

@cstyan cstyan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this just needs a merge in of main/a rebase for make gen to pass

Adds a top-level pubsub section to the deployment health report with
the common BaseReport fields and the pubsub backend name. The server
does not populate it yet; that follows in a stacked PR.
Adds HealthSectionPubsub to HealthSections so the pubsub check can be
dismissed, and includes the pubsub report in HealthcheckReport.Summarize.
@spikecurtis
spikecurtis force-pushed the spike/gru-100-pubsub-healthsdk branch from 0c97d2c to 36bc2fb Compare November 13, 2026 15:43
@spikecurtis
spikecurtis temporarily deployed to main November 13, 2026 15:43 — with GitHub Actions Inactive
@spikecurtis
spikecurtis temporarily deployed to docs-preview November 13, 2026 15:46 — with GitHub Actions Inactive
@spikecurtis
spikecurtis temporarily deployed to main November 13, 2026 15:53 — with GitHub Actions Inactive
@spikecurtis
spikecurtis temporarily deployed to docs-preview November 13, 2026 15:57 — with GitHub Actions Inactive
@spikecurtis
spikecurtis merged commit 2187ecd into main Nov 13, 2026
33 of 35 checks passed
@spikecurtis
spikecurtis deleted the spike/gru-100-pubsub-healthsdk branch November 13, 2026 16:20
@spikecurtis
spikecurtis temporarily deployed to docs-preview November 13, 2026 16:20 — with GitHub Actions Inactive
@spikecurtis
spikecurtis temporarily deployed to main November 13, 2026 16:20 — with GitHub Actions Inactive
spikecurtis added a commit that referenced this pull request Nov 13, 2026
Fills in the `pubsub` section of the deployment health report on the
server. Stacked on #31620.

- New `pubsub.ReportingPubsub` interface: `Pubsub` plus
`HealthReport(ctx) healthsdk.PubsubReport`. The `Pubsub` interface
itself is unchanged.
- The PostgreSQL, NATS and in-memory backends implement it. Each reports
its backend name (`postgres`, `nats` or `memory`) and its connection
state:
- **PostgreSQL:** tracks the `pq` listener's connected state from its
event callback. When it's not connected, the report has severity
`warning` and `EPS01`.
- **NATS:** warns with `EPS02` if the embedded server isn't `Running()`,
and with `EPS01` for each publish or subscribe connection whose
`Status()` isn't `CONNECTED`.
  - **In-memory:** always `ok`.
- `coderd.Options.Pubsub` is now a `ReportingPubsub`.
`ReplicaSyncPubsub` stays a plain `Pubsub`.
- `coderd/healthcheck` has a new `Pubsub` check, which counts toward
`healthy` and the overall severity like the other sections.
`formatHealthcheck` applies the dismissed setting for it.
- New health codes `EPS01` (not connected) and `EPS02` (embedded NATS
server not running), documented in
`docs/admin/monitoring/health-check.md`.
- Test helpers follow the type change: `coderdtest.Options.Pubsub` and
the pubsub returned by `dbtestutil.NewDB` are now `ReportingPubsub`, and
a few test wrappers embed `ReportingPubsub` instead of `Pubsub`.

<details>
<summary>Decision log</summary>

- `HealthReport` returns a `healthsdk.PubsubReport` rather than filling
one in place. This matches the `healthcheck.Checker` methods. `ctx` is
unused for now.
- The healthcheck layer sets `Dismissed`, so backends don't need to know
about health settings.
- Problems are reported as warnings, not errors, so they show on the
health page without marking the deployment unhealthy. Both backends
reconnect on their own.
- Postgres connection state comes from the listener event callback, not
from `pq.Listener.Ping`, so the health check doesn't do database I/O.
Closing the pubsub also marks it disconnected.
- NATS `conn` gains `Status()`, which `*natsgo.Conn` already implements.
The pools are immutable after construction, so `HealthReport` reads them
without locking.
- The docs say the pubsub section appears in the JSON response, because
the health UI doesn't show it until a later PR in this stack.
- psmock is not regenerated: none of its users pass it to coderd.

</details>

---
Generated by Coder Agents on behalf of @spikecurtis.
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 13, 2026

This branch was previously deployed

2 inactive deployments
docs-preview — c3c8ae51 Deployed Nov 13, 2026 by spikecurtis via cleanup #39
main — c3c8ae51 Deployed Nov 13, 2026 by spikecurtis via cla #256699
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants