Skip to content

Commit

Permalink
Merge branch 'main' into MMS-1789-bridge-api-privacy-regression-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ghgoodreau authored Dec 10, 2024
2 parents 6c38337 + 653177a commit f8dfd52
Show file tree
Hide file tree
Showing 1,044 changed files with 66,493 additions and 20,620 deletions.
80 changes: 60 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ version: 2.1
executors:
node-browsers-small:
docker:
- image: cimg/node:20.17-browsers
- image: cimg/node:20.18-browsers
resource_class: small
environment:
NODE_OPTIONS: --max_old_space_size=2048
node-browsers-medium:
docker:
- image: cimg/node:20.17-browsers
- image: cimg/node:20.18-browsers
resource_class: medium
environment:
NODE_OPTIONS: --max_old_space_size=3072
node-linux-medium:
machine:
image: ubuntu-2404:current
image: ubuntu-2404:2024.05.1
resource_class: medium #// linux medium: 2 CPUs, 7.5 GB RAM, 10 credits/min
environment:
NODE_OPTIONS: --max_old_space_size=6144
node-browsers-medium-plus:
docker:
- image: cimg/node:20.17-browsers
- image: cimg/node:20.18-browsers
resource_class: medium+
environment:
NODE_OPTIONS: --max_old_space_size=4096
Expand All @@ -45,11 +45,11 @@ rc_branch_only: &rc_branch_only
only:
- /^Version-v(\d+)[.](\d+)[.](\d+)/

develop_master_rc_only: &develop_master_rc_only
main_master_rc_only: &main_master_rc_only
filters:
branches:
only:
- develop
- main
- master
- /^Version-v(\d+)[.](\d+)[.](\d+)/

Expand Down Expand Up @@ -103,9 +103,13 @@ workflows:
test_and_release:
when:
not:
matches:
pattern: /^l10n_crowdin_action$/
value: << pipeline.git.branch >>
or:
- matches:
pattern: /^l10n_crowdin_action$/
value: << pipeline.git.branch >>
- matches:
pattern: /^rerun-from-failed.*/
value: << pipeline.schedule.name >>
jobs:
- create_release_pull_request:
<<: *rc_branch_only
Expand All @@ -121,6 +125,8 @@ workflows:
branches:
ignore:
- master
requires:
- prep-deps
- test-deps-audit:
requires:
- prep-deps
Expand Down Expand Up @@ -170,12 +176,13 @@ workflows:
requires:
- prep-deps
- prep-build-test-flask-mv2:
<<: *develop_master_rc_only
<<: *main_master_rc_only
requires:
- prep-deps
- prep-build-test-mmi:
requires:
- prep-deps
- check-mmi-trigger
- prep-build-test-mmi-playwright:
requires:
- prep-deps
Expand All @@ -197,6 +204,7 @@ workflows:
requires:
- prep-deps
- test-e2e-chrome-webpack:
<<: *main_master_rc_only
requires:
- prep-build-test-webpack
- get-changed-files-with-git-diff
Expand All @@ -205,6 +213,7 @@ workflows:
- prep-build-test
- get-changed-files-with-git-diff
- test-e2e-firefox:
<<: *main_master_rc_only
requires:
- prep-build-test-mv2
- get-changed-files-with-git-diff
Expand All @@ -224,7 +233,7 @@ workflows:
- prep-build-test-flask
- get-changed-files-with-git-diff
- test-e2e-firefox-flask:
<<: *develop_master_rc_only
<<: *main_master_rc_only
requires:
- prep-build-test-flask-mv2
- test-e2e-chrome-mmi:
Expand All @@ -234,6 +243,9 @@ workflows:
- test-e2e-mmi-playwright:
requires:
- prep-build-test-mmi-playwright
- test-e2e-swap-playwright - OPTIONAL:
requires:
- prep-build
- test-e2e-chrome-rpc-mmi:
requires:
- prep-build-test-mmi
Expand All @@ -242,7 +254,7 @@ workflows:
filters:
branches:
only:
- develop
- main
- /^Version-v(\d+)[.](\d+)[.](\d+)/
requires:
- prep-build
Expand Down Expand Up @@ -341,16 +353,30 @@ workflows:
- job-publish-storybook:
filters:
branches:
only: develop
only: main
requires:
- prep-build-storybook
- job-publish-ts-migration-dashboard:
filters:
branches:
only: develop
only: main
requires:
- prep-build-ts-migration-dashboard

rerun-from-failed:
when:
matches:
pattern: /^rerun-from-failed.*/
value: << pipeline.schedule.name >>
jobs:
- prep-deps
- rerun-workflows-from-failed:
filters:
branches:
only: main
requires:
- prep-deps

locales_only:
when:
matches:
Expand Down Expand Up @@ -457,7 +483,7 @@ jobs:

# This job is used for the e2e quality gate.
# It must be run before any job which uses the run-all.js script.
# The job is skipped in develop, master or RC branches.
# The job is skipped in main, master or RC branches.
get-changed-files-with-git-diff:
executor: node-browsers-small
steps:
Expand All @@ -467,7 +493,7 @@ jobs:
at: .
- run:
name: Get changed files with git diff
command: npx tsx .circleci/scripts/git-diff-develop.ts
command: yarn git-diff-default-branch
- persist_to_workspace:
root: .
paths:
Expand Down Expand Up @@ -784,6 +810,7 @@ jobs:
- run: corepack enable
- attach_workspace:
at: .
- run: *check-mmi-trigger
- run:
name: Build extension for testing
command: yarn build:test:mmi
Expand Down Expand Up @@ -925,6 +952,17 @@ jobs:
paths:
- development/ts-migration-dashboard/build/final

rerun-workflows-from-failed:
executor: node-browsers-small
steps:
- run: *shallow-git-clone-and-enable-vnc
- run: sudo corepack enable
- attach_workspace:
at: .
- run:
name: Rerun workflows from failed
command: yarn ci-rerun-from-failed

test-yarn-dedupe:
executor: node-browsers-small
steps:
Expand Down Expand Up @@ -959,7 +997,7 @@ jobs:
at: .
- run:
name: Install Playwright browsers
command: yarn exec playwright install
command: yarn exec playwright install chromium
- run:
name: Test Storybook
command: yarn test-storybook:ci
Expand Down Expand Up @@ -1167,6 +1205,7 @@ jobs:
- run: sudo corepack enable
- attach_workspace:
at: .
- run: *check-mmi-trigger
- run:
name: Move test build to dist
command: mv ./dist-test-mmi ./dist
Expand All @@ -1192,7 +1231,7 @@ jobs:
at: .
- run:
name: test:e2e:single
command: .circleci/scripts/test-run-e2e.sh yarn test:e2e:single test/e2e/vault-decryption-chrome.spec.js --browser chrome
command: .circleci/scripts/test-run-e2e.sh yarn test:e2e:single test/e2e/vault-decryption-chrome.spec.ts --browser chrome
no_output_timeout: 5m
- store_artifacts:
path: test-artifacts
Expand Down Expand Up @@ -1256,6 +1295,7 @@ jobs:
- run: sudo corepack enable
- attach_workspace:
at: .
- run: *check-mmi-trigger
- run:
name: Move test build to dist
command: mv ./dist-test-mmi ./dist
Expand Down Expand Up @@ -1301,7 +1341,7 @@ jobs:
template: basic_fail_1
channel: C01LUJL3T98
- slack/notify:
branch_pattern: develop
branch_pattern: main
event: fail
mentions: <@antonio.regadas>, @ramon.acitores134
template: basic_fail_1
Expand Down Expand Up @@ -1711,7 +1751,7 @@ jobs:
command: echo 'whew - everything passed!'

check-mmi-trigger:
executor: node-browsers-medium
executor: node-browsers-small
steps:
- checkout
- run:
Expand Down
4 changes: 2 additions & 2 deletions .circleci/scripts/bundle-stats-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ then
exit 1
fi

if [[ "${CIRCLE_BRANCH}" != "develop" ]]
if [[ "${CIRCLE_BRANCH}" != "main" ]]
then
printf 'This is not develop branch'
printf 'This is not main branch'
exit 0
fi

Expand Down
6 changes: 6 additions & 0 deletions .circleci/scripts/check_mmi_trigger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ if [ -z "$CIRCLE_PULL_REQUEST" ] || [ -z "$GITHUB_TOKEN" ]; then
exit 0
fi

if [[ $CIRCLE_BRANCH = 'main' || $CIRCLE_BRANCH = 'master' || $CIRCLE_BRANCH =~ ^Version-v[0-9.]* ]]; then
echo "Long-running branch detected, running MMI tests."
echo "run_mmi_tests=true" > mmi_trigger.env
exit 0
fi

# Extract PR number from the pull request URL
PR_NUMBER=$(echo "$CIRCLE_PULL_REQUEST" | awk -F'/' '{print $NF}')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const PR_NUMBER =
process.env.CIRCLE_PR_NUMBER ||
process.env.CIRCLE_PULL_REQUEST?.split('/').pop();

const MAIN_BRANCH = 'develop';
const GITHUB_DEFAULT_BRANCH = 'main';
const SOURCE_BRANCH = `refs/pull/${PR_NUMBER}/head`;

const CHANGED_FILES_DIR = 'changed-files';
Expand Down Expand Up @@ -48,7 +48,7 @@ async function getPrInfo(): Promise<PRInfo | null> {
*/
async function fetchWithDepth(depth: number): Promise<boolean> {
try {
await exec(`git fetch --depth ${depth} origin "${MAIN_BRANCH}"`);
await exec(`git fetch --depth ${depth} origin "${GITHUB_DEFAULT_BRANCH}"`);
await exec(
`git fetch --depth ${depth} origin "${SOURCE_BRANCH}:${SOURCE_BRANCH}"`,
);
Expand Down Expand Up @@ -84,7 +84,7 @@ async function fetchUntilMergeBaseFound() {
}
}
}
await exec(`git fetch --unshallow origin "${MAIN_BRANCH}"`);
await exec(`git fetch --unshallow origin "${GITHUB_DEFAULT_BRANCH}"`);
}

/**
Expand Down Expand Up @@ -137,7 +137,7 @@ async function storeGitDiffOutputAndPrBody() {
if (!baseRef) {
console.log('Not a PR, skipping git diff');
return;
} else if (baseRef !== MAIN_BRANCH) {
} else if (baseRef !== GITHUB_DEFAULT_BRANCH) {
console.log(`This is for a PR targeting '${baseRef}', skipping git diff`);
writePrBodyToFile(prInfo.body);
return;
Expand Down
Loading

0 comments on commit f8dfd52

Please sign in to comment.