Skip to content

test: MMQA-1609 - feature flag registry slack notification and create PR#229

Merged
LeVinhGithub merged 8 commits into
mainfrom
harry/MMQA-ff-drift-and-create-pr
Mar 25, 2026
Merged

test: MMQA-1609 - feature flag registry slack notification and create PR#229
LeVinhGithub merged 8 commits into
mainfrom
harry/MMQA-ff-drift-and-create-pr

Conversation

@LeVinhGithub
Copy link
Copy Markdown
Contributor

@LeVinhGithub LeVinhGithub commented Mar 18, 2026

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-noti action

Composite action that posts a Slack message when drift is detected. Uses slackapi/slack-github-action with inputs for title (e.g. MetaMask Extension), slack-webhook, and workflow-run-url. Sends a formatted message that links to the workflow run and suggests running yarn feature-flags:sync:update locally.

2. create-pr-feature-flag-registry-drift reusable workflow

Reusable workflow (workflow_call) for repos that detect drift and upload registry + report artifacts:

  • Inputs: repository, registry-file-path, registry-artifact-name, report-artifact-name
  • Secrets: github-token (requires contents: write and pull-requests: write)
image

Flow:

  1. Checkout and download the registry and report artifacts.
  2. Build PR body from report.json in the report artifact.
  3. Create branch qa/sync-ff-flag-<timestamp>, copy the registry into the repo, commit, and push.
  4. Open a PR titled [QA] Sync Feature Flag Registry with team-qa label, base main, and body including the drift report JSON.

Caller workflows should upload the updated registry and report.json as artifacts, then invoke this workflow to create the sync PR.

Screenshot:

Open PR:
image

Slack notification:
image


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 timestamped qa/sync-ff-registry-* branch, closes older stale sync PRs, and opens a new PR (optionally labeled), exposing pr-url/has-changes outputs for callers.

Written by Cursor Bugbot for commit 01e3ae0. This will update automatically on new commits. Configure here.

@LeVinhGithub LeVinhGithub self-assigned this Mar 18, 2026
- 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
@LeVinhGithub LeVinhGithub force-pushed the harry/MMQA-ff-drift-and-create-pr branch from d71a770 to 482c66f Compare March 18, 2026 08:45
@LeVinhGithub LeVinhGithub changed the title test: init test: feature flag registry slack notification and create PR Mar 18, 2026
@LeVinhGithub LeVinhGithub marked this pull request as ready for review March 19, 2026 03:14
@LeVinhGithub LeVinhGithub changed the title test: feature flag registry slack notification and create PR test: MMQA-1609 - feature flag registry slack notification and create PR Mar 19, 2026
@LeVinhGithub LeVinhGithub requested a review from seaona March 19, 2026 03:32
Comment thread .github/workflows/create-pr-feature-flag-registry-drift.yml Outdated
Comment thread .github/workflows/create-pr-feature-flag-registry-drift.yml Outdated
@LeVinhGithub LeVinhGithub merged commit 821ac3f into main Mar 25, 2026
21 checks passed
@LeVinhGithub LeVinhGithub deleted the harry/MMQA-ff-drift-and-create-pr branch March 25, 2026 08:16
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)

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](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)

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants