Skip to content

Commit

Permalink
Merge branch 'main' into evm-on-flow
Browse files Browse the repository at this point in the history
  • Loading branch information
nialexsan authored Dec 13, 2024
2 parents b4059a6 + bb1c77e commit 8146067
Show file tree
Hide file tree
Showing 410 changed files with 15,152 additions and 5,477 deletions.
6 changes: 5 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,14 @@ ui/pages/settings/security-tab/profile-sync-toggle @MetaMask/identity

app/scripts/lib/snap-keyring @MetaMask/accounts-engineers

# Swaps team to own code for the swaps folder
# Swaps-Bridge team to own code for the swaps folder
ui/pages/swaps @MetaMask/swaps-engineers
app/scripts/controllers/swaps @MetaMask/swaps-engineers

# Swaps-Bridge team to own code for the bridge folder
**/bridge/** @MetaMask/swaps-engineers
**/bridge-status/** @MetaMask/swaps-engineers

# Ramps team to own code for the ramps folder
**/ramps/** @MetaMask/ramp

Expand Down
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ body:
- In production (default)
- In beta
- During release testing
- On the development branch
- On main branch
- On a feature branch
validations:
required: true
- type: input
Expand Down
1 change: 1 addition & 0 deletions .github/guidelines/LABELING_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ It's essential to ensure that PRs have the appropriate labels before they are co

### Optional labels:
- **regression-main**: This label can manually be added to a bug report issue at the time of its creation if the bug is present on the development branch, i.e., `main`, but is not yet released in production.
- **feature-branch-bug**: This label can manually be added to a bug report issue at the time of its creation if the bug is present on a feature branch, i.e., before merging to `main`.
- **needs-qa**: If the PR includes a new features, complex testing steps, or large refactors, this label must be added to indicated PR requires a full manual QA prior being merged and added to a release.

### Labels prohibited when PR needs to be merged:
Expand Down
20 changes: 15 additions & 5 deletions .github/scripts/check-template-and-add-labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import { TemplateType, templates } from './shared/template';
import { retrievePullRequest } from './shared/pull-request';

enum RegressionStage {
Development,
DevelopmentFeature,
DevelopmentMain,
Testing,
Beta,
Production
Expand Down Expand Up @@ -217,8 +218,10 @@ function extractRegressionStageFromBugReportIssueBody(
const extractedAnswer = match ? match[1].trim() : undefined;

switch (extractedAnswer) {
case 'On the development branch':
return RegressionStage.Development;
case 'On a feature branch':
return RegressionStage.DevelopmentFeature;
case 'On main branch':
return RegressionStage.DevelopmentMain;
case 'During release testing':
return RegressionStage.Testing;
case 'In beta':
Expand Down Expand Up @@ -332,11 +335,18 @@ async function userBelongsToMetaMaskOrg(
// This function crafts appropriate label, corresponding to regression stage and release version.
function craftRegressionLabel(regressionStage: RegressionStage | undefined, releaseVersion: string | undefined): Label {
switch (regressionStage) {
case RegressionStage.Development:
case RegressionStage.DevelopmentFeature:
return {
name: `feature-branch-bug`,
color: '5319E7', // violet
description: `bug that was found on a feature branch, but not yet merged in main branch`,
};

case RegressionStage.DevelopmentMain:
return {
name: `regression-main`,
color: '5319E7', // violet
description: `Regression bug that was found on development branch, but not yet present in production`,
description: `Regression bug that was found on main branch, but not yet present in production`,
};

case RegressionStage.Testing:
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/check-attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ name: Check Attributions
on:
push:
branches: Version-v*
pull_request:
branches: Version-v*
types:
- opened
- reopened
- synchronize
- ready_for_review

jobs:
check-attributions:
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,17 @@ jobs:
name: Run tests
uses: ./.github/workflows/run-tests.yml

wait-for-circleci-workflow-status:
name: Wait for CircleCI workflow status
uses: ./.github/workflows/wait-for-circleci-workflow-status.yml

all-jobs-completed:
name: All jobs completed
runs-on: ubuntu-latest
needs:
- check-workflows
- run-tests
- wait-for-circleci-workflow-status
outputs:
PASSED: ${{ steps.set-output.outputs.PASSED }}
steps:
Expand All @@ -58,3 +63,16 @@ jobs:
if [[ $passed != "true" ]]; then
exit 1
fi
log-merge-group-failure:
name: Log merge group failure
# Only run this job if the merge group event fails, skip on forks
if: ${{ github.event_name == 'merge_group' && failure() && !github.event.repository.fork }}
needs:
- all-jobs-pass
uses: metamask/github-tools/.github/workflows/log-merge-group-failure.yml@6bbad335a01fce1a9ec1eabd9515542c225d46c0
secrets:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
SPREADSHEET_ID: ${{ secrets.GOOGLE_MERGE_QUEUE_SPREADSHEET_ID }}
SHEET_NAME: ${{ secrets.GOOGLE_MERGE_QUEUE_SHEET_NAME }}
24 changes: 22 additions & 2 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# actions that may result in code from that branch being executed
# such as installing dependencies or running build scripts.

# For security reasons, this file always uses the latest version from the default branch.
# Changes made in feature branches or forks will not take effect until they are merged.

name: SonarCloud

on:
Expand All @@ -17,9 +20,9 @@ permissions:

jobs:
sonarcloud:
# Only scan code from non-forked repositories that have passed the tests
# Only scan code from non-forked repositories that have completed successfully using the push and pull_request events
# This will skip scanning the code for forks, but will run for the main repository on PRs from forks
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.repository.fork == false }}
if: ${{ github.event.workflow_run.conclusion == 'success' && contains(fromJSON('["push", "pull_request"]'), github.event.workflow_run.event) && !github.event.workflow_run.repository.fork }}
name: SonarCloud
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -50,6 +53,23 @@ jobs:
fi
echo "$sonar_project_properties" > sonar-project.properties
- name: Update sonar-project.properties with branch information
env:
EVENT: ${{ github.event.workflow_run.event }}
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
BASE_BRANCH: ${{ github.event.workflow_run.pull_requests[0].base.ref || '' }}
PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number || '' }}
run: |
if [ "$EVENT" == "pull_request" ]; then
{
echo "sonar.pullrequest.branch=$HEAD_BRANCH"
echo "sonar.pullrequest.base=$BASE_BRANCH"
echo "sonar.pullrequest.key=$PR_NUMBER"
} >> sonar-project.properties
else
echo "sonar.branch.name=$HEAD_BRANCH" >> sonar-project.properties
fi
- name: SonarCloud Scan
# This is SonarSource/[email protected]
uses: SonarSource/sonarcloud-github-action@4b4d7634dab97dcee0b75763a54a6dc92a9e6bc1
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/wait-for-circleci-workflow-status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Wait for CircleCI workflow status

on:
workflow_call:

jobs:
wait-for-circleci-workflow-status:
name: Wait for CircleCI workflow status
runs-on: ubuntu-latest
steps:
- name: Wait for CircleCI workflow status
env:
OWNER: ${{ github.repository_owner }}
REPOSITORY: ${{ github.event.repository.name }}
BRANCH: ${{ github.head_ref || github.ref_name }}
run: |
pipeline_id=$(curl --silent "https://circleci.com/api/v2/project/gh/$OWNER/$REPOSITORY/pipeline?branch=$BRANCH" | jq -r ".items[0].id")
workflow_status=$(curl --silent "https://circleci.com/api/v2/pipeline/$pipeline_id/workflow" | jq -r ".items[0].status")
if [ "$workflow_status" == "running" ]; then
while [ "$workflow_status" == "running" ]; do
sleep 30
workflow_status=$(curl --silent "https://circleci.com/api/v2/pipeline/$pipeline_id/workflow" | jq -r ".items[0].status")
done
fi
if [ "$workflow_status" != "success" ]; then
echo "::error::Workflow status is '$workflow_status'. Exiting with error."
exit 1
fi
18 changes: 18 additions & 0 deletions .storybook/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* Fixes for any styles that are not compatible with Storybook */

.create-snap-account-page, .remove-snap-account-page, .snap-ui-renderer {
width: 100% !important;
}

.snap-ui-renderer__footer-centered {
position: initial !important;
margin-top: auto !important;
}

.snap-ui-renderer__container {
padding-bottom: 0 !important;
}

.snap-ui-renderer__panel {
overflow-y: auto !important;
}
2 changes: 1 addition & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { metamaskStorybookTheme } from './metamask-storybook-theme';
import { DocsContainer } from '@storybook/addon-docs';
import { themes } from '@storybook/theming';
import { AlertMetricsProvider } from '../ui/components/app/alert-system/contexts/alertMetricsContext';
import './index.css';

// eslint-disable-next-line
/* @ts-expect-error: Avoids error from window property not existing */
Expand Down Expand Up @@ -185,7 +186,6 @@ const withColorScheme = (Story, context) => {
<div
{...props}
style={{
display: 'flex',
padding: '1rem',
backgroundColor: 'var(--color-background-default)',
color: 'var(--color-text-default)',
Expand Down
1 change: 1 addition & 0 deletions .storybook/test-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ const state = {
useBlockie: false,
featureFlags: {},
welcomeScreenSeen: false,
slides: [],
currentLocale: 'en',
preferences: {
showNativeTokenAsMainBalance: true,
Expand Down
Loading

0 comments on commit 8146067

Please sign in to comment.