Skip to content

Commit

Permalink
temp+chore: bump {gas-fee,network,selected-network,notification-servi…
Browse files Browse the repository at this point in the history
…ces,profile-sync,signature}-controller (#12577)

<!--
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**

<!--
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?
-->

We want to ensure that mobile is using the latest versions of all
controllers.

- Bump `@metamask/ppom-validator` from 0.35.1 to 0.36.0 ([view
changes](https://github.com/MetaMask/ppom-validator/blob/main/CHANGELOG.md))
  - There are no notable changes between these versions.
- Bump `@metamask/gas-fee-controller` from 21.0.0 to 22.0.1 ([view
changes](https://github.com/MetaMask/core/blob/main/packages/gas-fee-controller/CHANGELOG.md))
  - There are no notable changes between these versions.
- Bump `@metamask/signature-controller` from 22.0.0 to 23.1.0 ([view
changes](https://github.com/MetaMask/core/blob/main/packages/signature-controller/CHANGELOG.md))
  - There are no notable changes between these versions.
- Bump `@metamask/profile-sync-controller` from 1.0.0 to 2.0.0 ([view
changes](https://github.com/MetaMask/core/blob/main/packages/profile-sync-controller/CHANGELOG.md))
  - There are no notable changes between these versions.
- Bump `@metamask/selected-network-controller` from 18.0.2 to 19.0.0
([view
changes](https://github.com/MetaMask/core/blob/main/packages/selected-network-controller/CHANGELOG.md))
  - There are no notable changes between these versions.
- Bump `@metamask/network-controller` from 21.0.0 to 22.1.0 ([view
changes](https://github.com/MetaMask/core/blob/main/packages/network-controller/CHANGELOG.md))
  - Notable changes in 22.1.0:
- The `NetworkController:networkRemoved` messenger event will now be
emitted when a network is removed.
- New messenger actions `NetworkController:addNetwork`,
`NetworkController:removeNetwork`, and `NetworkController:updateNetwork`
which call the respective controller methods.
- New `lastUpdatedAt`property to network configurations which will be
set to the current time on addition or update
  - Notable changes in 22.0.2:
- `getDefaultNetworkConfigurationsByChainId` returns the updated display
names for `mainnet` and `linea`. `Ethereum Mainnet` instead of
`Mainnet`, and `Linea` instead of `Linea Mainnet`.
- Bump `@metamask/notification-services-controller` from 0.11.0 to
0.14.0 ([view
changes](https://github.com/MetaMask/core/blob/main/packages/notification-services-controller/CHANGELOG.md))
  - Notable changes in 0.12.0:
- `deleteNotificationsById` now publishes
`NotificationServicesController:notificationsListUpdated`
  - Notable changes in 0.12.1:
- When notifications are disabled, list is now repopulated with Snap
notifications

## **Related issues**

Completes https://github.com/MetaMask/MetaMask-planning/issues/3698 (and
does more to satisfy peer dependency warnings).
#12383

## **Manual testing steps**

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] 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).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
  • Loading branch information
runway-github[bot] authored Dec 16, 2024
1 parent 3dcd114 commit f6c1010
Show file tree
Hide file tree
Showing 569 changed files with 4,765 additions and 17,409 deletions.
7 changes: 0 additions & 7 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,3 @@ ignores:
- 'app'
- 'i18n-js'
- 'images'

## Expo
- '@config-plugins/detox'
- 'cross-spawn'
- 'expo-build-properties'
- 'expo-dev-client'

2 changes: 0 additions & 2 deletions .e2e.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ export MM_TEST_ACCOUNT_SRP='word1 word... word12'
export MM_TEST_ACCOUNT_ADDRESS='0x...'
export MM_TEST_ACCOUNT_PRIVATE_KEY=''
export IS_TEST="true"
# Temporary mechanism to enable security alerts API prior to release.
export MM_SECURITY_ALERTS_API_ENABLED="true"
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module.exports = {
},
},
{
files: ['scripts/**/*.js', 'app.config.js'],
files: ['scripts/**/*.js'],
rules: {
'no-console': 0,
'import/no-commonjs': 0,
Expand Down
6 changes: 0 additions & 6 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ app/selectors/notification @MetaMask/notifications
app/util/notifications @MetaMask/notifications
app/store/util/notifications @MetaMask/notifications

# Identity Team
app/actions/identity @MetaMask/identity
app/util/identity @MetaMask/identity
app/components/UI/ProfileSyncing @MetaMask/identity
e2e/specs/identity @MetaMask/identity

# LavaMoat Team
ses.cjs @MetaMask/supply-chain
patches/react-native+0.*.patch @MetaMask/supply-chain
Expand Down
112 changes: 8 additions & 104 deletions .github/scripts/bitrise/run-bitrise-e2e-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,9 @@ main().catch((error: Error): void => {
process.exit(1);
});

// Determine whether E2E should run and provide the associated reason
function shouldRunBitriseE2E(antiLabel: boolean, hasSmokeTestLabel: boolean, isDocs: boolean, isFork: boolean, isMergeQueue: boolean): [boolean, string] {

const conditions = [
{condition: hasSmokeTestLabel, message: "The smoke test label is present.", shouldRun: true},
{condition: isFork, message: "The pull request is from a fork.", shouldRun: false},
{condition: isDocs, message: "The pull request is documentation related.", shouldRun: false},
{condition: isMergeQueue, message: "The pull request is part of a merge queue.", shouldRun: false},
{condition: antiLabel, message: "The pull request has the anti-label.", shouldRun: false}
];

// Iterate through conditions to determine action
for (const {condition, message, shouldRun} of conditions) {
if (condition) {
return [shouldRun, message];
}
}

// Default case if no conditions met
return [false, "Unexpected scenario or no relevant labels found."];
}


async function main(): Promise<void> {
const githubToken = process.env.GITHUB_TOKEN;
const e2eLabel = process.env.E2E_LABEL;
const antiLabel = process.env.NO_E2E_LABEL;
const e2ePipeline = process.env.E2E_PIPELINE;
const workflowName = process.env.WORKFLOW_NAME;
const triggerAction = context.payload.action as PullRequestTriggerType;
Expand All @@ -66,20 +42,6 @@ async function main(): Promise<void> {
process.exit(1);
}

if (!antiLabel) {
core.setFailed('NO_E2E_LABEL not found');
process.exit(1);
}

// Logging for Pipeline debugging
console.log(`Trigger action: ${triggerAction}`);
console.log(`event: ${context.eventName}`);
console.log(`pullRequestNumber: ${pullRequestNumber}`);

const mergeQueue = (context.eventName === 'merge_group')
const mqCommitHash = context.payload?.merge_group?.head_sha;


const octokit: InstanceType<typeof GitHub> = getOctokit(githubToken);

const { data: prData } = await octokit.rest.pulls.get({
Expand All @@ -89,79 +51,29 @@ async function main(): Promise<void> {
});

// Get the latest commit hash
const prCommitHash = prData?.head?.sha;
// Determine the latest commit hash depending if it's a PR or MQ
const latestCommitHash = mergeQueue ? mqCommitHash : prCommitHash;
const latestCommitHash = prData.head.sha;

// Grab flags & labels
const labels = prData?.labels ?? [];
// Check if the e2e smoke label is applied
const labels = prData.labels;
const hasSmokeTestLabel = labels.some((label) => label.name === e2eLabel);
const hasAntiLabel = labels.some((label) => label.name === antiLabel);
const fork = context.payload.pull_request?.head.repo.fork || false;
const docs = mergeQueue ? false : prData.title.startsWith("docs:");


console.log(`Docs: ${docs}`);
console.log(`Fork: ${fork}`);
console.log(`Merge Queue: ${mergeQueue}`);
console.log(`Has smoke test label: ${hasSmokeTestLabel}`);
console.log(`Anti label: ${hasAntiLabel}`);

const [shouldRun, reason] = shouldRunBitriseE2E(hasAntiLabel, hasSmokeTestLabel, docs, fork, mergeQueue);
console.log(`Should run: ${shouldRun}, Reason: ${reason}`);

// One of these two labels must exist for pull_request type
if (!mergeQueue && !hasSmokeTestLabel && !hasAntiLabel) {

// Fail Status due to missing labels
const createStatusCheckResponse = await octokit.rest.checks.create({
owner,
repo,
name: statusCheckName,
head_sha: latestCommitHash,
status: StatusCheckStatusType.Completed,
conclusion: CompletedConclusionType.Failure,
started_at: new Date().toISOString(),
output: {
title: statusCheckTitle,
summary: `Failed due to missing labels. Please apply either ${e2eLabel} or ${antiLabel}.`,
},
});

if (createStatusCheckResponse.status === 201) {
console.log(
`Created '${statusCheckName}' check with failed status for commit ${latestCommitHash}`,
);
} else {
core.setFailed(
`Failed to create '${statusCheckName}' check with failed status for commit ${latestCommitHash} with status code ${createStatusCheckResponse.status}`,
);
process.exit(1);
}
core.setFailed(
`At least 1 E2E Label must be Applied either ${e2eLabel} or ${antiLabel}`,
);
process.exit(1);
}

if (!shouldRun) {
// Pass check since e2e smoke label is not applied
if (!hasSmokeTestLabel) {
console.log(
`Skipping Bitrise status check. due to the following reason: ${reason}`,
`"${e2eLabel}" label not applied. Skipping Bitrise status check.`,
);


// Post success status (skipped)
const createStatusCheckResponse = await octokit.rest.checks.create({
owner,
repo,
name: statusCheckName,
head_sha: latestCommitHash,
status: StatusCheckStatusType.Completed,
conclusion: CompletedConclusionType.Success,
conclusion: CompletedConclusionType.Success,
started_at: new Date().toISOString(),
output: {
title: statusCheckTitle,
summary: `Skip run since ${reason}`,
summary: 'Skip run since no E2E smoke label is applied',
},
});

Expand All @@ -183,8 +95,6 @@ async function main(): Promise<void> {
triggerAction === PullRequestTriggerType.Labeled &&
context.payload?.label?.name === e2eLabel
) {

console.log(`Starting Bitrise build for commit ${latestCommitHash}`);
// Configure Bitrise configuration for API call
const data = {
build_params: {
Expand Down Expand Up @@ -312,8 +222,6 @@ async function main(): Promise<void> {
}

// Post pending status
console.log(`Posting pending status for commit ${latestCommitHash}`);

const createStatusCheckResponse = await octokit.rest.checks.create({
owner,
repo,
Expand Down Expand Up @@ -348,8 +256,6 @@ async function main(): Promise<void> {
const lastCommentPage = Math.ceil(
numberOfTotalComments / numberOfCommentsToCheck,
);


const { data: latestCommentBatch } = await octokit.rest.issues.listComments({
owner,
repo,
Expand Down Expand Up @@ -381,8 +287,6 @@ async function main(): Promise<void> {

// Bitrise comment doesn't exist, post fail status
if (!bitriseComment) {

console.log(`Bitrise comment not detected for commit ${latestCommitHash}`);
// Post fail status
const createStatusCheckResponse = await octokit.rest.checks.create({
owner,
Expand Down
60 changes: 1 addition & 59 deletions .github/scripts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,3 @@
{
"compilerOptions": {
/* Basic Options */
"target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
"lib": [
"es2017",
] /* Specify library files to be included in the compilation. */,
"allowJs": true /* Allow javascript files to be compiled. */,
// "checkJs": true, /* Report errors in .js files. */
"jsx": "react-native" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
// "declaration": true, /* Generates corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
// "outDir": "./", /* Redirect output structure to the directory. */
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "removeComments": true, /* Do not emit comments to output. */
"noEmit": true /* Do not emit outputs. */,
// "incremental": true, /* Enable incremental compilation */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
"isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */,
/* Strict Type-Checking Options */
"strict": true /* Enable all strict type-checking options. */,
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
/* Additional Checks */
// "noUnusedLocals": true, /* Report errors on unused locals. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
/* Module Resolution Options */
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
"resolveJsonModule": true /* Allows importing JSON files */,
"baseUrl": "." /* Base directory to resolve non-absolute module names. */,
/* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
"allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
"skipLibCheck": true /* Skip type checking of declaration files. */
/* Source Map Options */
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
/* Experimental Options */
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
},
"exclude": [
"node_modules",
"jest.config.js"
]
"extends": "../../tsconfig.json"
}
39 changes: 0 additions & 39 deletions .github/workflows/auto-draft-prs.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -323,4 +323,4 @@ jobs:
else
echo "All jobs passed step skipped. Block PR."
exit 1
fi
fi
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ jobs:
--rm \
-v "$(pwd):/app" -w /app \
metamask-mobile-builder:latest \
bash -c 'yarn && yarn setup --build-ios --no-install-pods'
bash -c 'yarn && yarn setup --build-ios'
# restore ownership for cleanup
sudo chown -R "$(id -u):$(id -g)" .
20 changes: 17 additions & 3 deletions .github/workflows/run-bitrise-e2e-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,32 @@ on:
types: [edited, deleted]
pull_request:
types: [opened, reopened, labeled, unlabeled, synchronize]
merge_group: # Trigger on merge queue events to satisfy the branch protection rules
types: [checks_requested]

env:
E2E_LABEL: 'Run Smoke E2E'
NO_E2E_LABEL: 'No E2E Smoke Needed'
E2E_PIPELINE: 'pr_smoke_e2e_pipeline'
WORKFLOW_NAME: 'run-bitrise-e2e-check'

jobs:
is-fork-pull-request:
name: Determine pull request source
if: ${{ github.event.issue.pull_request || github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
outputs:
IS_FORK: ${{ steps.is-fork.outputs.IS_FORK }}
steps:
- uses: actions/checkout@v3
- name: Determine whether this PR is from a fork
id: is-fork
run: echo "IS_FORK=$(gh pr view --json isCrossRepository --jq '.isCrossRepository' "${PR_NUMBER}" )" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number || github.event.issue.number }}

run-bitrise-e2e-check:
needs: is-fork-pull-request
runs-on: ubuntu-latest
if: ${{ needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
permissions:
pull-requests: write
contents: write
Expand Down
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ DerivedData
project.xcworkspace
ios/debug.xcconfig
ios/release.xcconfig
.xcode.env.local

# android / intellij
build/
Expand Down Expand Up @@ -131,8 +130,4 @@ docs/assets/termsOfUse.html
android/app/src/main/assets/modules.json

# Google firebase base64 derived configs
**/GoogleService-Info.plist
# Expo
.expo
dist/
web-build/
**/GoogleService-Info.plist
Loading

0 comments on commit f6c1010

Please sign in to comment.