Conversation
mcmire
force-pushed
the
refactor-codeowners
branch
3 times, most recently
from
September 17, 2026 19:22
8859b8c to
9934c74
Compare
In a previous commit we added a configuration file, `codeowners.ts`, which was intended to help contributors define codeowners for packages more easily. However, in an effort to preserve existing grouping and sorting within `.github/CODEOWNERS` as much as possible, we were forced to include logic in the configuration file, which made it less maintainable than we'd liked. This commit changes `codeowners.ts` so that now all it contains is an exported configuration object, and the aforementioned logic to generate the CODEOWNERS file has been simplified. All packages and teams are now alphabetized, and the order of sections within CODEOWNERS is predetermined. For rare cases where customization is needed, an `overrides` property within the configuration file is available for use.
mcmire
force-pushed
the
refactor-codeowners
branch
from
September 17, 2026 19:28
9934c74 to
4a282fc
Compare
mcmire
marked this pull request as ready for review
September 17, 2026 19:38
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4a282fc. Configure here.
GitHub resolves CODEOWNERS using the last matching rule, so alphabetized package sections allowed the generic wallet rule to override earlier initialization rules. Emit generated initialization rules at the start of the final Overrides section so their configured owners take precedence, before explicit overrides that must remain last.
Render all Wallet initialization ownership rules directly after the generic wallet package rule. This keeps related rules together while preserving last-match precedence over the wallet ownership rule; explicit overrides remain in the final Overrides section.
mcmire
commented
Sep 17, 2026
| buildRuleForPackage('money-account-controller'), | ||
| buildRuleForPackage('snap-account-service'), | ||
| ], | ||
| const config = { |
Collaborator
Author
There was a problem hiding this comment.
The packages property in this configuration object should be equivalent to PACKAGES from before. overrides is a new property and replaced the custom rules that were spread out between buildFirstSection and buildJointTeamOwnershipSection.
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.

Explanation
In a previous commit (4a8e09d) we added a configuration file,
codeowners.ts, which was intended to help contributors define codeowners for packages more easily. However, in an effort to preserve existing grouping and sorting within.github/CODEOWNERSas much as possible, we were forced to include explicit generation logic in the configuration file, which made it less maintainable than we'd liked.This commit changes
codeowners.tsso that now all it contains is an exported configuration object, and the aforementioned logic to generate the CODEOWNERS file has been simplified. All packages and teams are now alphabetized, and the order of sections within CODEOWNERS is predetermined. For rare cases where customization is needed, anoverridesproperty within the configuration file is available for use.References
Checklist
Note
Medium Risk
Regenerating CODEOWNERS changes rule order and file layout, which can shift GitHub review requests even when team assignments are preserved; verify overrides still win for nested paths like wallet initialization.
Overview
codeowners.tsis now a declarative config (packages+overrides) instead of exporting hand-built sections and inline generation helpers. Package→team mappings and optionalinitializationPathvalues are unchanged in intent; generation logic moved intoscripts/manage-codeowners/(assemble.ts,render.ts,generate.ts) with unit tests.The regenerated
.github/CODEOWNERSdrops team-grouped sections in favor of a fixed layout: alphabetized Packages blocks (each package gets directory ownership, release files with@MetaMask/core-platformco-ownership, and wallet init paths under the wallet subsection), then an Overrides section (.github/, eth-json-rpc-middleware paths). Owner lists are sorted for consistent output. The CLI prelude is shorter;main.tscallsgenerateCodeownersFileContent(config).Reviewed by Cursor Bugbot for commit 6ae3b11. Bugbot is set up for automated code reviews on this repo. Configure here.