Skip to content

feat: added codeowners changes pipeline - #28153

Closed
juanmigdr wants to merge 1 commit into
mainfrom
feat/codeowners-changes-pipeline
Closed

juanmigdr wants to merge 1 commit into
mainfrom
feat/codeowners-changes-pipeline

Conversation

@juanmigdr

@juanmigdr juanmigdr commented Mar 31, 2026 •

Copy link
Copy Markdown
Member

Description

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

Note

Medium Risk
Medium risk because it introduces new GitHub Actions automation with pull-requests: write permission and custom glob-to-regex parsing that could misattribute ownership or spam/overwrite comments if incorrect.

Overview
Adds an automated PR comment that summarizes changed files by their CODEOWNERS owners and highlights any unowned changes.

Introduces .github/scripts/codeowners-comment.mjs to parse .github/CODEOWNERS, map PR-changed filenames to the last matching rule (including ownerless overrides like **/*.snap), and generate a table plus expandable file lists.

Adds .github/workflows/codeowners-comment.yml to run on PR open/sync (non-forks), fetch changed files via gh api, generate the markdown, and create/update a single marker-tagged comment.

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

@juanmigdr
juanmigdr requested a review from a team as a code owner March 31, 2026 11:36
@github-actions

Copy link
Copy Markdown
Contributor

Code Owners Breakdown

Team Files
@MetaMask/mobile-platform 2

2 files changed across 1 team


@MetaMask/mobile-platform (2 files)
  • .github/scripts/codeowners-comment.mjs
  • .github/workflows/codeowners-comment.yml

@github-actions github-actions Bot added size-M risk-low Low testing needed · Low bug introduction risk labels Mar 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 99%
click to see 🤖 AI reasoning details

E2E Test Selection:
Both changed files are brand-new GitHub Actions CI tooling additions with no impact on the MetaMask Mobile app code:

  1. .github/workflows/codeowners-comment.yml - A new workflow that posts CODEOWNERS breakdown comments on PRs. It only interacts with the GitHub API to read PR files and post comments. It has no connection to the app build, test execution, or any app functionality.

  2. .github/scripts/codeowners-comment.mjs - A supporting Node.js script that parses CODEOWNERS and generates markdown. It runs only in CI context as part of the above workflow.

Neither file touches: app source code, controllers, navigation, UI components, E2E test infrastructure (tests/, page-objects, fixtures, .detoxrc.js), build configuration, or any user-facing functionality. These are purely developer tooling additions for PR workflow automation. No E2E tests are needed to validate these changes.

Performance Test Selection:
The changes are purely GitHub Actions workflow and script additions for CODEOWNERS comment automation. They have no impact on app performance, rendering, data loading, or any runtime behavior of the MetaMask Mobile app. No performance tests are warranted.

View GitHub Actions results

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

p = p.replace(/\*\*\//g, '((.+/)|)'); // **/ → any prefix or nothing
p = p.replace(/\/\*\*/g, '(/.*)?'); // /** → any suffix (optional)
p = p.replace(/\*\*/g, '.*'); // lone ** → anything
p = p.replace(/\*/g, '[^/]*'); // * → one segment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Glob-to-regex * replacement corrupts earlier regex output

High Severity

The final p.replace(/\*/g, '[^/]*') on line 27 matches literal * characters that were already emitted as regex metacharacters by the /** and ** replacements on lines 25–26. For example, /** becomes (/.*)?, but then the * inside .* is corrupted to [^/]*, producing (/.[^/]*)? — which only matches a single path segment instead of crossing / boundaries. This breaks all **/dir/** patterns in the CODEOWNERS file (20+ rules across ~10 teams), causing deeply nested files to be incorrectly classified as "Unowned."

Additional Locations (1)
Fix in Cursor Fix in Web

p = p.replace(/\*\*\//g, '((.+/)|)'); // **/ → any prefix or nothing
p = p.replace(/\/\*\*/g, '(/.*)?'); // /** → any suffix (optional)
p = p.replace(/\*\*/g, '.*'); // lone ** → anything
p = p.replace(/\*/g, '[^/]*'); // * → one segment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Glob ? detected but never converted to regex

Low Severity

The hasTrailingWildcard check on line 18 treats ? as a glob wildcard, and the comment on line 20 says it's left for glob conversion, but no conversion step ever translates glob ? (match any single character) into its regex equivalent (e.g., [^/]). It's also not in the escape list on line 21. An unescaped ? in a regex acts as a "0 or 1" quantifier on the preceding element, which is semantically wrong for glob ?. No current CODEOWNERS pattern uses ?, but any future pattern containing it will silently produce incorrect matching.

Fix in Cursor Fix in Web

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.

@github-actions github-actions Bot added the stale Issues that have not had activity in the last 90 days label Jun 30, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

This PR was closed because there has been no follow up activity in 7 days. Thank you for your contributions.

@github-actions github-actions Bot closed this Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk-low Low testing needed · Low bug introduction risk size-M stale Issues that have not had activity in the last 90 days team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants