Skip to content

Swaps4229 extract controller calls#8215

Draft
micaelae wants to merge 48 commits intomainfrom
swaps4229-extract-controller-calls
Draft

Swaps4229 extract controller calls#8215
micaelae wants to merge 48 commits intomainfrom
swaps4229-extract-controller-calls

Conversation

@micaelae
Copy link
Member

Explanation

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@micaelae micaelae force-pushed the swaps4229-extract-controller-calls branch 3 times, most recently from 4f35424 to 5ba917f Compare March 17, 2026 04:16
@micaelae micaelae force-pushed the swaps4229-extract-controller-calls branch 2 times, most recently from 0f1f010 to 52145e4 Compare March 17, 2026 17:56
@micaelae micaelae force-pushed the swaps4229-extract-controller-calls branch 2 times, most recently from 8eca356 to 682da9c Compare March 18, 2026 19:36
mikesposito and others added 20 commits March 18, 2026 23:03
## Explanation

<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->
`ConfigRegistryController` is being refactored to simplify messenger
event listeners attached on construction. The controller functionality
should be exactly the same.

## References

<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?

For example:

* Fixes #12345
* Related to #67890
-->
N/A

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes the controller’s polling lifecycle triggers and adds a new
required messenger permission (`KeyringController:getState`), which
could impact when config fetching starts/stops if consumers don’t update
delegation or if event/flag semantics differ.
> 
> **Overview**
> Refactors `ConfigRegistryController` construction-time subscriptions
into dedicated private handlers (`#onUnlock`, `#onLock`,
`#onFeatureFlagChange`) and switches feature-flag change handling to use
the event’s selected flag value plus `KeyringController:getState` to
gate polling on wallet-unlocked state.
> 
> Removes the `isConfigRegistryApiEnabled` utility and its tests,
updates controller/tests accordingly, and documents a **breaking**
messenger requirement: consumers must allow `KeyringController:getState`
for `ConfigRegistryControllerMessenger`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ec294ce. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## Explanation

Replace the inline preview build workflow with the reusable
`publish-preview` workflow from `MetaMask/github-tools@v1` and delete
old scripts that are no longer needed.

## References

- MetaMask/github-tools#223
- MetaMask/github-tools#227

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [x] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> CI publishing logic is replaced with a reusable workflow, which
changes how preview artifacts are built and published with an NPM token.
Risk is moderate because it impacts the release pipeline, but the change
is largely a refactor/removal of custom scripting.
> 
> **Overview**
> Replaces the repo’s inline `publish-preview` GitHub Actions workflow
(fork checks, build/upload artifacts, manifest validation, publish, and
PR commenting) with a single call to the reusable
`MetaMask/github-tools` `publish-preview` workflow.
> 
> Removes the now-unused local preview-build helper scripts
(`scripts/generate-preview-build-message.ts`,
`scripts/prepare-preview-builds.sh`, and
`scripts/prepare-preview-builds.jq`).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
183cdc7. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## Explanation

The reusable `publish-preview` workflow from `github-tools` requires
`contents: read` (checkout) and `pull-requests: write` (PR comment).
MetaMask's org restricts default token permissions to read-only, so
these must be explicitly declared by the caller.

## References

- Fixes workflow validation error from #8233

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [x] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: only updates workflow permissions, with no product code or
runtime logic changes.
> 
> **Overview**
> Ensures the reusable `publish-preview` GitHub Actions workflow can run
under restricted org defaults by explicitly granting `contents: read`
(checkout) and `pull-requests: write` (PR commenting) permissions.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
cd67686. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
squash accounts

squash accounts

accounts
squash intent test

squash unit test

test

test
fix: gas tests

refactor: extract more transaction controller utils

transaction

refactor: move txDataByType to addTransactionBatch util
chore: type

squash to refactor
Base automatically changed from swaps3560-submitTx-handlers to main March 19, 2026 17:16
@micaelae micaelae force-pushed the swaps4229-extract-controller-calls branch from 682da9c to a6bca2f Compare March 19, 2026 20:50
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.

3 participants