Skip to content

Commit

Permalink
CI: INFRA-2087 auto generated issues for mobile and extension reposit…
Browse files Browse the repository at this point in the history
…ories (#4763)

## Explanation

CI pipeline for auto generated issues when major release of any package
occurs. New issues will be created in metamask-extension and
metamask-mobile repositories.

## References

* Related to https://github.com/MetaMask/MetaMask-planning/issues/2988

## Changelog

None

---------

Co-authored-by: Mark Stacey <[email protected]>
  • Loading branch information
rrabenda and Gudahtt authored Nov 1, 2024
1 parent 9a807d7 commit 5526c7a
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# Note: Please keep this synchronized with the `teams.json` file in the repository root.
# That file is used for some automated workflows, and maps controller to owning team(s).

* @MetaMask/engineering
/.github/ @MetaMask/wallet-framework-engineers

Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/create-update-issues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Create Update Issues

on:
workflow_call:
secrets:
CORE_CREATE_UPDATE_ISSUES_TOKEN:
description: GitHub token with permission to create issues in both mobile and extension repositories
required: true

jobs:
create-update-issues:
runs-on: ubuntu-latest
steps:
- name: Checkout head
uses: actions/checkout@v4
with:
fetch-tags: true

- name: Create Issues
env:
GH_TOKEN: ${{ secrets.CORE_CREATE_UPDATE_ISSUES_TOKEN }}
run: |
IFS=$'\n' read -r -d '' -a tag_array < <(git tag --points-at HEAD && printf '\0')
for tag in "${tag_array[@]}"; do
if [[ "${tag}" == @metamask/* ]] ; then
# Extract package name without the leading '@'
package_name="${tag#@}"
package_name="${package_name%@*}"
# Extract version number
version="${tag##*@}"
# Check if version number ends with .0.0
if [[ $version == *.0.0 ]]; then
# Fetch responsible team from file
teams=$(jq -r --arg key "$package_name" '.[$key]' teams.json)
gh issue create --title "Update ${package_name} to version ${version}" --body "Please update ${package_name} to version ${version}" --repo "MetaMask/metamask-extension" --label "$teams"
gh issue create --title "Update ${package_name} to version ${version}" --body "Please update ${package_name} to version ${version}" --repo "MetaMask/metamask-mobile" --label "$teams"
fi
fi
done
shell: bash
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

create-update-issues:
name: Create update issues
needs: [is-release, publish-release]
if: needs.is-release.outputs.IS_RELEASE == 'true'
uses: ./.github/workflows/create-update-issues.yaml
secrets:
CORE_CREATE_UPDATE_ISSUES_TOKEN: ${{ secrets.CORE_CREATE_UPDATE_ISSUES_TOKEN }}

all-jobs-complete:
name: All jobs complete
runs-on: ubuntu-latest
Expand Down
36 changes: 36 additions & 0 deletions teams.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"metamask/accounts-controller": "team-accounts",
"metamask/address-book-controller": "team-confirmations",
"metamask/announcement-controller": "team-wallet-ux",
"metamask/approval-controller": "team-confirmations",
"metamask/assets-controllers": "team-assets",
"metamask/base-controller": "team-wallet-framework",
"metamask/build-utils": "team-wallet-framework",
"metamask/chain-controller": "team-accounts",
"metamask/composable-controller": "team-wallet-framework",
"metamask/controller-utils": "team-wallet-framework",
"metamask/ens-controller": "team-confirmations",
"metamask/eth-json-rpc-provider": "team-wallet-api-platform,team-wallet-framework",
"metamask/gas-fee-controller": "team-confirmations",
"metamask/json-rpc-engine": "team-wallet-api-platform,team-wallet-framework",
"metamask/json-rpc-middleware-stream": "team-wallet-api-platform,team-wallet-framework",
"metamask/keyring-controller": "team-accounts",
"metamask/logging-controller": "team-confirmations",
"metamask/message-manager": "team-confirmations",
"metamask/name-controller": "team-confirmations",
"metamask/network-controller": "team-wallet-framework,team-assets",
"metamask/notification-controller": "team-snaps-platform",
"metamask/notification-services-controller": "team-notifications",
"metamask/permission-controller": "team-wallet-api-platform,team-wallet-framework,team-snaps-platform",
"metamask/permission-log-controller": "team-wallet-api-platform,team-wallet-framework",
"metamask/phishing-controller": "team-product-safety",
"metamask/polling-controller": "team-wallet-framework",
"metamask/preferences-controller": "team-wallet-framework",
"metamask/profile-sync-controller": "team-notifications",
"metamask/queued-request-controller": "team-wallet-api-platform",
"metamask/rate-limit-controller": "team-snaps-platform",
"metamask/selected-network-controller": "team-wallet-api-platform,team-wallet-framework,team-assets",
"metamask/signature-controller": "team-confirmations",
"metamask/transaction-controller": "team-confirmations",
"metamask/user-operation-controller": "team-confirmations"
}

0 comments on commit 5526c7a

Please sign in to comment.