Should `version` command have `--since` flag?
See original GitHub issueAffected Packages
version/cli?
Problem
As part of the work we do at The Guild in our repos, we are using snapshot
releases for releasing canary versions for PRs.
To do that, we are using version --snapshot alpha
and then publish --tag alpha
. This works perfectly fine.
When Changesets begin to stack in the target/main branch (master/main), we are seeing a kinda annoying behavior in PRs. The version
command includes changesets files that are coming from master
, instead of using only the changes relevant to the specific PR.
This causes inconsistent results with our custom GitHub Action (that runs version
as described above). We can see that the Changesets bot detects only the relevant packages:
While our bot/action (that gets the output of version+publish) has published more packages (because we are those changesets in master):
Proposed solution
Similar to status
command, we can provide --since
flag to version
flag, and point to the target branch in a PR. This way, the version
command will make sure to include only changesets
files that were added in that specific PR (similar to what changesets-bot is doing in the PR comments)
@Andarist @mitchellhamilton @jakubmazanec what do you think? I can open a PR if that makes sense.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Yes. I just mean that we can’t only release stuff from the changesets specific to a PR because those might always implicitly pull dependants into the release and that we should have tests etc verifying that this actually happens. Those dependant packages could have more changesets for them (ones unrelated to the PR in question) or they could have no changesets at all - in both scenarios they should be released though.
Actually, even dependencies should be pulled into the release too - but those could be filtered by having some changesets or not.
We’d have to ensure to still version all dependant packages of all the packages with changesets included in the given PR. Otherwise, you wouldn’t be quite able to test those with the newly released snapshot dependencies.