-
Notifications
You must be signed in to change notification settings - Fork 218
[HOLD]chore: update changeset-snapshot-publish script to accept a parameter… #5366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Branch previewReview the following VRT differencesWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
If the changes are expected, update the |
Tachometer resultsCurrently, no packages are changed by this PR... |
@@ -22,7 +22,7 @@ | |||
"build:ts:watch": "wireit", | |||
"build:types": "wireit", | |||
"build:watch": "wireit", | |||
"changeset-snapshot-publish": "yarn prepublishOnly && yarn changeset version --snapshot && yarn lint:versions --fix && yarn update-version && yarn changeset publish --no-git-tag --tag snapshot", | |||
"changeset-snapshot-publish": "yarn prepublishOnly && yarn changeset version --snapshot ${1} && yarn lint:versions --fix && yarn update-version && yarn changeset publish --no-git-tag --tag snapshot", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as a heads up, this kind of positional parameter does not translate well across operating systems. The most cross-system way to pass variables to commands is via a node script using yargs to read in from the command line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate your feedback about cross-platform parameter handling. You raise a valid point about positional parameters potentially causing issues across different operating systems.
While I agree that a Node script with yargs would be the most robust cross-platform solution, I believe this approach should work well for our current needs because:
- Modern shells on macOS, Linux, and Windows (with appropriate tools) do support this type of parameter substitution
- The Yarn/npm CLI handles these parameters consistently across platforms
- This is specifically for snapshot releases, which we'll primarily be using for testing purposes
- The implementation keeps all our command logic centralized in package.json
The approach is straightforward and avoids the overhead of creating and maintaining separate script files
Since this is just for snapshot/test releases rather than production deployments, the simplicity of this approach seems appropriate for our needs. If we encounter any compatibility issues, I'll certainly reconsider implementing a proper Node script solution. Thank you for the helpful suggestion!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That all makes great sense! Thanks for outlining some of the background you did to validate this. This is only meant to be run in CI, is that correct? If we have anyone on a unique set-up, can we ask them to validate this locally if there's a chance it might need to be run manually?
…ta version number
…sion for button component
@blunteshwar does this conflict with rubens PR? as in does his PR need to go in first or does this PR? Trying to understand merge order |
This is an alternative to ruben's pull request he's trying to achieve the same using snapshot releases, which is meant for testing purpose release and will not generate exact beta versions which we were generating earlier. |
…ersion instead of button
. |
- name: Get current package version and latest beta number | ||
id: version-info | ||
run: | | ||
# Fetch the latest beta version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @blunteshwar, I love that you're interested in tackling this workflow for us. I think it'll be a big improvement on how we can communicate some of these not-yet-ready for production releases to our consumers.
I wanted to mention a few things here that could help frame your work.
- Changesets has workflows for both pre-releases (alphas, betas, release candidates) as well as snapshots (timestamped one-off releases, "canary" or "nightly" releases). It looks like you might be combining both of those concepts here, but perhaps you intended to only focus on "snapshot" releases.
- Based on the docs links in the first point, depending on which type you choose, you might not need to perform the steps here to reason about the current and next version numbers. Especially if you decide that you want to use the snapshot workflow because it's all based on a timestamp which will always be incrementally created.
- If you want a pre-release instead of a snapshot, I'm pretty sure we can still lean on Changesets to handle the incremental numbering, but we can have a conversation about that if necessary. It's slightly more involved, but the preferred "Changesets way" of doing this involves branching.
- Finally, it is possible to get a little creative with GitHub Actions and Changesets by doing something similar to what we've done in Spectrum CSS or what Garth has done in Spectrum Tokens. This approach allows authorized repo contributors to publish snapshots via the GitHub Actions "run workflow" UI, without any CI or CLI needed.
Lots of possibilities with this tool! Please reach out to me, Cassondra, or Garth if you'd like to talk through this a bit more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
… for versioning
Description
Enhanced Changeset Publishing for Snapshots and Beta Releases
Changes
Updated changeset-snapshot-publish script to accept a parameter for snapshot identification
Enhanced beta release workflow to dynamically determine the next beta version
Updated version management in the release pipeline
Purpose
These changes improve our release automation by:
Allowing custom snapshot identifiers when publishing test/development versions
Automating the beta versioning process to consistently increment beta numbers
Centralizing version management in package.json without requiring external scripts
Implementation
Added parameter support to the snapshot publish command using shell parameter substitution
Implemented dynamic beta number determination based on previously published versions
Maintained backward compatibility with existing workflows
This update primarily affects snapshot releases used for testing purposes, providing a more flexible and maintainable approach to our release pipeline.
Related issue(s)
Motivation and context
How has this been tested?
Test case 1
Test case 2
Did it pass in Desktop?
Did it pass in Mobile?
Did it pass in iPad?
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.