Skip to content

test: dry run of Changesets version + publish pipeline - #546

Open
thomasthachil wants to merge 9 commits into
mainfrom
test/changesets-dry-run
Open

test: dry run of Changesets version + publish pipeline#546
thomasthachil wants to merge 9 commits into
mainfrom
test/changesets-dry-run

Conversation

@thomasthachil

Copy link
Copy Markdown
Collaborator

Summary

This PR demonstrates a dry run of the Changesets version and publish pipeline against the base feat/changesets-migration branch. It validates that the entire dependency cascade works correctly before merging the migration to main.

What was done manually in this PR (the dry run)

We simulated the two-phase Changesets workflow that CI will automate:

Phase 1: Changeset file creation (simulating developer workflow)

  1. Added a test changeset file describing a minor change to @uniswap/sdk-core (adding a new test chain NEW_CHAIN = 100000 to chains.ts)
  2. This is what a developer would normally do: run yarn changeset and describe their change

Phase 2: Version bumping (simulating CI's "Version Packages" PR)

  1. Ran yarn version-packages (aka changeset version) locally
  2. This consumed the changeset file and produced:
    • @uniswap/sdk-core: 7.12.17.13.0 (minor bump, as declared in the changeset)
    • @uniswap/v2-sdk: 4.19.14.19.2 (patch bump — cascaded because it depends on sdk-core via workspace:~)
    • @uniswap/v3-sdk: 3.29.13.29.2 (patch bump — cascaded)
    • @uniswap/v4-sdk: 1.29.11.29.2 (patch bump — cascaded)
    • @uniswap/router-sdk: 2.7.12.7.2 (patch bump — cascaded, depends on sdk-core + v2/v3/v4)
    • @uniswap/smart-wallet-sdk: 2.5.02.5.1 (patch bump — cascaded, depends on sdk-core)
    • @uniswap/uniswapx-sdk: 3.0.03.0.1 (patch bump — cascaded, depends on sdk-core + permit2-sdk)
    • @uniswap/universal-router-sdk: 4.33.04.33.1 (patch bump — cascaded, depends on multiple workspace packages)
  3. Auto-generated CHANGELOG.md files for each bumped package with correct dependency references

What CI does naturally (once feat/changesets-migration is merged to main)

On every PR merge to main:

The release.yml workflow runs automatically via the changesets/action:

  1. If there are unreleased changeset files (.changeset/*.md):

    • The action runs yarn version-packages (same command we ran manually above)
    • It opens/updates a "Version Packages" PR that contains:
      • All version bumps in package.json files
      • Auto-generated CHANGELOG.md entries
      • Consumption (deletion) of the .changeset/*.md files
    • This PR accumulates — multiple merged PRs with changesets will all roll up into one Version Packages PR
    • The CODEOWNERS override (**/package.json and **/CHANGELOG.md owned by @Uniswap/swap-be @Uniswap/protocols) allows any of these teams to approve the automated version PR without needing every SDK owner
  2. If there are NO unreleased changeset files (i.e., the Version Packages PR itself was just merged):

    • The action runs yarn g:release (aka changeset publish)
    • This publishes all packages with new versions to npm with provenance
    • Each package is published with "access": "public" and "provenance": true

The dependency cascade via workspace:~ protocol:

  • Internal dependencies use workspace:~ (e.g., "@uniswap/sdk-core": "workspace:~")
  • During development, Yarn resolves these to the local workspace copy
  • At publish time, changeset publish rewrites workspace:~~7.13.0 (tilde range of the actual version)
  • The updateInternalDependencies: "patch" config in .changeset/config.json ensures that when sdk-core gets a version bump, all packages depending on it automatically get a patch bump
  • This means a single change to sdk-core correctly cascades version bumps to: v2-sdk, v3-sdk, v4-sdk, router-sdk, smart-wallet-sdk, uniswapx-sdk, and universal-router-sdk

Build order via Turborepo:

  • turbo.json now has "dependsOn": ["^build"] for the build task
  • This ensures packages are built in dependency order before changeset publish runs
  • e.g., sdk-core builds first, then v2-sdk/v3-sdk/v4-sdk, then router-sdk, then universal-router-sdk

Key files changed

  • sdks/sdk-core/src/chains.ts — added test chain NEW_CHAIN = 100000
  • sdks/*/package.json — version bumps from changeset version
  • sdks/*/CHANGELOG.md — auto-generated changelogs

This PR is NOT meant to be merged

This is a validation/dry-run PR to confirm the Changesets pipeline works end-to-end. The actual migration lives in feat/changesets-migration.

🤖 Generated with Claude Code

thomasthachil and others added 9 commits March 3, 2026 16:36
…tocol

Replace semantic-release with @changesets/cli for versioning and publishing.
Switch all internal workspace dependencies to use the workspace: protocol,
enabling single-PR chain additions instead of 4 sequential publish-wait-bump
cycles across packages.

Key changes:
- Install @changesets/cli, remove semantic-release packages
- Switch internal deps to workspace:^ (or workspace:* for exact pins)
- Remove semantic-release config blocks from all 11 SDK package.json files
- Add topological build ordering (dependsOn: ^build) to turbo.json
- Replace semantic-release.yaml workflow with changesets/action workflow
- Enable transparent workspaces in .yarnrc.yml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the semantic-release publishing docs with instructions for the
new Changesets-based workflow, including how to create changesets, how
the CI pipeline works, and the single-PR chain addition example.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Change v4-sdk's @uniswap/v3-sdk from workspace:* to workspace:^ to
  avoid publishing with an overly permissive "*" version range
- Pin changesets/action to commit SHA for supply chain security

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The manypkg check rule disallows devDependencies in the private root
package.json since there's no distinction in a private package. Move
@changesets/cli to dependencies to match the existing convention.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deduplicate js-yaml entries to pass monorepo integrity check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…atibility

Changesets requires version fields in package.json to manage versioning.
These were previously omitted because semantic-release managed versions
at publish time. Versions are set to the latest published npm versions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
workspace:^ publishes as ^X.Y.Z which satisfies minor bumps, preventing
changesets from cascading version bumps to dependent packages. workspace:~
publishes as ~X.Y.Z which only satisfies patch bumps, ensuring dependents
are re-published when a dependency gets a minor or major bump.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Version Packages PR touches package.json and CHANGELOG.md across all
packages, which would require approval from every CODEOWNERS team. This
adds an override so swap-be or protocols can approve version-only changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ran `changeset version` locally to simulate what CI would produce
when a changeset is merged. This validates that:
- sdk-core bumps to 7.13.0 (minor, from the test chain addition)
- All dependent packages cascade correctly via workspace:~ protocol
- CHANGELOGs are auto-generated with correct dependency references

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@thomasthachil
thomasthachil requested review from a team as code owners March 10, 2026 21:27
@github-actions

github-actions Bot commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Review complete

Summary

This PR appears to be a Changesets-generated version bump that:

  1. Adds a new chain (NEW_CHAIN = 100000) to sdk-core/src/chains.ts

  2. Bumps @uniswap/sdk-core from 7.12.1 to 7.13.0 (minor version for the new chain)

  3. Cascades patch version bumps to all dependent packages:

    • @uniswap/v2-sdk: 4.19.1 → 4.19.2
    • @uniswap/v3-sdk: 3.29.1 → 3.29.2
    • @uniswap/v4-sdk: 1.29.1 → 1.29.2
    • @uniswap/router-sdk: 2.7.1 → 2.7.2
    • @uniswap/universal-router-sdk: 4.33.0 → 4.33.1
    • @uniswap/smart-wallet-sdk: 2.5.0 → 2.5.1
    • @uniswap/uniswapx-sdk: 3.0.0 → 3.0.1
  4. Creates CHANGELOG.md files for all affected packages

Observations

The new chain isn't added to SUPPORTED_CHAINS

NEW_CHAIN is added to the ChainId enum but not to the SUPPORTED_CHAINS array. This may be intentional (perhaps it's a test chain that shouldn't be "supported" yet), but it's worth confirming. If it should be supported, the array needs updating.

Changelog description is vague

The sdk-core changelog says "adding new test chain" which suggests this is for testing purposes. If so, the setup looks fine—test chains typically shouldn't be in SUPPORTED_CHAINS.

Version cascade looks correct

The Changesets tooling correctly identified all downstream dependencies and bumped their patch versions appropriately. The CHANGELOG entries accurately reflect the dependency updates.


💡 Want a fresh review? Add a comment containing @request-claude-review to trigger a new review at any time.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Claude PR Metadata Generation

Status: ❌ Error
Job: View workflow run


⚠️ Generation Failed

The automated PR title and description generation encountered an error.

Next Steps:

  1. Check the workflow logs for details
  2. Verify the GitHub Actions configuration
  3. Ensure the Anthropic API key is valid

You can manually set the PR title and description, or re-trigger by pushing a new commit.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 Review verdict: APPROVE

👆 The main review comment above is the source of truth for this PR review. It is automatically updated on each review cycle, so always refer to it for the most current feedback.

This formal review submission is for the verdict only. 1 inline comment(s) are attached below.

MONAD = 143,
XLAYER = 196,
LINEA = 59144,
NEW_CHAIN = 100000,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This chain is added to ChainId but not to SUPPORTED_CHAINS. If this is intentional for testing purposes (as the changelog suggests), that's fine. Otherwise, it may need to be added to the array below.

@thomasthachil
thomasthachil force-pushed the feat/changesets-migration branch 2 times, most recently from d603553 to f987626 Compare March 11, 2026 17:48
Base automatically changed from feat/changesets-migration to main March 11, 2026 20: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.

1 participant