Skip to content

Conversation

@ericfitz
Copy link
Owner

Summary

  • fix(config): Use dynamic OAuth provider discovery from environment variables

    • The overrideOAuthProviders function was only looking for providers already in the config map with hardcoded names (google, github, microsoft)
    • When no YAML config file was loaded (as on Heroku), the providers map was empty and no providers were discovered
    • Now uses envutil.DiscoverProviders to dynamically find all OAuth providers from environment variables
  • fix(api): Add UserPreference model to GetAllModels() for migrations

    • The GetAllModels() function in api/store.go was missing UserPreference, causing the user_preferences table to not be created during GORM AutoMigrate
    • Aligns GetAllModels() with AllModels() in api/models/models.go (25 models)

Test plan

  • Lint passes (make lint)
  • Build succeeds (make build-server)
  • Unit tests pass (make test-unit)
  • Deployed to Heroku and verified:
    • OAuth providers discovered: [GITHUB GOOGLE MICROSOFT]
    • Schema validation: ✅ Schema validation PASSED! Tables found: 25/25
    • Server running and responding to requests

🤖 Generated with Claude Code

ericfitz and others added 2 commits January 26, 2026 21:47
…riables

The overrideOAuthProviders function was only looking for providers that
already existed in the config map with hardcoded names (google, github,
microsoft). When no YAML config file was loaded (as on Heroku), the
providers map was empty and no providers would be discovered.

This change makes overrideOAuthProviders work like overrideSAMLProviders
by using envutil.DiscoverProviders to dynamically find all OAuth
providers from environment variables matching the pattern
OAUTH_PROVIDERS_<ID>_ENABLED.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The GetAllModels() function in api/store.go was missing the
UserPreference model, which caused the user_preferences table
to not be created during GORM AutoMigrate on server startup.

This aligns GetAllModels() with AllModels() in api/models/models.go
which has all 25 models including UserPreference.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dosubot dosubot bot added the bug Something isn't working label Jan 27, 2026
Staticcheck SA5011 warns about possible nil pointer dereference even
after t.Fatal() because it doesn't understand that t.Fatal terminates
execution. Adding explicit return statements after t.Fatal() makes the
control flow clear to the linter.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ericfitz ericfitz merged commit 7ad15a4 into main Jan 27, 2026
7 checks passed
@ericfitz ericfitz deleted the fix/heroku-deployment-issues branch January 27, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants