Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit 5755558

Browse files
authored
DOP-4602: Add feature flag to conditionally show WIP locales (#1052)
1 parent c436545 commit 5755558

File tree

7 files changed

+14
-1
lines changed

7 files changed

+14
-1
lines changed

cdk-infra/lib/constructs/worker/worker-env-construct.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ export class WorkerEnvConstruct extends Construct {
6565
const jobCollection = StringParameter.valueFromLookup(this, `${ssmPrefix}/atlas/collections/job/queue`);
6666
const gatsbyMarianUrl = StringParameter.valueFromLookup(this, `${ssmPrefix}/frontend/marian_url`);
6767
const gatsbyEnableDarkMode = StringParameter.valueFromLookup(this, `${ssmPrefix}/frontend/enable_dark_mode`);
68+
// Feature flag to render locales in the process of being translated. Might want to keep this while we continue to translate
69+
// to new languages to avoid needing to keep moving this flag around
70+
const gatsbyFeatureShowHiddenLocales = StringParameter.valueFromLookup(
71+
this,
72+
`${ssmPrefix}/flag/show_hidden_locales`
73+
);
6874

6975
const dbPassword = secureStrings['MONGO_ATLAS_PASSWORD'];
7076
this.environment = {
@@ -103,6 +109,7 @@ export class WorkerEnvConstruct extends Construct {
103109
GATSBY_MARIAN_URL: gatsbyMarianUrl,
104110
IS_FEATURE_BRANCH: getIsFeatureBranch(),
105111
GATSBY_ENABLE_DARK_MODE: gatsbyEnableDarkMode,
112+
GATSBY_FEATURE_SHOW_HIDDEN_LOCALES: gatsbyFeatureShowHiddenLocales,
106113
};
107114
}
108115
}

config/custom-environment-variables.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"featureFlagUpdatePages": "FEATURE_FLAG_UPDATE_PAGES",
2525
"featureFlagSearchUI": "GATSBY_TEST_SEARCH_UI",
2626
"gatsbyHideUnifiedFooterLocale": "GATSBY_HIDE_UNIFIED_FOOTER_LOCALE",
27+
"gatsbyFeatureShowHiddenLocales": "GATSBY_FEATURE_SHOW_HIDDEN_LOCALES",
2728
"gatsbyMarianURL": "GATSBY_MARIAN_URL",
2829
"repoBranchesCollection": "REPO_BRANCHES_COL_NAME",
2930
"docsetsCollection": "DOCSETS_COL_NAME",

infrastructure/ecs-main/ecs_service.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ Resources:
7070
Value: ${self:custom.gatsbyMarianURL}
7171
- Name: GATSBY_ENABLE_DARK_MODE
7272
Value: ${self:custom.gatsbyEnableDarkMode}
73+
- Name: GATSBY_FEATURE_SHOW_HIDDEN_LOCALES
74+
Value: ${self:custom.gatsbyFeatureShowHiddenLocales}
7375
- Name: GATSBY_HIDE_UNIFIED_FOOTER_LOCALE
7476
Value: ${self:custom.gatsbyHideUnifiedFooterLocale}
7577
- Name: FASTLY_MAIN_TOKEN

infrastructure/ecs-main/serverless.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ custom:
108108
gatsbyHideUnifiedFooterLocale: ${ssm:/env/${self:provider.stage}/docs/worker_pool/flag/hide_locale}
109109
gatsbyMarianURL: ${ssm:/env/${self:provider.stage}/docs/worker_pool/frontend/marian_url}
110110
gatsbyEnableDarkMode: ${ssm:/env/${self:provider.stage}/docs/worker_pool/frontend/enable_dark_mode}
111+
gatsbyFeatureShowHiddenLocales: ${ssm:/env/${self:provider.stage}/docs/worker_pool/flag/show_hidden_locales}
111112
fastlyMainToken: ${ssm:/env/${self:provider.stage}/docs/worker_pool/fastly/docs/main/token}
112113
fastlyMainServiceId: ${ssm:/env/${self:provider.stage}/docs/worker_pool/fastly/docs/main/service_id}
113114
fastlyCloudManagerToken: ${ssm:/env/${self:provider.stage}/docs/worker_pool/fastly/docs/cloudmanager/token}

src/job/jobHandler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ export abstract class JobHandler {
414414
GATSBY_HIDE_UNIFIED_FOOTER_LOCALE: this._config.get<string>('gatsbyHideUnifiedFooterLocale'),
415415
GATSBY_MARIAN_URL: this._config.get<string>('gatsbyMarianURL'),
416416
GATSBY_ENABLE_DARK_MODE: this._config.get<string>('gatsbyEnableDarkMode'),
417+
GATSBY_FEATURE_SHOW_HIDDEN_LOCALES: this._config.get<string>('gatsbyFeatureShowHiddenLocales'),
417418
};
418419

419420
for (const [envName, envValue] of Object.entries(snootyFrontEndVars)) {

tests/data/data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export class TestDataProvider {
176176
}
177177

178178
static getEnvVarsWithPathPrefixWithFlags(job: Job): string {
179-
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`;
179+
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`;
180180
}
181181

182182
static getPathPrefixCases(): Array<any> {

tests/utils/jobHandlerTestHelper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export class JobHandlerTestHelper {
167167
.mockReturnValue(nextGenEntry);
168168
this.config.get.calledWith('GATSBY_PARSER_USER').mockReturnValue('TestUser');
169169
this.config.get.calledWith('gatsbyEnableDarkMode').mockReturnValue('true');
170+
this.config.get.calledWith('gatsbyFeatureShowHiddenLocales').mockReturnValue('true');
170171
this.jobCommandExecutor.execute.mockResolvedValue({ status: 'success', output: 'Great work', error: null });
171172
}
172173
}

0 commit comments

Comments
 (0)