Skip to content

Add script for tag porting when migrating libraries into the core monorepo #1800

@MajorLift

Description

@MajorLift

Motivation

We need a standardized, automated way of porting tags for libraries migrated into merged-packages/ that satisfies the following:

  1. Distinguishes between releases of the monorepo root vs. non-root subpackages by prepending a package name prefix to all tag names of libraries that are migrated into the monorepo.
  • monorepo root release tags: v<maj>.<min>.<patch>
  • non-root subpackage release tags: @metamask/<package-name>@<maj>.<min>.<patch>
  1. Ensures that tag diff links in the target package's CHANGELOG correctly point to valid tags in core after migration.
  • e.g. https://github.com/MetaMask/core/compare/@metamask/<package-name>@<maj>.<min>.<patch>...@metamask/<package-name>@<maj>.<min>.<patch>

Considerations

  • If the target library was renamed at any point, the tag name prefixes should display the correct original package name that corresponds to the tag version.
  • The release commit hashes in the rewritten git history in core will not match the hashes for the tagged commits in the original repo.

Process

  1. Find the new hashes for the release commits from the migrated commit history of the target package directory in merged-packages/.
  2. Identify tags where the package was renamed.
  3. Map each version number and package name onto the corresponding release commit hash.
  4. Add the tags by running git tag <tag-name> [commit-hash] for each tag-commit pair with the correct package name prepended onto the tag name.

Blocked by

References

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestteam-wallet-frameworkDeprecated: Please use `team-core-platform` instead.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions