Skip to content

Commit

Permalink
Merge branch 'develop' into MMI-4847-gh-action-autotag-mmi-team
Browse files Browse the repository at this point in the history
  • Loading branch information
zone-live authored Apr 12, 2024
2 parents ea5fb3d + 1098a10 commit 66fd713
Show file tree
Hide file tree
Showing 213 changed files with 7,199 additions and 3,036 deletions.
79 changes: 79 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ aliases:
git checkout -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
fi
# Check if MMI Optional tests should run
- &check-mmi-optional
name: Check if MMI Optional tests should run
command: |
RUN_MMI_OPTIONAL=$(cat ./RUN_MMI_OPTIONAL)
if [[ "${CIRCLE_BRANCH}" == "develop" || "${RUN_MMI_OPTIONAL}" == "true" ]]; then
echo "Running MMI Optional tests"
else
echo "Skipping MMI Optional tests"
circleci step halt
fi
workflows:
test_and_release:
jobs:
Expand All @@ -77,6 +89,7 @@ workflows:
- trigger-beta-build:
requires:
- prep-deps
- check-pr-tag
- prep-deps
- test-deps-audit:
requires:
Expand Down Expand Up @@ -132,6 +145,7 @@ workflows:
- prep-build-test-mmi-playwright:
requires:
- prep-deps
- check-pr-tag
- prep-build-storybook:
requires:
- prep-deps
Expand Down Expand Up @@ -373,6 +387,68 @@ jobs:
name: Create GitHub Pull Request for version
command: .circleci/scripts/release-create-release-pr.sh

check-pr-tag:
docker:
- image: cimg/base:stable
steps:
- run:
name: Check for MMI Team Tag
command: |
#!/bin/bash
# GitHub Personal Access Token for API Authentication
GITHUB_TOKEN="${GITHUB_TOKEN}"
BRANCH="${CIRCLE_BRANCH}"
# Fetch the PRs associated with the current branch and check the response
PR_RESPONSE=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
"https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls?state=open&head=${CIRCLE_PROJECT_USERNAME}:${BRANCH}")
echo "https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls?state=open&head=${CIRCLE_PROJECT_USERNAME}:${BRANCH}"
# Check if the response contains valid JSON
if ! echo "$PR_RESPONSE" | jq empty; then
echo "Failed to parse JSON response."
echo "$PR_RESPONSE"
exit 1
fi
# Check if we received an array of PRs
if ! echo "$PR_RESPONSE" | jq -e '. | type == "array"'; then
echo "$PR_RESPONSE"
echo "Expected an array of PRs, got something else."
exit 1
fi
# Check if the array of PRs is empty
PR_COUNT=$(echo "$PR_RESPONSE" | jq '. | length')
# If no PRs are found, exit gracefully
if [ "$PR_COUNT" -eq 0 ]; then
echo "No open PRs found. Exiting."
echo "false" > ./RUN_MMI_OPTIONAL
exit 0
fi
# Extract label names from the PR_RESPONSE
LABEL_NAMES=$(echo "$PR_RESPONSE" | jq -r '.[0].labels[].name')
echo "Labels found: $LABEL_NAMES"
# Check if "team-mmi" label is present
if echo "$LABEL_NAMES" | grep -qw "team-mmi"; then
echo "team-mmi tag found."
# assign the RUN_MMI_OPTIONAL variable to true
echo "true" > ./RUN_MMI_OPTIONAL
else
echo "team-mmi tag not found."
# assign the RUN_MMI_OPTIONAL variable to false
echo "false" > ./RUN_MMI_OPTIONAL
fi
- persist_to_workspace:
root: .
paths:
- RUN_MMI_OPTIONAL

prep-deps:
executor: node-browsers-medium
steps:
Expand Down Expand Up @@ -640,6 +716,7 @@ jobs:
- run: *shallow-git-clone
- attach_workspace:
at: .
- run: *check-mmi-optional
- run:
name: Build MMI extension for Playwright e2e
command: |
Expand All @@ -654,6 +731,7 @@ jobs:
- persist_to_workspace:
root: .
paths:
- RUN_MMI_OPTIONAL
- dist-test-mmi-playwright
- builds-test-mmi-playwright
- store_artifacts:
Expand Down Expand Up @@ -1121,6 +1199,7 @@ jobs:
- run: *shallow-git-clone
- attach_workspace:
at: .
- run: *check-mmi-optional
- run:
name: Move test build to dist
command: mv ./dist-test-mmi-playwright ./dist
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/check-pr-has-required-labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async function main(): Promise<void> {
if (!hasTeamLabel) {
errorMessage += 'No team labels found on the PR. ';
}
errorMessage += `Please make sure the PR is appropriately labeled before merging it.\n\nSee labeling guidelines for more detail: https://github.com/MetaMask/metamask-extension/blob/develop/.github/LABELING_GUIDELINES.md`;
errorMessage += `Please make sure the PR is appropriately labeled before merging it.\n\nSee labeling guidelines for more detail: https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md`;
core.setFailed(errorMessage);
process.exit(1);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/dist/TokenDetectionController.js b/dist/TokenDetectionController.js
index 9aa09140d47424217eac118aebca9031e5d2a236..8100c432e7e01dbefcb5f53db3c58e51f120a51d 100644
--- a/dist/TokenDetectionController.js
+++ b/dist/TokenDetectionController.js
@@ -230,8 +230,7 @@ _TokenDetectionController_intervalId = new WeakMap(), _TokenDetectionController_
const isDetectionChangedFromPreferences = __classPrivateFieldGet(this, _TokenDetectionController_isDetectionEnabledFromPreferences, "f") !== useTokenDetection;
__classPrivateFieldSet(this, _TokenDetectionController_selectedAddress, newSelectedAddress, "f");
__classPrivateFieldSet(this, _TokenDetectionController_isDetectionEnabledFromPreferences, useTokenDetection, "f");
- if (useTokenDetection &&
- (isSelectedAddressChanged || isDetectionChangedFromPreferences)) {
+ if (isSelectedAddressChanged || isDetectionChangedFromPreferences) {
yield __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_restartTokenDetection).call(this, {
selectedAddress: __classPrivateFieldGet(this, _TokenDetectionController_selectedAddress, "f"),
});
@@ -239,8 +238,7 @@ _TokenDetectionController_intervalId = new WeakMap(), _TokenDetectionController_
}));
this.messagingSystem.subscribe('AccountsController:selectedAccountChange', ({ address: newSelectedAddress }) => __awaiter(this, void 0, void 0, function* () {
const isSelectedAddressChanged = __classPrivateFieldGet(this, _TokenDetectionController_selectedAddress, "f") !== newSelectedAddress;
- if (isSelectedAddressChanged &&
- __classPrivateFieldGet(this, _TokenDetectionController_isDetectionEnabledFromPreferences, "f")) {
+ if (isSelectedAddressChanged) {
__classPrivateFieldSet(this, _TokenDetectionController_selectedAddress, newSelectedAddress, "f");
yield __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_restartTokenDetection).call(this, {
selectedAddress: __classPrivateFieldGet(this, _TokenDetectionController_selectedAddress, "f"),
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/dist/KeyringController.js b/dist/KeyringController.js
index fc649ea6fc97b905d811b236de638172fb10b548..beab676ab85e5e372eda7846e98b7d34af6317f5 100644
--- a/dist/KeyringController.js
+++ b/dist/KeyringController.js
@@ -1092,9 +1092,13 @@ _KeyringController_keyringBuilders = new WeakMap(), _KeyringController_keyrings
}, _KeyringController_addQRKeyring = function _KeyringController_addQRKeyring() {
return __awaiter(this, void 0, void 0, function* () {
// QRKeyring is not yet compatible with Keyring type from @metamask/utils
- const qrKeyring = (yield __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_newKeyring).call(this, KeyringTypes.qr, {
- accounts: [],
- }));
+ /**
+ * Patch for @metamask/keyring-controller v13.0.0
+ * Below code change will fix the issue 23804, The intial code added a empty accounts as argument when creating a new QR keyring.
+ * cause the new Keystone MetamaskKeyring default properties all are undefined during deserialise() process.
+ * Please refer to PR 23903 for detail.
+ */
+ const qrKeyring = (yield __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_newKeyring).call(this, KeyringTypes.qr));
const accounts = yield qrKeyring.getAccounts();
yield __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_checkForDuplicate).call(this, KeyringTypes.qr, accounts);
__classPrivateFieldGet(this, _KeyringController_keyrings, "f").push(qrKeyring);
39 changes: 5 additions & 34 deletions app/_locales/de/messages.json

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

39 changes: 5 additions & 34 deletions app/_locales/el/messages.json

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

Loading

0 comments on commit 66fd713

Please sign in to comment.