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

chore: Rename develop to main #28821

Merged
merged 3 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 12 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ rc_branch_only: &rc_branch_only
only:
- /^Version-v(\d+)[.](\d+)[.](\d+)/

develop_master_rc_only: &develop_master_rc_only
main_master_rc_only: &main_master_rc_only
filters:
branches:
only:
- develop
- main
- master
- /^Version-v(\d+)[.](\d+)[.](\d+)/

Expand Down Expand Up @@ -172,7 +172,7 @@ workflows:
requires:
- prep-deps
- prep-build-test-flask-mv2:
<<: *develop_master_rc_only
<<: *main_master_rc_only
requires:
- prep-deps
- prep-build-test-mmi:
Expand Down Expand Up @@ -200,7 +200,7 @@ workflows:
requires:
- prep-deps
- test-e2e-chrome-webpack:
<<: *develop_master_rc_only
<<: *main_master_rc_only
requires:
- prep-build-test-webpack
- get-changed-files-with-git-diff
Expand All @@ -209,7 +209,7 @@ workflows:
- prep-build-test
- get-changed-files-with-git-diff
- test-e2e-firefox:
<<: *develop_master_rc_only
<<: *main_master_rc_only
requires:
- prep-build-test-mv2
- get-changed-files-with-git-diff
Expand All @@ -229,7 +229,7 @@ workflows:
- prep-build-test-flask
- get-changed-files-with-git-diff
- test-e2e-firefox-flask:
<<: *develop_master_rc_only
<<: *main_master_rc_only
requires:
- prep-build-test-flask-mv2
- test-e2e-chrome-mmi:
Expand All @@ -250,7 +250,7 @@ workflows:
filters:
branches:
only:
- develop
- main
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this should run on the master branch as well, so we could reuse the main_master_rc_only alias here. We can do this in a later PR though.

- /^Version-v(\d+)[.](\d+)[.](\d+)/
requires:
- prep-build
Expand Down Expand Up @@ -349,13 +349,13 @@ workflows:
- job-publish-storybook:
filters:
branches:
only: develop
only: main
requires:
- prep-build-storybook
- job-publish-ts-migration-dashboard:
filters:
branches:
only: develop
only: main
requires:
- prep-build-ts-migration-dashboard

Expand All @@ -367,7 +367,7 @@ workflows:
- rerun-workflows-from-failed:
filters:
branches:
only: develop
only: main
requires:
- prep-deps

Expand Down Expand Up @@ -477,7 +477,7 @@ jobs:

# This job is used for the e2e quality gate.
# It must be run before any job which uses the run-all.js script.
# The job is skipped in develop, master or RC branches.
# The job is skipped in main, master or RC branches.
get-changed-files-with-git-diff:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git-diff-develop.ts script should be renamed as well, but we can do that in a later PR

executor: node-browsers-small
steps:
Expand Down Expand Up @@ -1335,7 +1335,7 @@ jobs:
template: basic_fail_1
channel: C01LUJL3T98
- slack/notify:
branch_pattern: develop
branch_pattern: main
event: fail
mentions: <@antonio.regadas>, @ramon.acitores134
template: basic_fail_1
Expand Down
4 changes: 2 additions & 2 deletions .circleci/scripts/bundle-stats-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ then
exit 1
fi

if [[ "${CIRCLE_BRANCH}" != "develop" ]]
if [[ "${CIRCLE_BRANCH}" != "main" ]]
then
printf 'This is not develop branch'
printf 'This is not main branch'
exit 0
fi

Expand Down
2 changes: 1 addition & 1 deletion .circleci/scripts/check_mmi_trigger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ -z "$CIRCLE_PULL_REQUEST" ] || [ -z "$GITHUB_TOKEN" ]; then
exit 0
fi

if [[ $CIRCLE_BRANCH = 'develop' || $CIRCLE_BRANCH = 'master' || $CIRCLE_BRANCH =~ ^Version-v[0-9.]* ]]; then
if [[ $CIRCLE_BRANCH = 'main' || $CIRCLE_BRANCH = 'master' || $CIRCLE_BRANCH =~ ^Version-v[0-9.]* ]]; then
echo "Long-running branch detected, running MMI tests."
echo "run_mmi_tests=true" > mmi_trigger.env
exit 0
Expand Down
2 changes: 1 addition & 1 deletion .circleci/scripts/git-diff-develop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const PR_NUMBER =
process.env.CIRCLE_PR_NUMBER ||
process.env.CIRCLE_PULL_REQUEST?.split('/').pop();

const MAIN_BRANCH = 'develop';
const MAIN_BRANCH = 'main';
const SOURCE_BRANCH = `refs/pull/${PR_NUMBER}/head`;

const CHANGED_FILES_DIR = 'changed-files';
Expand Down
8 changes: 4 additions & 4 deletions .circleci/scripts/rerun-ci-workflow-from-failed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ interface WorkflowStatusResponse {
* Note: the API returns the first 20 workflows by default.
* If we wanted to get older workflows, we would need to use the 'page-token' we would get in the first response
* and perform a subsequent request with the 'page-token' parameter.
* This seems unnecessary as of today, as the amount of daily PRs merged to develop is not that high.
* This seems unnecessary as of today, as the amount of daily PRs merged to main is not that high.
*
* @returns {Promise<WorkflowItem[]>} A promise that resolves to an array of workflow items.
* @throws Will throw an error if the CircleCI token is not defined or if the HTTP request fails.
Expand Down Expand Up @@ -177,7 +177,7 @@ async function rerunWorkflowById(workflowId: string) {
}

/**
* Re-runs failed CircleCI workflows from develop branch.
* Re-runs failed CircleCI workflows from main branch.
* The workflow will only be re-runed if:
* 1. It has the status of 'failed'
* 2. It has only been run once
Expand All @@ -187,8 +187,8 @@ async function rerunWorkflowById(workflowId: string) {
* @throws Will throw an error if fetching the workflows or re-running a workflow fails.
*/
async function rerunFailedWorkflowsFromDevelop() {
console.log('Getting Circle Ci workflows from develop branch...');
const workflows = await getCircleCiWorkflowsByBranch('develop');
console.log('Getting Circle Ci workflows from main branch...');
const workflows = await getCircleCiWorkflowsByBranch('main');

console.log('Assessing if any of the workflows needs to be rerun...');
for (const item of workflows) {
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/download-builds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function getGitBranch() {
const gitOutput = execSync('git status').toString();

const branchRegex = /On branch (?<branch>.*)\n/;
return gitOutput.match(branchRegex)?.groups?.branch || 'develop';
return gitOutput.match(branchRegex)?.groups?.branch || 'main';
}

async function getCircleJobs(branch: string) {
Expand Down
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ If you're picking up a bounty or an existing issue, feel free to ask clarifying
### Submitting a pull request
When you're done with your project / bugfix / feature and ready to submit a PR, there are a couple guidelines we ask you to follow:

- [ ] **Make sure you followed our [`coding guidelines`](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md)**: These guidelines aim to maintain consistency and readability across the codebase. They help ensure that the code is easy to understand, maintain, and modify, which is particularly important when working with multiple contributors.
- [ ] **Make sure you followed our [`coding guidelines`](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md)**: These guidelines aim to maintain consistency and readability across the codebase. They help ensure that the code is easy to understand, maintain, and modify, which is particularly important when working with multiple contributors.
- [ ] **Test it**: For any new programmatic functionality, we like unit tests when possible, so if you can keep your code cleanly isolated, please do add a test file to the `tests` folder.
- [ ] **Meet the spec**: Make sure the PR adds functionality that matches the issue you're closing. This is especially important for bounties: sometimes design or implementation details are included in the conversation, so read carefully!
- [ ] **Close the issue**: If this PR closes an open issue, fill out the "Related issues" section with `Fixes: #$ISSUE_NUMBER`. Ex. For closing issue 418, include the line `Fixes: #418`. If it doesn't close the issue but addresses it partially, just include a reference to the issue number, like `#418`.
- [ ] **Keep it simple**: Try not to include multiple features in a single PR, and don't make extraneous changes outside the scope of your contribution. All those touched files make things harder to review ;)
- [ ] **PR against `develop`**: Submit your PR against the `develop` branch. This is where we merge new features so they get some time to receive extra testing before being pushed to `master` for production. If your PR is a hot-fix that needs to be published urgently, you may submit a PR against the `master` branch, but this PR will receive tighter scrutiny before merging.
- [ ] **PR against `main`**: Submit your PR against the `main` branch. This is where we merge new features so they get some time to receive extra testing before being pushed to `master` for production. If your PR is a hot-fix that needs to be published urgently, you may submit a PR against the `master` branch, but this PR will receive tighter scrutiny before merging.
- [ ] **Get reviewed by MetaMask Internal Developers**: All PRs require 2 approvals from MetaMask Internal Developers before merging.
- [ ] **Ensure the PR is correctly labeled.**: More detail about PR labels can be found [here](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md).
- [ ] **Ensure the PR is correctly labeled.**: More detail about PR labels can be found [here](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md).
- [ ] **PR Titles**: Must adhere to the [Conventional Commits specification](https://www.conventionalcommits.org)
- `<type>[optional scope]: <description>`
- Example: `feat(parser): add ability to parse arrays`
Expand Down
2 changes: 1 addition & 1 deletion .github/guidelines/LABELING_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ It's essential to ensure that PRs have the appropriate labels before they are co
- **regression-RC-x.y.z**: This label is manually added to a bug report issue by release engineers when a bug is found during release regerssion testing phase. The `x.y.z` in the label represents the release candidate (RC) version in which the bug's been discovered.

### Optional labels:
- **regression-develop**: 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., `develop`, but is not yet released in production.
- **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.
- **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
4 changes: 2 additions & 2 deletions .github/pull-request-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ Fixes:

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors.
- [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors.

## **Pre-merge reviewer checklist**

Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/check-pr-has-required-labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async function main(): Promise<void> {
if (!hasTeamLabel) {
errorMessage += 'No team labels found on the PR. ';
}
errorMessage += `Please make sure the PR is appropriately labeled before merging it.\n\nSee labeling guidelines for more detail: https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md`;
errorMessage += `Please make sure the PR is appropriately labeled before merging it.\n\nSee labeling guidelines for more detail: https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md`;
core.setFailed(errorMessage);
process.exit(1);
}
8 changes: 4 additions & 4 deletions .github/scripts/check-template-and-add-labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ async function main(): Promise<void> {

} else {
const errorMessage =
"Issue body does not match any of expected templates ('general-issue.yml' or 'bug-report.yml').\n\nMake sure issue's body includes all section titles.\n\nSections titles are listed here: https://github.com/MetaMask/metamask-extension/blob/develop/.github/scripts/shared/template.ts#L14-L37";
"Issue body does not match any of expected templates ('general-issue.yml' or 'bug-report.yml').\n\nMake sure issue's body includes all section titles.\n\nSections titles are listed here: https://github.com/MetaMask/metamask-extension/blob/main/.github/scripts/shared/template.ts#L14-L37";
console.log(errorMessage);

// Add label to indicate issue doesn't match any template
Expand All @@ -152,7 +152,7 @@ async function main(): Promise<void> {
);
} else {
const errorMessage =
`PR body does not match template ('pull-request-template.md').\n\nMake sure PR's body includes all section titles.\n\nSections titles are listed here: https://github.com/MetaMask/metamask-extension/blob/develop/.github/scripts/shared/template.ts#L40-L47`;
`PR body does not match template ('pull-request-template.md').\n\nMake sure PR's body includes all section titles.\n\nSections titles are listed here: https://github.com/MetaMask/metamask-extension/blob/main/.github/scripts/shared/template.ts#L40-L47`;
console.log(errorMessage);

// Add label to indicate PR body doesn't match template
Expand Down Expand Up @@ -334,7 +334,7 @@ function craftRegressionLabel(regressionStage: RegressionStage | undefined, rele
switch (regressionStage) {
case RegressionStage.Development:
return {
name: `regression-develop`,
name: `regression-main`,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This label will need to be renamed

color: '5319E7', // violet
description: `Regression bug that was found on development branch, but not yet present in production`,
};
Expand Down Expand Up @@ -364,7 +364,7 @@ function craftRegressionLabel(regressionStage: RegressionStage | undefined, rele
return {
name: `regression-*`,
color: 'EDEDED', // grey
description: `TODO: Unknown regression stage. Please replace with correct regression label: 'regression-develop', 'regression-RC-x.y.z', or 'regression-prod-x.y.z' label, where 'x.y.z' is the number of the release where bug was found.`,
description: `TODO: Unknown regression stage. Please replace with correct regression label: 'regression-main', 'regression-RC-x.y.z', or 'regression-prod-x.y.z' label, where 'x.y.z' is the number of the release where bug was found.`,
};
}
}
4 changes: 2 additions & 2 deletions .github/workflows/add-mmi-reviewer-and-notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Notify MMI team via Slack
on:
pull_request_target:
branches:
- develop
- main
types:
- opened
- reopened
Expand Down Expand Up @@ -45,4 +45,4 @@ jobs:
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.MMI_LABEL_SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_URL: ${{ secrets.MMI_LABEL_SLACK_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion .github/workflows/add-release-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Add release label to PR and linked issues when PR gets merged
on:
pull_request:
branches:
- develop
- main
types:
- closed

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Check PR has required labels
on:
pull_request:
branches:
- develop
- main
types:
- opened
- reopened
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [ develop, Version-v*, cla-signatures, master, snaps ]
branches: [ main, Version-v*, cla-signatures, master, snaps ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]
branches: [ main ]
schedule:
- cron: '28 12 * * 0'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codespaces.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- 'codespaces**'
- 'develop'
- 'main'
paths:
- '**/yarn.lock'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/crowdin-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:
on:
push:
branches:
- develop
- main
schedule:
- cron: "0 */12 * * *"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Main
on:
push:
branches:
- develop
- main
- master
pull_request:
types:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/security-code-scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: "MetaMask Security Code Scanner"

on:
push:
branches: [ 'develop' ]
branches: [ 'main' ]
pull_request:
branches: [ 'develop' ]
branches: [ 'main' ]

jobs:
run-security-scan:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.LAVAMOAT_UPDATE_TOKEN }}
run: |
gh pr create --title "chore: Update coverage.json" --body "This PR is automatically opened to update the coverage.json file when test coverage increases. Coverage increased from $STORED_COVERAGE% to $CURRENT_COVERAGE%." --base develop --head metamaskbot/update-coverage || gh pr edit --body "This PR is automatically opened to update the coverage.json file when test coverage increases. Coverage increased from $STORED_COVERAGE% to $CURRENT_COVERAGE%."
gh pr create --title "chore: Update coverage.json" --body "This PR is automatically opened to update the coverage.json file when test coverage increases. Coverage increased from $STORED_COVERAGE% to $CURRENT_COVERAGE%." --base main --head metamaskbot/update-coverage || gh pr edit --body "This PR is automatically opened to update the coverage.json file when test coverage increases. Coverage increased from $STORED_COVERAGE% to $CURRENT_COVERAGE%."
2 changes: 1 addition & 1 deletion .github/workflows/validate-conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Validate Conventional Commit Title
on:
pull_request:
branches:
- develop
- main
types: [opened, edited, reopened, synchronize]

jobs:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To learn how to develop MetaMask-compatible applications, visit our [Developer D

To learn how to contribute to the MetaMask codebase, visit our [Contributor Docs](https://github.com/MetaMask/contributor-docs).

To learn how to contribute to the MetaMask Extension project itself, visit our [Extension Docs](https://github.com/MetaMask/metamask-extension/tree/develop/docs).
To learn how to contribute to the MetaMask Extension project itself, visit our [Extension Docs](https://github.com/MetaMask/metamask-extension/tree/main/docs).

## GitHub Codespaces quickstart

Expand Down
4 changes: 2 additions & 2 deletions app/scripts/lib/setupSentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ function getTracesSampleRate(sentryTarget) {
}

if (flags.circleci) {
// Report very frequently on develop branch, and never on other branches
// Report very frequently on main branch, and never on other branches
// (Unless you use a `flags = {"sentry": {"tracesSampleRate": x.xx}}` override)
if (flags.circleci.branch === 'develop') {
if (flags.circleci.branch === 'main') {
return 0.015;
}
return 0;
Expand Down
Loading