test: MMQA-1609 - feature flag registry slack notification and create PR#229
Merged
Conversation
- Add feature-flag-drift-report action (Slack notification with optional pr-url) - Add check-feature-flag-registry-drift reusable workflow (creates PR, outputs pr-url) - Use download-artifact@v7 with explicit path for artifacts - Use github.run_id and repository in branch name to avoid collisions - Add registry file validation before cp - Include repository in PR title Made-with: Cursor
d71a770 to
482c66f
Compare
7 tasks
pnarayanaswamy
approved these changes
Mar 25, 2026
7 tasks
github-merge-queue Bot
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Mar 26, 2026
…t so the team can review (#41182) <!-- 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** Updates the `check-feature-flag-registry-drift.yml` workflow to use reusable components from [`MetaMask/github-tools#229`](MetaMask/github-tools#229) instead of inline logic. When drift is detected, the workflow now: - Automatically creates a sync PR with the updated registry file (via `MetaMask/github-tools/.github/workflows/create-pr-feature-flag-registry-drift.yml`) - Sends a Slack notification that includes a link to the sync PR (via `MetaMask/github-tools/.github/actions/feature-flag-drift-slack-noti`) Key changes: - Split the single job into three: **check**, **create-drift-pr**, and **notify-slack** - Added a step to run `yarn feature-flags:sync:update` and upload the updated registry as an artifact - Replaced the inline `slackapi/slack-github-action` step with the reusable composite action from `github-tools` - Updated permissions from `contents: read` to `contents: write` + `pull-requests: write` (required for PR creation) [](https://codespaces.new/MetaMask/metamask-extension/pull/41182?quickstart=1) ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: [MMQA-1609](https://consensyssoftware.atlassian.net/browse/MMQA-1609) ## **Manual testing steps** 1. Trigger the workflow manually via `workflow_dispatch`. 2. Verify the `check-feature-flag-registry` job detects drift and uploads artifacts. 3. Verify the `create-drift-pr` job creates a sync PR with the updated registry. 4. Verify the `notify-slack` job sends a Slack notification with links to the workflow run and the sync PR. <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **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/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/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. [MMQA-1609]: https://consensyssoftware.atlassian.net/browse/MMQA-1609?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Medium risk because it changes GitHub Actions permissions to `contents: write`/`pull-requests: write` and introduces automated PR creation, which can affect repo state if misconfigured. > > **Overview** > When production feature-flag drift is detected, the workflow now **updates the local registry**, uploads both the drift report and updated registry as artifacts, and triggers a reusable `github-tools` workflow to **open an automated sync PR**. > > Slack notifications are moved into a dedicated job using a reusable `github-tools` action and now include the created PR URL; workflow permissions are expanded to allow writing contents and creating PRs. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit cb5c437. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
github-merge-queue Bot
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Mar 26, 2026
…t so the team can review (#41182) <!-- 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** Updates the `check-feature-flag-registry-drift.yml` workflow to use reusable components from [`MetaMask/github-tools#229`](MetaMask/github-tools#229) instead of inline logic. When drift is detected, the workflow now: - Automatically creates a sync PR with the updated registry file (via `MetaMask/github-tools/.github/workflows/create-pr-feature-flag-registry-drift.yml`) - Sends a Slack notification that includes a link to the sync PR (via `MetaMask/github-tools/.github/actions/feature-flag-drift-slack-noti`) Key changes: - Split the single job into three: **check**, **create-drift-pr**, and **notify-slack** - Added a step to run `yarn feature-flags:sync:update` and upload the updated registry as an artifact - Replaced the inline `slackapi/slack-github-action` step with the reusable composite action from `github-tools` - Updated permissions from `contents: read` to `contents: write` + `pull-requests: write` (required for PR creation) [](https://codespaces.new/MetaMask/metamask-extension/pull/41182?quickstart=1) ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: [MMQA-1609](https://consensyssoftware.atlassian.net/browse/MMQA-1609) ## **Manual testing steps** 1. Trigger the workflow manually via `workflow_dispatch`. 2. Verify the `check-feature-flag-registry` job detects drift and uploads artifacts. 3. Verify the `create-drift-pr` job creates a sync PR with the updated registry. 4. Verify the `notify-slack` job sends a Slack notification with links to the workflow run and the sync PR. <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **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/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/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. [MMQA-1609]: https://consensyssoftware.atlassian.net/browse/MMQA-1609?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Medium risk because it changes GitHub Actions permissions to `contents: write`/`pull-requests: write` and introduces automated PR creation, which can affect repo state if misconfigured. > > **Overview** > When production feature-flag drift is detected, the workflow now **updates the local registry**, uploads both the drift report and updated registry as artifacts, and triggers a reusable `github-tools` workflow to **open an automated sync PR**. > > Slack notifications are moved into a dedicated job using a reusable `github-tools` action and now include the created PR URL; workflow permissions are expanded to allow writing contents and creating PRs. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit cb5c437. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds tooling for feature flag drift between E2E and production: a Slack notification action and a reusable workflow that creates PRs with registry updates.
Changes
1.
feature-flag-drift-slack-notiactionComposite action that posts a Slack message when drift is detected. Uses
slackapi/slack-github-actionwith inputs fortitle(e.g. MetaMask Extension),slack-webhook, andworkflow-run-url. Sends a formatted message that links to the workflow run and suggests runningyarn feature-flags:sync:updatelocally.2.
create-pr-feature-flag-registry-driftreusable workflowReusable workflow (
workflow_call) for repos that detect drift and upload registry + report artifacts:repository,registry-file-path,registry-artifact-name,report-artifact-namegithub-token(requirescontents: writeandpull-requests: write)Flow:
report.jsonin the report artifact.qa/sync-ff-flag-<timestamp>, copy the registry into the repo, commit, and push.[QA] Sync Feature Flag Registrywithteam-qalabel, basemain, and body including the drift report JSON.Caller workflows should upload the updated registry and
report.jsonas artifacts, then invoke this workflow to create the sync PR.Screenshot:
Open PR:

Slack notification:

Note
Medium Risk
Adds new GitHub automation that can push branches and open/close PRs in target repos and post to Slack; misconfiguration could create noise or unintended repo changes, but scope is limited to CI workflows.
Overview
Adds a new composite action,
feature-flag-drift-slack-noti, that builds a structured Slack payload (optionally including a created sync PR link) and posts it via an incoming webhook when drift is detected.Introduces a reusable workflow,
create-pr-feature-flag-registry-drift.yml, that downloads drift artifacts, generates a PR body, commits the updated registry file onto a timestampedqa/sync-ff-registry-*branch, closes older stale sync PRs, and opens a new PR (optionally labeled), exposingpr-url/has-changesoutputs for callers.Written by Cursor Bugbot for commit 01e3ae0. This will update automatically on new commits. Configure here.