Convert get-changeset-arguments.sh to TypeScript and add tests#4679
Merged
Convert get-changeset-arguments.sh to TypeScript and add tests#4679
Conversation
|
7a07da7 to
50e8bc9
Compare
mxiao-cll
approved these changes
Feb 27, 2026
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.
Description
When we want to release a single EA or a subset of EAs, we need to pass a list of packages to ignore to
yarn changeset version. This list or arguments is computed by.github/scripts/get-changeset-arguments.sh. This script is quite fragile and has needed a number of changes to work around issues. Since there are no tests for it, it's easy to introduce a new bug when fixing a bug.In this PR we replace the shell script with a Node script and add extensive testing.
The rules to determine the arguments to pass are as follows:
changeset)changeset)Changes
packages/scripts/src/get-changeset-arguments/index.tsto parse arguments and produce output.lib.tswith the core logic.repo.tsandrealRepo.tsto manage filesystem access and to facilitate injecting repo structures for tests so tests don't start failing when the real repo changes.yarn get-changeset-argumentsscript entry inpackage.json.yarn get-changeset-argumentsinstead of.github/scripts/get-changeset-arguments.shfrom.github/workflows/upsert-release-pr.yml.yarn get-changeset-argumentsfrom.github/scripts/get-changeset-arguments.shfor backwards compatibility (in case it's mentioned in documentation or used in any personal scripts).Steps to Test
fixture.tsto create a temporary repo structure to test real filesystem access.Quality Assurance
infra-k8sconfiguration file.adapter-secretsconfiguration file.test-payload.jsonfile with relevant requests.feature/x,chore/x,release/x,hotfix/x,fix/x) or is created from Jira.