Uh oh!
There was an error while loading. Please reload this page.
Add way to view pkg changes since latest release - #1390
Conversation
Uh oh!
There was an error while loading. Please reload this page.
ec7aee1 to
2ea22c8CompareWhen creating a new release, it can be helpful to be able to view the changes that have been made to a package since its most recent release. This commit adds a package script, `since-latest-release`, which can be used to accomplish this. This script is simply a shortcut for a commit range, so you can plug any Git command that takes a commit range into it. For instance, to view the list of latest commits for `@metamask/assets-controllers`, you can use `log`: yarn workspace @metamask/assets-controllers since-latest-release log Or to view all changes, you can use `diff`: yarn workspace @metamask/assets-controllers since-latest-release diff Or you can leave an argument off to just get the names of commits: yarn workspace @metamask/assets-controllers since-latest-release
2ea22c8 to
76ed164CompareHint: if you stick this in your shell configuration: yw() {
local command="workspace"if [[ $1=="focus"||$1=="foreach"||$1=="list" ]];then
command="workspaces"fi
yarn $command"$@"
}then you can shorten the above to, e.g.: |
| determine-commit-range() { | ||
| if [[ "$1" =~ ^release/ ]]; then | ||
| echo "$previous_release_commit..main" |
There was a problem hiding this comment.
This makes it so that if you're on a release branch, the list of changes you see don't include any of the commits in the release branch itself.
mikesposito
left a comment
There was a problem hiding this comment.
I tried to execute different types of commands, but I was initially confused by the results: it showed 45a2971 as oldest commit for @metamask/keyring-controller, which was released a while ago.
Apparently, for it to work correctly git fetch should be executed first. It makes sense, but perhaps since this is supposed to be a "batteries-included" script we could run it automatically before running the command so that results don't get stale?
This looks good regardless of the above optional suggestion
@mikesposito Okay, thanks for the review. This command is designed to make creating releases easier, so that gets me thinking: Do you think this utility belongs in create-release-branch instead? Then we can assume that the user is running this from a release branch (which should be up to date) and not from, say, |
I'll go ahead and merge this as I think this could be useful. I hesitate to run |
mcmire
commented
Jun 26, 2024
Resolved a lint failure. |
cryptodev-2s
commented
Jul 24, 2024
Looks good to me. The branch needs to be rebased. Additionally, there are some typos in the PR description: replace |
This adds the `since-latest-release` script, which is a copy of the script in `MetaMask/core`. See MetaMask/core#1390 for more info.
## Explanation Update the template used by the `create-package` script. The previous template was no longer compatible with our Yarn constraints. ## References Here are the PRs related to these specific changes: * #4648 * #3645 * #1390 * #3668 ## Changelog N/A ## 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/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
Description
When creating a new release, it can be helpful to be able to view the changes that have been made to a package since its most recent release. This commit adds a package script,
since-latest-release, which can be used to accomplish this.This script is simply a shortcut for a commit range, so you can plug any Git command that takes a commit range into it. For instance, to view the list of latest commits for
@metamask/assets-controllers, you can uselog:Or to view all changes, you can use
diff:Or you can leave an argument off to just get the names of commits:
Testing
Try running the command above, using a package that has new changes. Try to break it.
Changes
(No user-facing changes; this is a developer-only change.)
References
Checklist