Conversation
…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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fix(config): Use dynamic OAuth provider discovery from environment variables
overrideOAuthProvidersfunction was only looking for providers already in the config map with hardcoded names (google, github, microsoft)envutil.DiscoverProvidersto dynamically find all OAuth providers from environment variablesfix(api): Add UserPreference model to
GetAllModels()for migrationsGetAllModels()function inapi/store.gowas missingUserPreference, causing theuser_preferencestable to not be created during GORM AutoMigrateGetAllModels()withAllModels()inapi/models/models.go(25 models)Test plan
make lint)make build-server)make test-unit)[GITHUB GOOGLE MICROSOFT]✅ Schema validation PASSED! Tables found: 25/25🤖 Generated with Claude Code