Skip to content

Commit a324db3

Browse files
temp+fix: delay for 5s after submitting Base approval cp-7.56.0 (#20190)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Patches these changes into the bridge-status-controller: MetaMask/core#6674 The change adds a 5s delay after the approval submission to reduce bridge transaction failures on Base <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: fix: delay for 5s after submitting Base approval for swap ## **Related issues** Fixes: #20193 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> N/A ### **After** <!-- [screenshots/recordings] --> No visual changes, but there should be a 5s delay between the approval tx's submission and the trade tx on Base ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: SteP-n-s <[email protected]>
1 parent de22786 commit a324db3

File tree

615 files changed

+12183
-46263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

615 files changed

+12183
-46263
lines changed

.github/CODEOWNERS

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ app/core/Engine/controllers/accounts-controller @MetaMask/accounts-e
8383
app/core/Engine/messengers/accounts-controller-messenger @MetaMask/accounts-engineers
8484
app/core/SnapKeyring @MetaMask/accounts-engineers
8585

86-
# Co-owned by accounts and mobile-core-ux
87-
app/components/Views/AccountSelector @MetaMask/accounts-engineers @MetaMask/mobile-core-ux
88-
app/components/UI/EvmAccountSelectorList @MetaMask/accounts-engineers @MetaMask/mobile-core-ux
86+
# Co-owned by accounts and wallet-ux
87+
app/components/Views/AccountSelector @MetaMask/accounts-engineers @MetaMask/wallet-ux
88+
app/components/UI/EvmAccountSelectorList @MetaMask/accounts-engineers @MetaMask/wallet-ux
8989

9090
# Multichain Accounts
9191
**/multichain-accounts/** @MetaMask/accounts-engineers
@@ -186,25 +186,25 @@ app/core/Engine/messengers/defi-positions-controller-messenger @MetaMask/metamas
186186
app/selectors/assets @MetaMask/metamask-assets
187187

188188
# UX Team
189-
app/components/Views/AccountActions @MetaMask/mobile-core-ux
190-
app/components/Views/AccountSelector @MetaMask/mobile-core-ux
191-
app/components/Views/AddressQRCode @MetaMask/mobile-core-ux
192-
app/components/Views/EditAccountName @MetaMask/mobile-core-ux
193-
app/components/Views/LockScreen @MetaMask/mobile-core-ux
194-
app/components/Views/Login @MetaMask/mobile-core-ux
195-
app/components/Views/NetworkConnect @MetaMask/mobile-core-ux
196-
app/components/Views/NetworkSelector @MetaMask/mobile-core-ux
197-
app/components/Views/OnboardingCarousel @MetaMask/mobile-core-ux
198-
app/components/Views/OnboardingSuccess @MetaMask/mobile-core-ux
199-
app/components/Views/QRAccountDisplay @MetaMask/mobile-core-ux
200-
app/components/Views/QRScanner @MetaMask/mobile-core-ux
201-
app/components/Views/Settings @MetaMask/mobile-core-ux
202-
app/components/Views/TermsAndConditions @MetaMask/mobile-core-ux
203-
app/reducers/experimentalSettings @MetaMask/mobile-core-ux
204-
app/reducers/modals @MetaMask/mobile-core-ux
205-
app/reducers/navigation @MetaMask/mobile-core-ux
206-
app/reducers/privacy @MetaMask/mobile-core-ux
207-
app/reducers/settings @MetaMask/mobile-core-ux
189+
app/components/Views/AccountActions @MetaMask/wallet-ux
190+
app/components/Views/AccountSelector @MetaMask/wallet-ux
191+
app/components/Views/AddressQRCode @MetaMask/wallet-ux
192+
app/components/Views/EditAccountName @MetaMask/wallet-ux
193+
app/components/Views/LockScreen @MetaMask/wallet-ux
194+
app/components/Views/Login @MetaMask/wallet-ux
195+
app/components/Views/NetworkConnect @MetaMask/wallet-ux
196+
app/components/Views/NetworkSelector @MetaMask/wallet-ux
197+
app/components/Views/OnboardingCarousel @MetaMask/wallet-ux
198+
app/components/Views/OnboardingSuccess @MetaMask/wallet-ux
199+
app/components/Views/QRAccountDisplay @MetaMask/wallet-ux
200+
app/components/Views/QRScanner @MetaMask/wallet-ux
201+
app/components/Views/Settings @MetaMask/wallet-ux
202+
app/components/Views/TermsAndConditions @MetaMask/wallet-ux
203+
app/reducers/experimentalSettings @MetaMask/wallet-ux
204+
app/reducers/modals @MetaMask/wallet-ux
205+
app/reducers/navigation @MetaMask/wallet-ux
206+
app/reducers/privacy @MetaMask/wallet-ux
207+
app/reducers/settings @MetaMask/wallet-ux
208208

209209
# Transactions Team
210210
app/components/Views/transactions @MetaMask/transactions
@@ -216,9 +216,6 @@ app/core/OAuthService @MetaMask/web3auth
216216
app/components/Views/Onboarding @MetaMask/web3auth
217217
app/reducers/onboarding @MetaMask/web3auth
218218

219-
# Delegation team
220-
app/core/Engine/controllers/gator-permissions-controller @MetaMask/delegation
221-
app/core/Engine/messengers/gator-permissions-controller-messenger @MetaMask/delegation
222219
# QA Team - E2E Framework
223220
e2e/api-mocking/ @MetaMask/qa
224221
e2e/fixtures/ @MetaMask/qa

.github/actionlint.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ self-hosted-runner:
44
- "gha-mmsdk-scale-set-ubuntu-22.04-amd64-xl"
55
- "gha-mmsdk-scale-set-ubuntu-22.04-amd64-large"
66
- "gha-mm-scale-set-ubuntu-22.04-amd64-large"
7-
- "gha-mm-scale-set-ubuntu-22.04-amd64-small"
8-
- "gha-mm-scale-set-ubuntu-22.04-amd64-med"
97
- "macos-15"
108
- "ghcr.io/cirruslabs/macos-runner:sequoia"
119
- "ghcr.io/cirruslabs/macos-runner:sequoia-xl"

.github/scripts/extract-semver.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/scripts/resolve-previous-ref.sh

Lines changed: 0 additions & 65 deletions
This file was deleted.

.github/workflows/auto-create-release-pr.yml

Lines changed: 92 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,101 @@ jobs:
99
runs-on: ubuntu-latest
1010
outputs:
1111
semver: ${{ steps.out.outputs.semver }}
12+
previous_ref: ${{ steps.out.outputs.previous_ref }}
13+
proceed: ${{ steps.out.outputs.proceed }}
1214
steps:
13-
- name: Checkout repository
14-
uses: actions/checkout@v4
15-
1615
- id: out
1716
shell: bash
17+
env:
18+
GITHUB_TOKEN: ${{ github.token }}
1819
run: |
19-
.github/scripts/extract-semver.sh
20+
set -euo pipefail
21+
22+
semver="${GITHUB_REF#refs/heads/release/}"
23+
echo "semver=${semver}" >> "$GITHUB_OUTPUT"
24+
25+
# Validate semver format X.Y.Z where X, Y, Z are numbers
26+
if ! [[ "$semver" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
27+
echo "Error: Branch name must be release/X.Y.Z where X, Y, Z are numbers. Got: ${GITHUB_REF}" >&2
28+
exit 1
29+
fi
30+
31+
# Check if release X.Y.Z is hotfix: if patch (aka Z) > 0, skip
32+
patch="${semver##*.}"
33+
if [ "$patch" -gt 0 ]; then
34+
echo "Hotfix detected (patch $patch > 0), skipping auto-create-release-pr."
35+
echo "proceed=false" >> "$GITHUB_OUTPUT"
36+
exit 0
37+
fi
38+
echo "Not a hotfix (patch=0), proceeding."
39+
40+
# Function to paginate and collect refs for a prefix
41+
fetch_matching_refs() {
42+
local prefix="$1"
43+
local temp_file
44+
temp_file="$(mktemp)"
45+
local page=1
46+
echo "Fetching branches matching $prefix* (paginated)..." >&2
47+
while :; do
48+
echo "Fetching page $page for $prefix..." >&2
49+
resp="$(mktemp)"
50+
url="https://api.github.com/repos/${GITHUB_REPOSITORY}/git/matching-refs/heads/${prefix}?per_page=100&page=${page}"
51+
curl -sS -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" "$url" -o "$resp"
52+
53+
cat "$resp" >> "$temp_file"
54+
55+
count=$(jq length "$resp")
56+
if [ "$count" -lt 100 ]; then
57+
break
58+
fi
59+
page=$((page + 1))
60+
done
61+
echo "$temp_file"
62+
}
63+
64+
# Fetch only for release/ prefix
65+
release_file=$(fetch_matching_refs "release/")
66+
67+
# Combine and process: extract {name, semver} for matches, sort desc by semver
68+
jq -s 'add | [ .[] | .ref | ltrimstr("refs/heads/") as $name | select($name | test("^release/[0-9]+\\.[0-9]+\\.[0-9]+$")) | {name: $name, semver: $name | ltrimstr("release/") } ] | sort_by( .semver | split(".") | map(tonumber) ) | reverse' "$release_file" > all_versions.json
69+
70+
# Print all found versions (sorted desc)
71+
echo "All found versions (sorted desc): $(jq '[ .[].semver ]' all_versions.json)"
72+
73+
# Print all found matching branches (sorted by semver desc)
74+
echo "All found matching branches:"
75+
jq -r '.[].name' all_versions.json || echo "No matching branches found."
76+
77+
# Filter to those with semver strictly lower than current
78+
jq --arg semver "$semver" '[ .[] | select( .semver as $v | $semver | split(".") as $c | $v | split(".") as $p | ($p[0] | tonumber) < ($c[0] | tonumber) or (($p[0] | tonumber) == ($c[0] | tonumber) and (($p[1] | tonumber) < ($c[1] | tonumber) or (($p[1] | tonumber) == ($c[1] | tonumber) and ($p[2] | tonumber) < ($c[2] | tonumber)))) ) ]' all_versions.json > filtered_versions.json
79+
80+
# Print filtered versions (< $semver, sorted desc)
81+
echo "Filtered versions (< $semver, sorted desc): $(jq '[ .[].semver ]' filtered_versions.json)"
82+
83+
# Select the highest lower: first in filtered list
84+
if [ "$(jq length filtered_versions.json)" -eq 0 ]; then
85+
echo "Error: No versions lower than $semver found. Cannot determine previous-version-ref." >&2
86+
exit 1
87+
else
88+
highest_lower="$(jq -r '.[0].semver' filtered_versions.json)"
89+
previous_ref="$(jq -r '.[0].name' filtered_versions.json)"
90+
echo "Selected highest version lower than $semver: ${highest_lower}"
91+
echo "Selected branch: ${previous_ref}"
92+
echo "Passing to previous-version-ref: ${previous_ref}"
93+
fi
94+
echo "previous_ref=${previous_ref}" >> "$GITHUB_OUTPUT"
95+
96+
# Print values passed to call-create-release-pr
97+
echo "Inputs to call-create-release-pr:"
98+
echo " checkout-base-branch: main"
99+
echo " release-pr-base-branch: stable"
100+
echo " semver-version: ${semver}"
101+
echo " previous-version-ref: ${previous_ref}"
102+
103+
echo "proceed=true" >> "$GITHUB_OUTPUT"
20104
21105
call-create-release-pr:
106+
if: ${{ github.ref_type == 'branch' && startsWith(github.ref, 'refs/heads/release/') && needs.extract.outputs.proceed == 'true' }}
22107
needs: extract
23108
permissions:
24109
contents: write
@@ -28,4 +113,7 @@ jobs:
28113
github-token: ${{ secrets.PR_TOKEN }}
29114
google-application-creds-base64: ${{ secrets.GCP_RLS_SHEET_ACCOUNT_BASE64 }}
30115
with:
116+
checkout-base-branch: main
117+
release-pr-base-branch: stable
31118
semver-version: ${{ needs.extract.outputs.semver }}
119+
previous-version-ref: ${{ needs.extract.outputs.previous_ref }}

.github/workflows/build-android-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions/checkout@v4
3333

3434
- name: Setup Android Build Environment
35-
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@f932aba72712f44367f89f6e259ea0c8cfedcf68
35+
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@self-hosted-runners-config
3636
with:
3737
platform: android
3838
setup-simulator: false

0 commit comments

Comments
 (0)