The `metamaskbot` account now comments with a failure message when the
policy update fails. This comment also includes a link to the specific
run that failed, so that the PR author can review the log and/or retry
the policy update.
Today if you try to re-run failed jobs in a policy update, it will
fail to restore caches from jobs that were successful. This could
result in a partial update, or a misleading "No policy changes"
message when there are policy changes to make. It's only safe to re-
run the entire workflow.
The cache key has been updated to reference the commit hash instead of
the run ID, making it safe to re-run just the failed jobs.
If there is a cache miss during the policy update workflow, the result
would be invalid (either a partial update or a misleading "no policy
changes" message). To prevent this, the cache step will now fail if it
is not able to restore the cache.
The update lavamoat policies workflow was installing dependencies from
the `develop` branch rather than the PR. This resulted in invalid
policy updates. It has been updated to use the PR branch in each step
instead.
This GitHub action workflow was disabled, but was still running setup
steps. It has now been removed entirely. We can re-introduce it again
later once the problem that led to it being disabled has been fixed.
The associated npm script and JavaScript module have been removed as
well.
GitHub actions that install dependencies will now also cache those
dependencies using the standard strategy for Yarn (which is to hash the
lockfile).
This matches the module template (see https://github.com/MetaMask/metamask-module-template/pull/145
for details).
This should have no functional impact except that this action will run
faster when dependencies are unchanged.
A bot command has been added that can update LavaMoat policies
automatically. This helps contributors without a Linux machine to
produce policy files that match exactly what CI expects.
The README has been updated with instructions for this new workflow.
* Lint GitHub Action workflows
We now lint GitHub Action workflows. This lint step is performed in the
`main` workflow, which has an "All jobs passed" check that we can add
further checks to in the future. This can grow to encompass all PR
status checks that depend upon the PR contents.
This workflow is based upon the one used in the MetaMask module
template.
* Fix branch names
* Fix lint error
The fitness function workflow now uses an immutable install, ensuring
that the dependencies installed are known and tracked in the lockfile.
This makes it easier to audit exactly which dependencies were used for
each run.
The `chmod` step has been removed from the GitHub Actions workflow for
adding release labels. The script has been made executable in the
repository instead (the file mode is tracked by git).
The `nvmrc` file is now referenced in our GitHub Actions workflows,
rather than hard-coding the expected Node.js version. This will make
future Node.js version changes easier to manage.
* feat(action): github action to add release label when PR gets merged
* feat(action): make sure the action only runs for PRs merged in main branch
* fix(action): update labels default color
* fix(action): add check on release label format
* fix(action): type function explicitely
* feat(action): add possibility to extract next release version number from artifact
* fix(action): rename next rc cut number into next semver version
* feat(action): add a github action to create release branch
* fix(action): default branch is develop
* fix(action): specify name of workflow used to create release branch
* fix(action): handle case where artifact doesn't exist
* fix(action): create branch but not the PR
* feat(action): fetch next semver version from release branches name or from package.json
* fix(action): remove unused Create Release Branch action
* fix(action): release branch format was not correct
* feat(action): take tags into account when calculating next version number
* feat(action): add the possibility to force next semver version
* fix(action): update comments
* fix(action): adopt kebak-case instead of snake_case
* fix(action): rename PERSONAL_ACCESS_TOKEN into RELEASE_LABEL_TOKEN
* fix(action): yarn installation not required
* fix(action): yarn install shall be immutable
* fix(action): make the script compatible with ShellCheck
* fix(script): exit script earlier if condition is met
* fix(action): use closingIssuesReferences instead of timeline events
* fix(action): add execute permissions to script
* fix(action): remove duplicate comment
* Update CODEOWNERS: remove requirement for supply-chain team to approve lavamoat policy changes
* Require extension-devs or supply-chain teams to give approving reviews on PRs that have lavamoat policy changes
---------
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
* chore: add action to trigger metamask-desktop ci
We want to be able to trigger
MetaMask Desktop CI whenever we
are releasing the Extension (in this
case, merging to master branch).
This will allow the desktop team
to easily identify whenever a breaking
change (to the extension-desktop app
pairing) is being released and address
the issue within the desktop app
in a timely manner
* use double quotes
ensure these get interpreted as single strings.
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
---------
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
In order to properly review a pull request, it is necessary to not only
understand the details about the changes presented, but also the
*context* behind those changes. Oftentimes, this context is difficult to
locate or even absent altogether. Providing a link to an issue or a user
story helps, but only if there are sufficient details listed in the
resource itself, which may not always be the case. Ultimately, I feel
that the best way to provide such information is to briefly explain it
in the PR description.
Additionally, for changes that involve UI/UX improvements, screenshots
or screencaps can really help the review process, as one can comprehend
the changes much faster than reading the relevant code.
With that in mind, this commit updates the pull request template to
include some more prompts and a better template for the description
area.
Use `secrets.METAMASKBOT_CROWDIN_TOKEN` for `GITHUB_TOKEN`
ref: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
> When you use the repository's GITHUB_TOKEN to perform tasks on behalf of the GitHub Actions app, events triggered by the GITHUB_TOKEN will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs. For example, if a workflow run pushes code using the repository's GITHUB_TOKEN, a new workflow will not run even when the repository contains a workflow configured to run when push events occur.