Skip to content

Commit 920a2f1

Browse files
authored
Merge branch 'main' into jongsun/feat/251002-add-param-to-privateSendUpdate
2 parents d7f6f88 + 621846e commit 920a2f1

File tree

219 files changed

+10451
-1867
lines changed

Some content is hidden

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

219 files changed

+10451
-1867
lines changed

.depcheckrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ignores:
55
#
66

77
- '@lavamoat/snow'
8+
- '@lavamoat/webpack'
89
- '@lavamoat/allow-scripts'
910
- '@babel/runtime'
1011
- '@fortawesome/fontawesome-free'

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

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [ "$patch" -gt 0 ]; then
1313
exit 0
1414
fi
1515

16-
# Function to paginate and collect refs for a prefix
16+
# Function to paginate and collect refs for a prefix (narrow prefixes only)
1717
fetch_matching_refs() {
1818
local prefix="$1"
1919
local temp_file
@@ -43,24 +43,61 @@ fetch_matching_refs() {
4343
echo "$temp_file"
4444
}
4545

46-
# Fetch for each prefix
47-
version_v_file=$(fetch_matching_refs "Version-v")
48-
release_file=$(fetch_matching_refs "release/")
46+
# Try immediate previous minor within the same major by direct branch existence checks
47+
major="${semver%%.*}"
48+
rest_minor_patch="${semver#*.}"
49+
minor="${rest_minor_patch%%.*}"
4950

50-
# Combine and process: extract {name, semver} for matches, sort desc by semver
51-
jq -s 'add | [ .[] | .ref | ltrimstr("refs/heads/") as $name | select($name | test("^Version-v[0-9]+\\.[0-9]+\\.[0-9]+$") or test("^release/[0-9]+\\.[0-9]+\\.[0-9]+$")) | {name: $name, semver: (if $name | test("^Version-v") then $name | ltrimstr("Version-v") else $name | ltrimstr("release/") end) } ] | sort_by( .semver | split(".") | map(tonumber) ) | reverse' "$version_v_file" "$release_file" > all_versions.json
51+
if ! [[ "$major" =~ ^[0-9]+$ && "$minor" =~ ^[0-9]+$ ]]; then
52+
echo "Error: Unable to parse major/minor from semver: $semver" >&2
53+
exit 1
54+
fi
55+
56+
if [ "$minor" -gt 0 ]; then
57+
cand_minor=$((minor - 1))
58+
while [ "$cand_minor" -ge 0 ]; do
59+
candidate="release/${major}.${cand_minor}.0"
60+
echo "Checking for branch: ${candidate}" >&2
61+
http_code=$(curl -s -o /dev/null -w "%{http_code}" \
62+
-H "Authorization: token $GITHUB_TOKEN" \
63+
-H "Accept: application/vnd.github.v3+json" \
64+
"https://api.github.com/repos/${GITHUB_REPOSITORY}/branches/${candidate}")
65+
if [ "$http_code" = "200" ]; then
66+
echo "Found previous non-hotfix branch: ${candidate}" >&2
67+
echo "previous_ref=${candidate}" >> "$GITHUB_OUTPUT"
68+
exit 0
69+
fi
70+
cand_minor=$((cand_minor - 1))
71+
done
72+
fi
73+
74+
# Fallback: move to previous major and select highest non-hotfix (patch==0)
75+
prev_major=$((major - 1))
76+
if [ "$prev_major" -lt 0 ]; then
77+
echo "Error: No previous major available for semver: $semver" >&2
78+
exit 1
79+
fi
80+
81+
release_file=$(fetch_matching_refs "release/${prev_major}.")
5282

53-
# Filter to those with semver strictly lower than current and non-hotfix (patch==0)
54-
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)))) ) and (($p[2] | tonumber) == 0) ) ]' all_versions.json > filtered_versions.json
83+
# From the fetched list for the previous major, keep only patch==0 branches and pick the highest
84+
jq -s '[ (add // [])
85+
| .[]
86+
| .ref
87+
| ltrimstr("refs/heads/") as $name
88+
| select($name | test("^release/[0-9]+\\.[0-9]+\\.[0-9]+$"))
89+
| { name: $name, semver: ($name | ltrimstr("release/")) }
90+
]
91+
| map(select(.semver | split(".")[2] == "0"))
92+
| sort_by( .semver | split(".") | map(tonumber) )
93+
| reverse' "$release_file" > filtered_versions.json
5594

56-
# Select the highest lower: first in filtered list. If none found, fail.
5795
if [ "$(jq length filtered_versions.json)" -eq 0 ]; then
58-
echo "Error: No lower non-hotfix versions found; cannot determine previous-version-ref." >&2
59-
echo "This likely indicates a missing prior minor release branch (e.g., Version-vX.(Y-1).0 or release/X.(Y-1).0)." >&2
96+
echo "Error: No non-hotfix branches found for previous major ${prev_major}." >&2
6097
exit 1
6198
else
62-
highest_lower="$(jq -r '.[0].semver' filtered_versions.json)"
99+
selected_semver="$(jq -r '.[0].semver' filtered_versions.json)"
63100
previous_ref="$(jq -r '.[0].name' filtered_versions.json)"
64-
echo "Selected highest lower non-hotfix version: ${highest_lower} (branch: ${previous_ref})"
101+
echo "Selected previous major highest non-hotfix: ${selected_semver} (branch: ${previous_ref})"
65102
echo "previous_ref=${previous_ref}" >> "$GITHUB_OUTPUT"
66103
fi

.github/workflows/e2e-chrome.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
test-suite-name: test-e2e-chrome-webpack
4444
build-artifact: build-test-webpack
4545
build-command: yarn build:test:webpack
46-
test-command: yarn test:e2e:chrome:webpack
46+
test-command: yarn test:e2e:chrome
4747
matrix-index: ${{ matrix.index }}
4848
matrix-total: ${{ strategy.job-total }}
4949

.github/workflows/e2e-firefox.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@ jobs:
2727
matrix-index: ${{ matrix.index }}
2828
matrix-total: ${{ strategy.job-total }}
2929

30+
test-e2e-firefox-webpack:
31+
uses: ./.github/workflows/run-e2e.yml
32+
if: ${{ github.event_name != 'merge_group' }}
33+
secrets:
34+
INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }}
35+
strategy:
36+
fail-fast: ${{ github.event_name == 'merge_group' }}
37+
matrix:
38+
index:
39+
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
40+
with:
41+
test-suite-name: test-e2e-firefox-webpack
42+
build-artifact: build-test-webpack
43+
build-command: yarn build:test:webpack
44+
test-command: yarn test:e2e:firefox
45+
matrix-index: ${{ matrix.index }}
46+
matrix-total: ${{ strategy.job-total }}
47+
3048
test-e2e-firefox-flask:
3149
uses: ./.github/workflows/run-e2e.yml
3250
strategy:
@@ -44,6 +62,7 @@ jobs:
4462
test-e2e-firefox-report:
4563
needs:
4664
- test-e2e-firefox-browserify
65+
- test-e2e-firefox-webpack
4766
- test-e2e-firefox-flask
4867
runs-on: ubuntu-latest
4968
if: ${{ !cancelled() }}

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ jobs:
274274
needs:
275275
- needs-e2e
276276
- build-test-mv2-browserify
277+
- build-test-webpack
277278
- build-test-flask-mv2-browserify
278279
if: ${{ needs.needs-e2e.outputs.needs-e2e == 'true' }}
279280
uses: ./.github/workflows/e2e-firefox.yml

.github/workflows/update-lavamoat-policies.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,42 @@ jobs:
155155
path: lavamoat/browserify/${{ matrix.build-type }}
156156
key: cache-${{ matrix.build-type }}-${{ needs.prepare.outputs.COMMIT_SHA }}
157157

158+
update-lavamoat-webpack-policy:
159+
name: Update LavaMoat webpack policy
160+
runs-on: ubuntu-latest
161+
needs:
162+
- prepare
163+
steps:
164+
- name: Checkout repository
165+
uses: actions/checkout@v4
166+
167+
- name: Checkout pull request
168+
run: gh pr checkout "${PR_NUMBER}"
169+
env:
170+
GITHUB_TOKEN: ${{ secrets.LAVAMOAT_UPDATE_TOKEN }}
171+
PR_NUMBER: ${{ github.event.issue.number }}
172+
173+
- name: Checkout and setup environment
174+
uses: MetaMask/action-checkout-and-setup@v1
175+
with:
176+
is-high-risk-environment: false
177+
skip-allow-scripts: true
178+
use-yarn-hydrate: true
179+
180+
- name: Update LavaMoat webpack policy
181+
run: yarn webpack --env production --no-cache --generatePolicy
182+
env:
183+
INFURA_PROD_PROJECT_ID: 00000000000
184+
SEGMENT_PROD_WRITE_KEY: 00000000000
185+
GOOGLE_PROD_CLIENT_ID: 00000000000
186+
APPLE_PROD_CLIENT_ID: 00000000000
187+
188+
- name: Cache webpack policy
189+
uses: actions/cache/save@v4
190+
with:
191+
path: lavamoat/webpack
192+
key: cache-webpack-${{ needs.prepare.outputs.COMMIT_SHA }}
193+
158194
commit-updated-policies:
159195
name: Commit the updated LavaMoat policies
160196
runs-on: ubuntu-latest
@@ -163,6 +199,7 @@ jobs:
163199
- is-fork-pull-request
164200
- update-lavamoat-build-policy
165201
- update-lavamoat-webapp-policy
202+
- update-lavamoat-webpack-policy
166203
# Ensure forks don't get access to the LavaMoat update token
167204
if: ${{ needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
168205
steps:
@@ -220,6 +257,13 @@ jobs:
220257
key: cache-experimental-${{ needs.prepare.outputs.COMMIT_SHA }}
221258
fail-on-cache-miss: true
222259

260+
- name: Restore webpack policy
261+
uses: actions/cache/restore@v4
262+
with:
263+
path: lavamoat/webpack
264+
key: cache-webpack-${{ needs.prepare.outputs.COMMIT_SHA }}
265+
fail-on-cache-miss: true
266+
223267
- name: Check whether there are policy changes
224268
id: policy-changes
225269
run: |

.github/workflows/validate-lavamoat-policies.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,29 @@ jobs:
6464
echo "::error::Working tree dirty."
6565
exit 1
6666
fi
67+
68+
validate-lavamoat-policy-webpack:
69+
name: Validate LavaMoat webpack policy
70+
runs-on: ubuntu-latest
71+
steps:
72+
- name: Checkout and setup environment
73+
uses: MetaMask/action-checkout-and-setup@v1
74+
with:
75+
is-high-risk-environment: false
76+
skip-allow-scripts: true
77+
use-yarn-hydrate: true
78+
79+
- name: Validate LavaMoat webpack policy
80+
run: yarn webpack --env production --no-cache --generatePolicy
81+
env:
82+
INFURA_PROD_PROJECT_ID: 00000000000
83+
SEGMENT_PROD_WRITE_KEY: 00000000000
84+
GOOGLE_PROD_CLIENT_ID: 00000000000
85+
APPLE_PROD_CLIENT_ID: 00000000000
86+
87+
- name: Check working tree
88+
run: |
89+
if ! git diff --exit-code; then
90+
echo "::error::Working tree dirty."
91+
exit 1
92+
fi

.storybook/test-data.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,6 +1710,9 @@ const state = {
17101710
},
17111711
},
17121712
openSeaEnabled: true,
1713+
networkConnectionBanner: {
1714+
status: 'unknown',
1715+
},
17131716
},
17141717
appState: {
17151718
isAccountMenuOpen: false,

app/_locales/en/messages.json

Lines changed: 28 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)