diff --git a/cdk-infra/lib/constructs/worker/worker-env-construct.ts b/cdk-infra/lib/constructs/worker/worker-env-construct.ts index 8da11d4b7..9fb0a9778 100644 --- a/cdk-infra/lib/constructs/worker/worker-env-construct.ts +++ b/cdk-infra/lib/constructs/worker/worker-env-construct.ts @@ -65,6 +65,12 @@ export class WorkerEnvConstruct extends Construct { const jobCollection = StringParameter.valueFromLookup(this, `${ssmPrefix}/atlas/collections/job/queue`); const gatsbyMarianUrl = StringParameter.valueFromLookup(this, `${ssmPrefix}/frontend/marian_url`); const gatsbyEnableDarkMode = StringParameter.valueFromLookup(this, `${ssmPrefix}/frontend/enable_dark_mode`); + // Feature flag to render locales in the process of being translated. Might want to keep this while we continue to translate + // to new languages to avoid needing to keep moving this flag around + const gatsbyFeatureShowHiddenLocales = StringParameter.valueFromLookup( + this, + `${ssmPrefix}/flag/show_hidden_locales` + ); const dbPassword = secureStrings['MONGO_ATLAS_PASSWORD']; this.environment = { @@ -103,6 +109,7 @@ export class WorkerEnvConstruct extends Construct { GATSBY_MARIAN_URL: gatsbyMarianUrl, IS_FEATURE_BRANCH: getIsFeatureBranch(), GATSBY_ENABLE_DARK_MODE: gatsbyEnableDarkMode, + GATSBY_FEATURE_SHOW_HIDDEN_LOCALES: gatsbyFeatureShowHiddenLocales, }; } } diff --git a/config/custom-environment-variables.json b/config/custom-environment-variables.json index 79cc86db2..2eaf0c763 100644 --- a/config/custom-environment-variables.json +++ b/config/custom-environment-variables.json @@ -24,6 +24,7 @@ "featureFlagUpdatePages": "FEATURE_FLAG_UPDATE_PAGES", "featureFlagSearchUI": "GATSBY_TEST_SEARCH_UI", "gatsbyHideUnifiedFooterLocale": "GATSBY_HIDE_UNIFIED_FOOTER_LOCALE", + "gatsbyFeatureShowHiddenLocales": "GATSBY_FEATURE_SHOW_HIDDEN_LOCALES", "gatsbyMarianURL": "GATSBY_MARIAN_URL", "repoBranchesCollection": "REPO_BRANCHES_COL_NAME", "docsetsCollection": "DOCSETS_COL_NAME", diff --git a/infrastructure/ecs-main/ecs_service.yml b/infrastructure/ecs-main/ecs_service.yml index 1716b2114..ac3af22fa 100644 --- a/infrastructure/ecs-main/ecs_service.yml +++ b/infrastructure/ecs-main/ecs_service.yml @@ -70,6 +70,8 @@ Resources: Value: ${self:custom.gatsbyMarianURL} - Name: GATSBY_ENABLE_DARK_MODE Value: ${self:custom.gatsbyEnableDarkMode} + - Name: GATSBY_FEATURE_SHOW_HIDDEN_LOCALES + Value: ${self:custom.gatsbyFeatureShowHiddenLocales} - Name: GATSBY_HIDE_UNIFIED_FOOTER_LOCALE Value: ${self:custom.gatsbyHideUnifiedFooterLocale} - Name: FASTLY_MAIN_TOKEN diff --git a/infrastructure/ecs-main/serverless.yml b/infrastructure/ecs-main/serverless.yml index f3a25d85d..fc439bf9e 100644 --- a/infrastructure/ecs-main/serverless.yml +++ b/infrastructure/ecs-main/serverless.yml @@ -108,6 +108,7 @@ custom: gatsbyHideUnifiedFooterLocale: ${ssm:/env/${self:provider.stage}/docs/worker_pool/flag/hide_locale} gatsbyMarianURL: ${ssm:/env/${self:provider.stage}/docs/worker_pool/frontend/marian_url} gatsbyEnableDarkMode: ${ssm:/env/${self:provider.stage}/docs/worker_pool/frontend/enable_dark_mode} + gatsbyFeatureShowHiddenLocales: ${ssm:/env/${self:provider.stage}/docs/worker_pool/flag/show_hidden_locales} fastlyMainToken: ${ssm:/env/${self:provider.stage}/docs/worker_pool/fastly/docs/main/token} fastlyMainServiceId: ${ssm:/env/${self:provider.stage}/docs/worker_pool/fastly/docs/main/service_id} fastlyCloudManagerToken: ${ssm:/env/${self:provider.stage}/docs/worker_pool/fastly/docs/cloudmanager/token} diff --git a/src/job/jobHandler.ts b/src/job/jobHandler.ts index 497bfa502..4425d8d36 100644 --- a/src/job/jobHandler.ts +++ b/src/job/jobHandler.ts @@ -414,6 +414,7 @@ export abstract class JobHandler { GATSBY_HIDE_UNIFIED_FOOTER_LOCALE: this._config.get('gatsbyHideUnifiedFooterLocale'), GATSBY_MARIAN_URL: this._config.get('gatsbyMarianURL'), GATSBY_ENABLE_DARK_MODE: this._config.get('gatsbyEnableDarkMode'), + GATSBY_FEATURE_SHOW_HIDDEN_LOCALES: this._config.get('gatsbyFeatureShowHiddenLocales'), }; for (const [envName, envValue] of Object.entries(snootyFrontEndVars)) { diff --git a/tests/data/data.ts b/tests/data/data.ts index 07da42860..ff41bdf82 100644 --- a/tests/data/data.ts +++ b/tests/data/data.ts @@ -176,7 +176,7 @@ export class TestDataProvider { } static getEnvVarsWithPathPrefixWithFlags(job: Job): string { - return `GATSBY_PARSER_USER=TestUser\nGATSBY_PARSER_BRANCH=${job.payload.branchName}\nPATH_PREFIX=${job.payload.pathPrefix}\nGATSBY_BASE_URL=test\nPREVIEW_BUILD_ENABLED=false\nGATSBY_TEST_SEARCH_UI=false\nGATSBY_HIDE_UNIFIED_FOOTER_LOCALE=true\nGATSBY_MARIAN_URL=test-url\nGATSBY_ENABLE_DARK_MODE=true\n`; + return `GATSBY_PARSER_USER=TestUser\nGATSBY_PARSER_BRANCH=${job.payload.branchName}\nPATH_PREFIX=${job.payload.pathPrefix}\nGATSBY_BASE_URL=test\nPREVIEW_BUILD_ENABLED=false\nGATSBY_TEST_SEARCH_UI=false\nGATSBY_HIDE_UNIFIED_FOOTER_LOCALE=true\nGATSBY_MARIAN_URL=test-url\nGATSBY_ENABLE_DARK_MODE=true\nGATSBY_FEATURE_SHOW_HIDDEN_LOCALES=true\n`; } static getPathPrefixCases(): Array { diff --git a/tests/utils/jobHandlerTestHelper.ts b/tests/utils/jobHandlerTestHelper.ts index 0717f26d2..53b32ae79 100644 --- a/tests/utils/jobHandlerTestHelper.ts +++ b/tests/utils/jobHandlerTestHelper.ts @@ -167,6 +167,7 @@ export class JobHandlerTestHelper { .mockReturnValue(nextGenEntry); this.config.get.calledWith('GATSBY_PARSER_USER').mockReturnValue('TestUser'); this.config.get.calledWith('gatsbyEnableDarkMode').mockReturnValue('true'); + this.config.get.calledWith('gatsbyFeatureShowHiddenLocales').mockReturnValue('true'); this.jobCommandExecutor.execute.mockResolvedValue({ status: 'success', output: 'Great work', error: null }); } }