Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: TESTING 7.26.1 #10238

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
68b85ee
added scripts to auto generate changelogs
sethkfman Jun 28, 2024
bb5e0e2
moved create release scripts to .github and edited for testing
sethkfman Jun 28, 2024
682fb7a
updated script to take in args
sethkfman Jun 28, 2024
812661d
set the base branch to test for RC cut
sethkfman Jun 28, 2024
f4aecd6
fix path
sethkfman Jun 28, 2024
f2f046a
fix path
sethkfman Jun 28, 2024
c44be11
fix PR create msg
sethkfman Jun 28, 2024
8b0a6d0
fix deps for action
sethkfman Jun 28, 2024
65b1417
moved script files
sethkfman Jun 28, 2024
7a156d6
fix paths
sethkfman Jun 28, 2024
a37519f
fix paths and PR text
sethkfman Jun 28, 2024
8c7b2d4
update csv script
sethkfman Jun 28, 2024
4a2faf5
update csv script to use let
sethkfman Jun 28, 2024
b292665
updated path
sethkfman Jun 28, 2024
8f979f7
updated deps and move to devDeps
sethkfman Jun 28, 2024
638cf2a
updated yarn command
sethkfman Jul 1, 2024
5c92492
added release value arg
sethkfman Jul 1, 2024
c08dbf0
added trap and refactor constants
sethkfman Jul 1, 2024
24516dd
updated team variable name and logic
sethkfman Jul 1, 2024
8f2a7b4
added error log if we are processing more than 500 commits
sethkfman Jul 1, 2024
bdba6e3
removed unused array and formatting
sethkfman Jul 1, 2024
903c347
reduced hash length to standard
sethkfman Jul 1, 2024
1346f7b
updated console logs
sethkfman Jul 1, 2024
40aa588
updated console log
sethkfman Jul 1, 2024
065bcd2
updated ref
sethkfman Jul 2, 2024
500ad63
7.26.1
metamaskbot Jul 3, 2024
1953bab
updated changelog and generated feature test plan
metamaskbot Jul 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ on:
version-number:
description: 'A natural version number. eg: 862'
required: true

previous-version-tag:
description: 'Previous release version tag. eg: v7.7.0'
required: true
jobs:
create-release-pr:
runs-on: ubuntu-latest
Expand All @@ -34,20 +36,21 @@ jobs:
# The workaround is to use a personal access token (BUG_REPORT_TOKEN) instead of
# the default GITHUB_TOKEN for the checkout action.
token: ${{ secrets.BUG_REPORT_TOKEN }}
- name: Get Node.js version
id: nvm
run: echo "NODE_VERSION=$(cat .nvmrc)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-node@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ steps.nvm.outputs.NODE_VERSION }}
node-version-file: '.nvmrc'
cache: yarn
- name: Install dependencies
run: yarn --immutable
- name: Set Versions
id: set-versions
shell: bash
run: SEMVER_VERSION=${{ github.event.inputs.semver-version }} VERSION_NUMBER=${{ github.event.inputs.version-number }} yarn create-release
run: SEMVER_VERSION=${{ github.event.inputs.semver-version }} VERSION_NUMBER=${{ github.event.inputs.version-number }} yarn set-version
- name: Create Release PR
id: create-release-pr
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./scripts/create-release-pr.sh ${{ github.event.inputs.semver-version }}
./scripts/create-release-pr.sh ${{ github.event.inputs.previous-version-tag }} ${{ github.event.inputs.semver-version }}
165 changes: 165 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ android {
applicationId "io.metamask"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1354
versionName "7.24.4"
versionCode 1355
versionName "7.26.1"
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy 'react-native-camera', 'general'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
8 changes: 4 additions & 4 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1471,16 +1471,16 @@ app:
PROJECT_LOCATION_IOS: ios
- opts:
is_expand: false
VERSION_NAME: 7.24.4
VERSION_NAME: 7.26.1
- opts:
is_expand: false
VERSION_NUMBER: 1354
VERSION_NUMBER: 1355
- opts:
is_expand: false
FLASK_VERSION_NAME: 7.24.4
FLASK_VERSION_NAME: 7.26.1
- opts:
is_expand: false
FLASK_VERSION_NUMBER: 1354
FLASK_VERSION_NUMBER: 1355
- opts:
is_expand: false
ANDROID_APK_LINK: ''
Expand Down
156 changes: 156 additions & 0 deletions commits.csv

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions ios/MetaMask.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMaskDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1354;
CURRENT_PROJECT_VERSION = 1355;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 48XVW22RCG;
Expand Down Expand Up @@ -1244,7 +1244,7 @@
"${inherited}",
);
LLVM_LTO = YES;
MARKETING_VERSION = 7.24.4;
MARKETING_VERSION = 7.26.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
Expand Down Expand Up @@ -1272,7 +1272,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1354;
CURRENT_PROJECT_VERSION = 1355;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 48XVW22RCG;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG;
Expand Down Expand Up @@ -1307,7 +1307,7 @@
"${inherited}",
);
LLVM_LTO = YES;
MARKETING_VERSION = 7.24.4;
MARKETING_VERSION = 7.26.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
Expand Down Expand Up @@ -1335,7 +1335,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMaskDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1354;
CURRENT_PROJECT_VERSION = 1355;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 48XVW22RCG;
Expand Down Expand Up @@ -1368,7 +1368,7 @@
);
LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift$(inherited)";
LLVM_LTO = YES;
MARKETING_VERSION = 7.24.4;
MARKETING_VERSION = 7.26.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
Expand Down Expand Up @@ -1396,7 +1396,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1354;
CURRENT_PROJECT_VERSION = 1355;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 48XVW22RCG;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG;
Expand Down Expand Up @@ -1427,7 +1427,7 @@
);
LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift$(inherited)";
LLVM_LTO = YES;
MARKETING_VERSION = 7.24.4;
MARKETING_VERSION = 7.26.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
Expand Down Expand Up @@ -1554,7 +1554,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMaskDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1354;
CURRENT_PROJECT_VERSION = 1355;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 48XVW22RCG;
Expand Down Expand Up @@ -1591,7 +1591,7 @@
"\"$(SRCROOT)/MetaMask/System/Library/Frameworks\"",
);
LLVM_LTO = YES;
MARKETING_VERSION = 7.24.4;
MARKETING_VERSION = 7.26.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -1622,7 +1622,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1354;
CURRENT_PROJECT_VERSION = 1355;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 48XVW22RCG;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG;
Expand Down Expand Up @@ -1657,7 +1657,7 @@
"\"$(SRCROOT)/MetaMask/System/Library/Frameworks\"",
);
LLVM_LTO = YES;
MARKETING_VERSION = 7.24.4;
MARKETING_VERSION = 7.26.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = (
"$(inherited)",
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "metamask",
"version": "7.24.4",
"version": "7.26.1",
"private": true,
"scripts": {
"audit:ci": "./scripts/yarn-audit.sh",
Expand Down Expand Up @@ -78,9 +78,10 @@
"test:merge-coverage": "nyc report --temp-dir ./tests/coverage --report-dir ./tests/merged-coverage/ --reporter json --reporter text --reporter lcovonly",
"test:validate-coverage": "nyc check-coverage --nycrc-path ./coverage-thresholds.json -t ./tests/merged-coverage/",
"update-changelog": "./scripts/auto-changelog.sh",
"changeset-changelog": "wrap () { node ./scripts/generate-rc-commits.js \"$@\" && ./scripts/changelog-csv.sh }; wrap ",
"prestorybook": "rnstl",
"deduplicate": "yarn yarn-deduplicate && yarn install",
"create-release": "./scripts/set-versions.sh && yarn update-changelog",
"set-version": "./scripts/set-versions.sh",
"add-release-label-to-pr-and-linked-issues": "ts-node ./.github/scripts/add-release-label-to-pr-and-linked-issues.ts",
"add-team-label-to-pr": "ts-node ./.github/scripts/add-team-label-to-pr.ts",
"run-bitrise-e2e-check": "ts-node ./.github/scripts/bitrise/run-bitrise-e2e-check.ts",
Expand Down Expand Up @@ -370,6 +371,7 @@
"@metamask/object-multiplex": "^1.1.0",
"@metamask/providers": "^13.1.0",
"@metamask/test-dapp": "^8.9.0",
"@octokit/rest": "^21.0.0",
"@open-rpc/mock-server": "^1.7.5",
"@open-rpc/schema-utils-js": "^1.16.2",
"@open-rpc/test-coverage": "^2.2.2",
Expand Down Expand Up @@ -476,6 +478,7 @@
"regenerator-runtime": "0.13.9",
"rn-nodeify": "10.3.0",
"serve-handler": "^6.1.5",
"simple-git": "^3.22.0",
"ts-node": "^10.5.0",
"typescript": "~4.8.4",
"wdio-cucumberjs-json-reporter": "^4.4.3",
Expand Down Expand Up @@ -572,4 +575,4 @@
}
},
"packageManager": "[email protected]"
}
}
80 changes: 80 additions & 0 deletions scripts/changelog-csv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/bin/bash

set -e
set -u
set -o pipefail

readonly CSV_FILE='commits.csv'

# Add release branch arg name
RELEASE_BRANCH_NAME="${1}"

# Temporary file for new entries
NEW_ENTRIES=$(mktemp)

# Backup file for existing CHANGELOG
CHANGELOG="CHANGELOG.md"
CHANGELOG_BACKUP="$CHANGELOG.bak"

# Backup existing CHANGELOG.md
cp "$CHANGELOG" "$CHANGELOG_BACKUP"

# Function to append entry to the correct category in the temp file
append_entry() {
local change_type="$1"
local entry="$2"
# Ensure the "Other" category is explicitly handled
case "$change_type" in
Added|Changed|Fixed) ;;
*) change_type="Other" ;; # Categorize as "Other" if not matching predefined categories
esac
echo "$entry" >> "$NEW_ENTRIES-$change_type"
}

# Read the CSV file and append entries to temp files based on change type
while IFS=, read -r commit_message author pr_link team change_type
do
pr_id=$(echo "$pr_link" | grep -o '[^/]*$')
entry="- [#$pr_id]($pr_link): $commit_message"
append_entry "$change_type" "$entry"
done < <(tail -n +2 "$CSV_FILE") # Skip the header line

# Function to insert new entries into CHANGELOG.md after a specific line
insert_new_entries() {
local marker="## Current Main Branch"
local temp_changelog=$(mktemp)

# Find the line number of the marker
local line_num=$(grep -n "$marker" "$CHANGELOG_BACKUP" | cut -d ':' -f 1)

# Split the existing CHANGELOG at the marker line
head -n "$line_num" "$CHANGELOG_BACKUP" > "$temp_changelog"

# Append the release header
echo "" >> "$temp_changelog"
echo "## $RELEASE_BRANCH_NAME - <Date>" >> "$temp_changelog"
echo "" >> "$temp_changelog"

# Append new entries for each change type if they exist
for change_type in Added Changed Fixed Other; do
if [[ -s "$NEW_ENTRIES-$change_type" ]]; then
echo "### $change_type" >> "$temp_changelog"
cat "$NEW_ENTRIES-$change_type" >> "$temp_changelog"
echo "" >> "$temp_changelog" # Add a newline for spacing
fi
done

# Append the rest of the original CHANGELOG content
tail -n +$((line_num + 1)) "$CHANGELOG_BACKUP" >> "$temp_changelog"

# Replace the original CHANGELOG with the updated one
mv "$temp_changelog" "$CHANGELOG"
}

# Trap to ensure cleanup happens
trap 'rm -f "$NEW_ENTRIES-"* "$CHANGELOG_BACKUP"' EXIT

# Insert new entries into CHANGELOG.md
insert_new_entries

echo 'CHANGELOG updated'
19 changes: 15 additions & 4 deletions scripts/create-release-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@ set -e
set -u
set -o pipefail

NEW_VERSION="${1}"
RELEASE_BRANCH_PREFIX="release/"
PREVIOUS_VERSION="${1}"
NEW_VERSION="${2}"
RELEASE_BRANCH_PREFIX="test-release/"

if [[ -z $NEW_VERSION ]]; then
echo "Error: No new version specified."
exit 1
fi

RELEASE_BRANCH_NAME="${RELEASE_BRANCH_PREFIX}${NEW_VERSION}"
RELEASE_BODY="This is the release candidate for version ${NEW_VERSION}."
RELEASE_BODY="This is the release candidate for version ${NEW_VERSION}. \n\nThe test csv can be found at [./commit.csv](commit.csv)"

git config user.name metamaskbot
git config user.email [email protected]

#TODO remove
git checkout chore/changelog-release-automation

git checkout -b "${RELEASE_BRANCH_NAME}"

if ! (git add . && git commit -m "${NEW_VERSION}");
Expand All @@ -30,6 +34,13 @@ git push --set-upstream origin "${RELEASE_BRANCH_NAME}"

gh pr create \
--draft \
--title "${NEW_VERSION}" \
--title "feat: TESTING ${NEW_VERSION}" \
--body "${RELEASE_BODY}" \
--head "${RELEASE_BRANCH_NAME}";

#Generate changelog and test plan csv
node ./scripts/generate-rc-commits.mjs "${PREVIOUS_VERSION}" "${RELEASE_BRANCH_NAME}"
./scripts/changelog-csv.sh "${RELEASE_BRANCH_NAME}"
git add ./commits.csv
git commit -am "updated changelog and generated feature test plan"
git push
Loading
Loading