From 2cfb7be30a47cabf52a480c17921770ddee5e92a Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 5 May 2022 09:59:10 +0100 Subject: [PATCH] Re-enable gsheets for verification --- .../templates/app-service-deployment.yaml | 4 ++-- .../backend-core/src/featureFlags/index.js | 1 + .../server/src/api/controllers/integration.js | 11 +++-------- packages/server/yarn.lock | 18 +++++++++--------- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/charts/budibase/templates/app-service-deployment.yaml b/charts/budibase/templates/app-service-deployment.yaml index 3bbe718d73..98a949418c 100644 --- a/charts/budibase/templates/app-service-deployment.yaml +++ b/charts/budibase/templates/app-service-deployment.yaml @@ -114,8 +114,8 @@ spec: value: {{ .Values.globals.google.secret | quote }} - name: AUTOMATION_MAX_ITERATIONS value: {{ .Values.globals.automationMaxIterations | quote }} - - name: EXCLUDE_QUOTAS_TENANTS - value: {{ .Values.globals.excludeQuotasTenants | quote }} + - name: TENANT_FEATURE_FLAGS + value: {{ .Values.globals.tenantFeatureFlags | quote }} image: budibase/apps:{{ .Values.globals.appVersion }} imagePullPolicy: Always diff --git a/packages/backend-core/src/featureFlags/index.js b/packages/backend-core/src/featureFlags/index.js index 6d3d86978a..c050cbdfef 100644 --- a/packages/backend-core/src/featureFlags/index.js +++ b/packages/backend-core/src/featureFlags/index.js @@ -49,4 +49,5 @@ exports.getTenantFeatureFlags = tenantId => { exports.FeatureFlag = { LICENSING: "LICENSING", + GOOGLE_SHEETS: "GOOGLE_SHEETS", } diff --git a/packages/server/src/api/controllers/integration.js b/packages/server/src/api/controllers/integration.js index f3f3309c02..28748541c4 100644 --- a/packages/server/src/api/controllers/integration.js +++ b/packages/server/src/api/controllers/integration.js @@ -1,21 +1,16 @@ const { cloneDeep } = require("lodash") const { definitions } = require("../../integrations") -const { getTenantId } = require("@budibase/backend-core/tenancy") const { SourceNames } = require("../../definitions/datasource") const googlesheets = require("../../integrations/googlesheets") -const env = require("../../environment") +const { featureFlags } = require("@budibase/backend-core") exports.fetch = async function (ctx) { ctx.status = 200 const defs = cloneDeep(definitions) // for google sheets integration google verification - if (env.EXCLUDE_QUOTAS_TENANTS) { - const excludedTenants = env.EXCLUDE_QUOTAS_TENANTS.split(",") - const tenantId = getTenantId() - if (excludedTenants.includes(tenantId)) { - defs[SourceNames.GOOGLE_SHEETS] = googlesheets.schema - } + if (featureFlags.isEnabled(featureFlags.FeatureFlag.GOOGLE_SHEETS)) { + defs[SourceNames.GOOGLE_SHEETS] = googlesheets.schema } ctx.body = defs diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 35e9ce1387..42eff1b91e 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1014,10 +1014,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.138": - version "1.0.138" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.138.tgz#5297d6cf5b9ec8c15f0a6df4c7d8273b8ac900f0" - integrity sha512-1qN/5urKX8bBXwEz266Z94rco8dTI7VqIh75m8ZcqrAfoUpjvZJS76gZxfc5U/QWPwrgVFnLtYvnEjaLbGEflg== +"@budibase/backend-core@1.0.143-alpha.0": + version "1.0.143-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.143-alpha.0.tgz#08706bc59930b70b3d0415335af474b479522b59" + integrity sha512-3gaHmrms0ix8IDxjaB5JMBKn4uYfZDzf1MWDI6TyTmsYL36SN1HVYpNXxVGohjwm3xFzMkJ30hMFb/fIWPF8wA== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" @@ -1091,12 +1091,12 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.0.138": - version "1.0.138" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.138.tgz#cacbebe5ce93eb533af62a794a638944c2c61544" - integrity sha512-4ABlUZvl2h8sd8awJATf3KJeoFWV/8SoqdbKiH1ICdUcM/6dad7nhbJ15QqJL+Uuh/+mN2yEbr8V6Un2+yF+CA== +"@budibase/pro@1.0.143-alpha.0": + version "1.0.143-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.143-alpha.0.tgz#3e7418a911e20d6fb3e4eae7b02d728cec7e55df" + integrity sha512-R0aSoDFt15EKOflDVVpkJb9K1R9UiiAPigRAIjvY5st9ugAo9GJnfH3IiQYFPvMaWoobkOZROHnI0+ivc6GP3Q== dependencies: - "@budibase/backend-core" "1.0.138" + "@budibase/backend-core" "1.0.143-alpha.0" node-fetch "^2.6.1" "@budibase/standard-components@^0.9.139":