Skip to content

Convert get-changeset-arguments.sh to TypeScript and add tests#4679

Merged
dskloetc merged 30 commits intomainfrom
kloet/changeset-version-args-ts
Feb 27, 2026
Merged

Convert get-changeset-arguments.sh to TypeScript and add tests#4679
dskloetc merged 30 commits intomainfrom
kloet/changeset-version-args-ts

Conversation

@dskloetc
Copy link
Contributor

@dskloetc dskloetc commented Feb 27, 2026

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:

  1. Determine which packages to include:
    1. If a package is included, its dependencies have to be included as well (this is a requirement from changeset)
    2. If a package listed in a changeset file is included, other packages listed in the same changeset file have to be included (also a requirement from changeset)
    3. If an included package has changes, packages depending on that package have to be included as well. This is required because we give those depending packages a patch version bump.
  2. Determine the list of all packages.
  3. Ignore all the packages that should not be included.

Changes

  1. Add packages/scripts/src/get-changeset-arguments/index.ts to parse arguments and produce output.
  2. Add lib.ts with the core logic.
  3. Add repo.ts and realRepo.ts to manage filesystem access and to facilitate injecting repo structures for tests so tests don't start failing when the real repo changes.
  4. Add yarn get-changeset-arguments script entry in package.json.
  5. Call from yarn get-changeset-arguments instead of .github/scripts/get-changeset-arguments.sh from .github/workflows/upsert-release-pr.yml.
  6. Call yarn get-changeset-arguments from .github/scripts/get-changeset-arguments.sh for backwards compatibility (in case it's mentioned in documentation or used in any personal scripts).

Steps to Test

  1. Added unit tests.
  2. Added fixture.ts to create a temporary repo structure to test real filesystem access.
  3. export GITHUB_TOKEN=$(gh auth token)
    yarn changeset version $(.github/scripts/get-changeset-arguments.sh view-function-multi-chain)`
    

Quality Assurance

  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant infra-k8s configuration file.
  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant adapter-secrets configuration file.
  • If a new adapter was made, or a new endpoint was added, update the test-payload.json file with relevant requests.
  • The branch naming follows git flow (feature/x, chore/x, release/x, hotfix/x, fix/x) or is created from Jira.
  • This is related to a maximum of one Jira story or GitHub issue.
  • Types are safe (avoid TypeScript/TSLint features like any and disable, instead use more specific types).
  • All code changes have 100% unit and integration test coverage. If testing is not applicable or too difficult to justify doing, the reasoning should be documented explicitly in the PR.

@changeset-bot
Copy link

changeset-bot bot commented Feb 27, 2026

⚠️ No Changeset found

Latest commit: fb41355

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dskloetc dskloetc force-pushed the kloet/changeset-version-args-ts branch from 7a07da7 to 50e8bc9 Compare February 27, 2026 09:31
@dskloetc dskloetc changed the title Kloet/changeset version args ts Convert get-changeset-arguments.sh to TypeScript and add tests Feb 27, 2026
@dskloetc dskloetc marked this pull request as ready for review February 27, 2026 09:48
@dskloetc dskloetc requested a review from a team as a code owner February 27, 2026 09:48
@dskloetc dskloetc enabled auto-merge (squash) February 27, 2026 15:19
@dskloetc dskloetc merged commit c21bf2d into main Feb 27, 2026
15 of 16 checks passed
@dskloetc dskloetc deleted the kloet/changeset-version-args-ts branch February 27, 2026 15:26
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.

2 participants