Skip to content

Commit

Permalink
Merge branch 'develop' into fix-notification-slowness-and-crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Prithpal-Sooriya authored Jul 19, 2024
2 parents 5f76720 + e562224 commit 3902451
Show file tree
Hide file tree
Showing 83 changed files with 628 additions and 435 deletions.
35 changes: 35 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ aliases:
workflows:
test_and_release:
when:
not:
matches:
pattern: /^l10n_crowdin_action$/
value: << pipeline.git.branch >>
jobs:
- create_release_pull_request:
<<: *rc_branch_only
Expand Down Expand Up @@ -362,6 +367,27 @@ workflows:
requires:
- prep-build-ts-migration-dashboard

locales_only:
when:
matches:
pattern: /^l10n_crowdin_action$/
value: << pipeline.git.branch >>
jobs:
- prep-deps
- get-changed-files-with-git-diff:
requires:
- prep-deps
- validate-locales-only:
requires:
- get-changed-files-with-git-diff
- test-lint:
requires:
- prep-deps
- all-tests-pass:
requires:
- test-lint
- validate-locales-only

jobs:
trigger-beta-build:
executor: node-browsers-small
Expand Down Expand Up @@ -499,6 +525,15 @@ jobs:
paths:
- changed-files

validate-locales-only:
executor: node-browsers-small
steps:
- run: *shallow-git-clone
- run: sudo corepack enable
- attach_workspace:
at: .
- run: yarn tsx .circleci/scripts/validate-locales-only.ts

validate-lavamoat-allow-scripts:
executor: node-browsers-small
steps:
Expand Down
31 changes: 31 additions & 0 deletions .circleci/scripts/validate-locales-only.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const { readChangedFiles } = require('../../test/e2e/changedFilesUtil.js');

/**
* Verifies that all changed files are in the /_locales/ directory.
* Fails the build if any changed files are outside of the /_locales/ directory.
* Fails if no changed files are detected.
*/
async function validateLocalesOnlyChangedFiles() {
const changedFiles = await readChangedFiles();
if (!changedFiles || changedFiles.length === 0) {
console.error('Failure: No changed files detected.');
process.exit(1);
}
const invalidFiles = changedFiles.filter(
(file) => !file.startsWith('app/_locales/'),
);
if (invalidFiles.length > 0) {
console.error(
'Failure: Changed files must be in the /_locales/ directory.\n Changed Files:',
changedFiles,
'\n Invalid Files:',
invalidFiles,
);
process.exit(1);
} else {
console.log('Passed validation');
process.exit(0);
}
}

validateLocalesOnlyChangedFiles();
6 changes: 5 additions & 1 deletion app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3902451

Please sign in to comment.