-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add script for tag porting when migrating libraries into the core monorepo #1802
Conversation
6c5cd51
to
9e82fc4
Compare
## Explanation This PR implements the following incremental steps in the process for migrating `eth-json-rpc-provider` into the core monorepo: *** ### Phase B: Staging from `merged-packages/` #### 5. Port tags - See: #1800 <details> <summary>Push ported tags to core repo</summary> - [x] https://github.com/MetaMask/core/releases/tag/@metamask/[email protected] - [x] https://github.com/MetaMask/core/releases/tag/@metamask/[email protected] - [x] https://github.com/MetaMask/core/releases/tag/@metamask/[email protected] - [x] https://github.com/MetaMask/core/releases/tag/@metamask/[email protected] - [x] https://github.com/MetaMask/core/releases/tag/@metamask/[email protected] </details> <details> <summary>Verify that the tag diff links in CHANGELOG are working</summary> - [x] **WONTFIX**: https://github.com/MetaMask/core/compare/@metamask/[email protected] - [x] https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected] - [x] https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected] - [x] https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected] - [x] https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected] </details> ### Phase C: Integration into `packages/` #### 1. The big leap - [x] **Move migration target from `migrated-packages/` to `packages/`.** - [x] Run `yarn install` in the root directory. - [x] Check that all tests are passing in migration target by running `yarn workspace @metamask/<package-name> test`. #### 2. Update downstream repos - [x] Add tsconfig reference paths for migration target in downstream packages and root. - [x] Bump migration target version in downstream packages and root. #### 3. Linter fixes - [x] Apply yarn constraints fixes to migration target package.json file: `yarn constraints --fix` (run twice). - [x] Identify validator fixes for CHANGELOG using `yarn workspace @metamask/<package-name> changelog:validate` and apply the diffs. #### 4. Resolve downstream errors - [x] #1653 - If introducing the migration target breaks any downstream repos: - [x] Resolve simple errors - [x] Mark and ignore complex errors using `@ts-expect-error TODO:` annotations. - [x] Create a separate issue for resolving the marked errors as soon as the migration is completed. #### 5. Finalize merge - [x] Check that all tests are passing in all subpackages of core and CI. - [x] Merge `packages/<package-name>` directory into core main branch. *** See #1551 (comment) for an outline of the entire process. ## Next Steps - The next PR(s) will implement the final steps of the migration process (D-1 in the migration checklist). ## Blocked by - Dependencies: - [x] typescript bump: #1718 - [x] `@metamask/utils` bump: #1639 - Downstream type errors: - [x] #1653 - [ ] MetaMask/eth-json-rpc-provider#14 (ignored) - [ ] MetaMask/utils#140 (ignored) - Tag porting: - [x] #1802 - [x] "Unreleased" tag diff link shows entire history of core: https://github.com/MetaMask/core/compare/@metamask/[email protected] ## References - Contributes to #1685 - Contributes to #1551 ## Changelog <!-- If you're making any consumer-facing changes, list those changes here as if you were updating a changelog, using the template below as a guide. (CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or FIXED. For security-related issues, follow the Security Advisory process.) Please take care to name the exact pieces of the API you've added or changed (e.g. types, interfaces, functions, or methods). If there are any breaking changes, make sure to offer a solution for consumers to follow once they upgrade to the changes. Finally, if you're only making changes to development scripts or tests, you may replace the template below with "None". --> ### `@metamask/eth-json-rpc-provider` - **ADDED**: Migrated into the core monorepo. ## 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 highlighted breaking changes using the "BREAKING" category above as appropriate
9e82fc4
to
607a4c2
Compare
@MajorLift Just a reminder here that when testing out this script, it would be better to test this out on a fork of |
Yes absolutely. I won't push any tags to core with the script while it's in development. |
1cde98c
to
8086691
Compare
0afc885
to
c6299c7
Compare
0a80e1b
to
78221ed
Compare
676791b
to
365b34e
Compare
…original repo tag names
Co-authored-by: Elliot Winkler <[email protected]>
Co-authored-by: Elliot Winkler <[email protected]>
…dling for `get-version-commit-pairs` Co-authored-by: Elliot Winkler <[email protected]>
Co-authored-by: Elliot Winkler <[email protected]>
178dda7
to
f7223de
Compare
Co-authored-by: Elliot Winkler <[email protected]>
a545caf
to
94267a5
Compare
Co-authored-by: Elliot Winkler <[email protected]>
c7b2c15
to
de26e4f
Compare
Note: We could manually create any omitted tags in the original repo as a preparation step before the migration. |
Sure. We could also create them in this repo after migration. If some links in the changelog were already broken before the migration, then it's not a huge deal if they're still broken afterward (as long as we fix them at some point, of course). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting close! Just one more thing.
7bec9fd
to
0f6faaf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience and working through all my comments on this PR! This looks good to me now.
Motivation
When migrating libraries into core, the tags need to be ported and renamed to fit the core repo release tag naming scheme:
v[major].[minor].[patch]
for core repo releases@metamask/<package-name>@[major].[minor].[patch]
for package releases.However, the migration process entails rewriting the git history of the original repo, which changes all of the commit hashes.
So in order to port tags attached to release commits from the original repo to core, we need a script to automate the process of finding the release commits from the migrated/rewritten git history, and recreating + renaming + attaching the corresponding tags.
Instructions
migrate-tags.md
Feature Checklist
migrate-tags.md > B. Options
).merged-packages/<package-name>
.@metamask/<package-name>@
to the version numbers.git tag <package-name> [commit hash]
command.git push <remote-repo> [tag-name]
command.-non-dry-run
flag required for tags to be created and pushed.Status
Successfully tested on fork of core:
json-rpc-engine
,json-rpc-middleware-stream
,eth-json-rpc-provider
tags: https://github.com/MajorLift/metamask-core/tagsjson-rpc-engine
before and after rename (6.1.0 vs. 7.0.0):https://github.com/MajorLift/metamask-core/compare/[email protected]...@metamask/[email protected]
json-rpc-middleware-stream
tags:https://github.com/MajorLift/metamask-core/compare/[email protected]@5.0.1
References
eth-json-rpc-provider
into core monorepo #1551 (comment) for an outline of the migration process.Changelog
N/A. No end user-facing changes.
Checklist