Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: log the OAuth2 provider state and registered apps at startup - #29267

Draft
BobbyHo wants to merge 1 commit into
plat-492-3-deprecate-experimentfrom
plat-492-4-startup-lines
Draft

feat: log the OAuth2 provider state and registered apps at startup#29267
BobbyHo wants to merge 1 commit into
plat-492-3-deprecate-experimentfrom
plat-492-4-startup-lines

Conversation

@BobbyHo

@BobbyHo BobbyHo commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Fourth of five for PLAT-492. Every coder server start logs whether the OAuth2 provider is enabled, naming CODER_OAUTH2_PROVIDER_ENABLE. If the provider is off but applications are still registered, one warning gives the count and the flag to set.

PR What it does
#29248 Adds the flag, a public build info field, and the test default.
#29251 Gates the OAuth2 routes and dashboard navigation on the flag.
#29257 Makes the oauth2 experiment a no-op with a startup warning.
this Logs the provider state and any registered apps at startup.
#29268 Docs.

Implementation Details
  • coderd.LogOAuth2ProviderState logs oauth2 provider enabled or oauth2 provider disabled at info with a flag field.
  • When disabled, it lists apps with the existing GetOAuth2ProviderApps under a system context and warns with the count. A query error is logged at warn and startup continues.
  • cli/server.go calls it once after the database connects, before coderd.New.
  • TestServer/SpammyLogs allows two more rows. The new line wraps to two rows at 80 columns.
Tests
  • TestLogOAuth2ProviderState runs a dbmock table: enabled, disabled with zero apps, disabled with two apps, and a query error. Each case asserts exactly one info line and the expected warnings.
  • The enabled case sets no mock expectation, so any query while the provider is on fails the test.

Every coder server start logs one info line stating whether the OAuth2
provider is enabled, naming CODER_OAUTH2_PROVIDER_ENABLE. When the
provider is disabled and applications are still registered, one warning
gives the count and the flag to set. A failed query is logged and does
not abort startup.

The SpammyLogs test allows two more rows for the new line.
@linear-code

linear-code Bot commented Sep 12, 2026

Copy link
Copy Markdown

PLAT-492

@BobbyHo

BobbyHo commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

/coder-agents-review

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.

1 participant