Skip to content

Commit

Permalink
wip: configure
Browse files Browse the repository at this point in the history
  • Loading branch information
avallete committed Nov 29, 2024
1 parent 4511b92 commit c3a9f62
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion internal/config/push/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func Run(ctx context.Context, ref string, fsys afero.Fs) error {
if err := utils.LoadConfigFS(fsys); err != nil {
return err
}
client := config.NewConfigUpdater(*utils.GetSupabase())
client := config.NewConfigUpdater(*utils.GetSupabase(), false)
remote, err := utils.Config.GetRemoteByProjectRef(ref)
if err != nil {
// Use base config when no remote is declared
Expand Down
26 changes: 13 additions & 13 deletions pkg/config/updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestUpdateApi(t *testing.T) {
require.NoError(t, err)

t.Run("updates remote config", func(t *testing.T) {
updater := NewConfigUpdater(*client)
updater := NewConfigUpdater(*client, false)
// Setup mock server
defer gock.Off()
gock.New(server).
Expand Down Expand Up @@ -46,7 +46,7 @@ func TestUpdateApi(t *testing.T) {
})

t.Run("skips update if no diff", func(t *testing.T) {
updater := NewConfigUpdater(*client)
updater := NewConfigUpdater(*client, false)
// Setup mock server
defer gock.Off()
gock.New(server).
Expand All @@ -71,7 +71,7 @@ func TestUpdateDbConfig(t *testing.T) {
require.NoError(t, err)

t.Run("updates remote DB config", func(t *testing.T) {
updater := NewConfigUpdater(*client)
updater := NewConfigUpdater(*client, false)
// Setup mock server
defer gock.Off()
gock.New(server).
Expand All @@ -96,7 +96,7 @@ func TestUpdateDbConfig(t *testing.T) {
})

t.Run("skips update if no diff in DB config", func(t *testing.T) {
updater := NewConfigUpdater(*client)
updater := NewConfigUpdater(*client, false)
// Setup mock server
defer gock.Off()
gock.New(server).
Expand All @@ -123,7 +123,7 @@ func TestUpdateExperimentalConfig(t *testing.T) {
require.NoError(t, err)

t.Run("enables webhooks", func(t *testing.T) {
updater := NewConfigUpdater(*client)
updater := NewConfigUpdater(*client, false)
// Setup mock server
defer gock.Off()
gock.New(server).
Expand All @@ -142,7 +142,7 @@ func TestUpdateExperimentalConfig(t *testing.T) {
})

t.Run("skips update if webhooks not enabled", func(t *testing.T) {
updater := NewConfigUpdater(*client)
updater := NewConfigUpdater(*client, false)
// Run test
err := updater.UpdateExperimentalConfig(context.Background(), "test-project", experimental{
Webhooks: &webhooks{
Expand All @@ -161,7 +161,7 @@ func TestUpdateAuthConfig(t *testing.T) {
require.NoError(t, err)

t.Run("updates remote Auth config", func(t *testing.T) {
updater := NewConfigUpdater(*client)
updater := NewConfigUpdater(*client, false)
// Setup mock server
defer gock.Off()
gock.New(server).
Expand All @@ -181,7 +181,7 @@ func TestUpdateAuthConfig(t *testing.T) {
})

t.Run("skips update if no diff in Auth config", func(t *testing.T) {
updater := NewConfigUpdater(*client)
updater := NewConfigUpdater(*client, false)
// Setup mock server
defer gock.Off()
gock.New(server).
Expand All @@ -201,7 +201,7 @@ func TestUpdateAuthConfig(t *testing.T) {
})

t.Run("skips update if disabled locally", func(t *testing.T) {
updater := NewConfigUpdater(*client)
updater := NewConfigUpdater(*client, false)
// Run test
err := updater.UpdateAuthConfig(context.Background(), "test-project", auth{})
// Check result
Expand All @@ -215,7 +215,7 @@ func TestUpdateStorageConfig(t *testing.T) {
require.NoError(t, err)

t.Run("updates remote Storage config", func(t *testing.T) {
updater := NewConfigUpdater(*client)
updater := NewConfigUpdater(*client, false)
// Setup mock server
defer gock.Off()
gock.New(server).
Expand All @@ -240,7 +240,7 @@ func TestUpdateStorageConfig(t *testing.T) {
})

t.Run("skips update if no diff in Storage config", func(t *testing.T) {
updater := NewConfigUpdater(*client)
updater := NewConfigUpdater(*client, false)
// Setup mock server
defer gock.Off()
gock.New(server).
Expand All @@ -255,7 +255,7 @@ func TestUpdateStorageConfig(t *testing.T) {
})

t.Run("skips update if disabled locally", func(t *testing.T) {
updater := NewConfigUpdater(*client)
updater := NewConfigUpdater(*client, false)
// Run test
err := updater.UpdateStorageConfig(context.Background(), "test-project", storage{})
// Check result
Expand All @@ -269,7 +269,7 @@ func TestUpdateRemoteConfig(t *testing.T) {
require.NoError(t, err)

t.Run("updates all configs", func(t *testing.T) {
updater := NewConfigUpdater(*client)
updater := NewConfigUpdater(*client, false)
// Setup mock server
defer gock.Off()
// API config
Expand Down

0 comments on commit c3a9f62

Please sign in to comment.