Skip to content

Commit

Permalink
feat(vdp): skip google drive for cloud version (#899)
Browse files Browse the repository at this point in the history
Because

- we want to hide google drive in cloud before we get drive.readonly
scope from Google

This commit

- hide google drive in cloud version
  • Loading branch information
chuang8511 authored Dec 2, 2024
1 parent 9211ba7 commit 5089397
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ import (
miniox "github.com/instill-ai/x/minio"
)

const (
EditionLocalCE = "local-ce:dev"
EditionCloudDev = "cloud:dev"
EditionCloudStaging = "cloud:staging"
EditionCloudProd = "cloud:prod"
)

// Config - Global variable to export
var Config AppConfig

Expand Down
7 changes: 6 additions & 1 deletion pkg/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,14 @@ func (r *repository) ListComponentDefinitionUIDs(_ context.Context, p ListCompon
Where(where, whereArgs...).
Where("is_visible IS TRUE")

if config.Config.Server.Edition == "local-ce:dev" {

// TODO: refactor it with store.go in ins-7031
if config.Config.Server.Edition == config.EditionLocalCE {
skipComponentsInCE := []string{"instill-app"}
queryBuilder = queryBuilder.Where("id NOT IN (?)", skipComponentsInCE)
} else if config.Config.Server.Edition == config.EditionCloudStaging || config.Config.Server.Edition == config.EditionCloudProd {
skipComponentsInCloud := []string{"google-drive", "google-sheets"}
queryBuilder = queryBuilder.Where("id NOT IN (?)", skipComponentsInCloud)
}

queryBuilder.Count(&totalSize)
Expand Down

0 comments on commit 5089397

Please sign in to comment.