-
Notifications
You must be signed in to change notification settings - Fork 1.5k
refactor!: drop chat_model_configs provider column #26877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -657,11 +657,6 @@ func (s *MethodTestSuite) TestChats() { | |
| dbm.EXPECT().DeleteChatModelConfigByID(gomock.Any(), id).Return(nil).AnyTimes() | ||
| check.Args(id).Asserts(rbac.ResourceDeploymentConfig, policy.ActionUpdate) | ||
| })) | ||
| s.Run("DeleteChatModelConfigsByProvider", s.Mocked(func(dbm *dbmock.MockStore, _ *gofakeit.Faker, check *expects) { | ||
| providerName := "test-provider" | ||
| dbm.EXPECT().DeleteChatModelConfigsByProvider(gomock.Any(), providerName).Return(nil).AnyTimes() | ||
| check.Args(providerName).Asserts(rbac.ResourceDeploymentConfig, policy.ActionUpdate) | ||
| })) | ||
| s.Run("DeleteChatModelConfigsByAIProviderID", s.Mocked(func(dbm *dbmock.MockStore, _ *gofakeit.Faker, check *expects) { | ||
| providerID := uuid.New() | ||
| dbm.EXPECT().DeleteChatModelConfigsByAIProviderID(gomock.Any(), providerID).Return(nil).AnyTimes() | ||
|
|
@@ -1212,10 +1207,10 @@ func (s *MethodTestSuite) TestChats() { | |
| check.Args(config.ID).Asserts(rbac.ResourceDeploymentConfig, policy.ActionRead).Returns(config) | ||
| })) | ||
| s.Run("GetEnabledChatModelConfigs", s.Mocked(func(dbm *dbmock.MockStore, faker *gofakeit.Faker, check *expects) { | ||
| configA := testutil.Fake(s.T(), faker, database.ChatModelConfig{}) | ||
| configB := testutil.Fake(s.T(), faker, database.ChatModelConfig{}) | ||
| dbm.EXPECT().GetEnabledChatModelConfigs(gomock.Any()).Return([]database.ChatModelConfig{configA, configB}, nil).AnyTimes() | ||
| check.Args().Asserts(rbac.ResourceDeploymentConfig, policy.ActionRead).Returns([]database.ChatModelConfig{configA, configB}) | ||
| rowA := testutil.Fake(s.T(), faker, database.GetEnabledChatModelConfigsRow{}) | ||
| rowB := testutil.Fake(s.T(), faker, database.GetEnabledChatModelConfigsRow{}) | ||
|
Comment on lines
+1210
to
+1211
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Why the naming change from
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kept
|
||
| dbm.EXPECT().GetEnabledChatModelConfigs(gomock.Any()).Return([]database.GetEnabledChatModelConfigsRow{rowA, rowB}, nil).AnyTimes() | ||
| check.Args().Asserts(rbac.ResourceDeploymentConfig, policy.ActionRead).Returns([]database.GetEnabledChatModelConfigsRow{rowA, rowB}) | ||
| })) | ||
|
|
||
| s.Run("GetStaleChats", s.Mocked(func(dbm *dbmock.MockStore, faker *gofakeit.Faker, check *expects) { | ||
|
|
@@ -1257,12 +1252,11 @@ func (s *MethodTestSuite) TestChats() { | |
| })) | ||
| s.Run("InsertChatModelConfig", s.Mocked(func(dbm *dbmock.MockStore, faker *gofakeit.Faker, check *expects) { | ||
| arg := database.InsertChatModelConfigParams{ | ||
| Provider: "test-provider", | ||
| Model: "test-model", | ||
| DisplayName: "Test Model", | ||
| Enabled: true, | ||
| } | ||
| config := testutil.Fake(s.T(), faker, database.ChatModelConfig{Provider: arg.Provider, Model: arg.Model, DisplayName: arg.DisplayName, Enabled: arg.Enabled}) | ||
| config := testutil.Fake(s.T(), faker, database.ChatModelConfig{Model: arg.Model, DisplayName: arg.DisplayName, Enabled: arg.Enabled}) | ||
| dbm.EXPECT().InsertChatModelConfig(gomock.Any(), arg).Return(config, nil).AnyTimes() | ||
| check.Args(arg).Asserts(rbac.ResourceDeploymentConfig, policy.ActionUpdate).Returns(config) | ||
| })) | ||
|
|
@@ -1515,7 +1509,6 @@ func (s *MethodTestSuite) TestChats() { | |
| config := testutil.Fake(s.T(), faker, database.ChatModelConfig{}) | ||
| arg := database.UpdateChatModelConfigParams{ | ||
| ID: config.ID, | ||
| Provider: "updated-provider", | ||
| Model: "updated-model", | ||
| DisplayName: "Updated Model", | ||
| Enabled: true, | ||
|
|
@@ -6859,14 +6852,6 @@ func (s *MethodTestSuite) TestAIBridge() { | |
| dbm.EXPECT().DeleteAIProviderByID(gomock.Any(), provider.ID).Return(nil).AnyTimes() | ||
| check.Args(provider.ID).Asserts(rbac.ResourceAIProvider, policy.ActionDelete).Returns() | ||
| })) | ||
| s.Run("BackfillChatModelConfigProvider", s.Mocked(func(dbm *dbmock.MockStore, _ *gofakeit.Faker, check *expects) { | ||
| arg := database.BackfillChatModelConfigProviderParams{ | ||
| OldProvider: "anthropic", | ||
| NewProvider: "bedrock", | ||
| } | ||
| dbm.EXPECT().BackfillChatModelConfigProvider(gomock.Any(), arg).Return(nil, nil).AnyTimes() | ||
| check.Args(arg).Asserts(rbac.ResourceDeploymentConfig, policy.ActionUpdate) | ||
| })) | ||
| s.Run("UpdateEncryptedAIProviderSettings", s.Mocked(func(dbm *dbmock.MockStore, faker *gofakeit.Faker, check *expects) { | ||
| provider := testutil.Fake(s.T(), faker, database.AIProvider{}) | ||
| arg := database.UpdateEncryptedAIProviderSettingsParams{ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewer note: added in v2.34.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No change needed.
BackfillChatModelConfigProviderStrings(v2.34.0) only repaired thechat_model_configs.providertext column that this PR drops. Migration 000534 justDROP COLUMN providerand never reads it;ai_provider_idis populated independently. So an upgrade that skips v2.34 is harmless: the data the backfill repaired is being removed.