-
Notifications
You must be signed in to change notification settings - Fork 205
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
[Q or Feature Request] Need to bump version separately from shipit
- currently get double bump
#2399
Comments
I think this is more or less the same ask as in #1965 |
Thanks @laughedelic, it looks like It is a similar issue in that I don't want to replicate logic to call |
I'm definitely open to the arg being added to shipit. Makes sense to me. That logic might break down for indepenently versioned monorepos but a lot of other stuff does too. Happy to accept a PR here. |
|
It looks like (from {
name: "shipit",
group: "Release Commands",
description: endent`
Context aware publishing.
1. call from base branch -> latest version released (LATEST)
2. call from prerelease branch -> prerelease version released (NEXT)
3. call from PR in CI -> canary version released (CANARY)
4. call locally when not on base/prerelease branch -> canary version released (CANARY)
`,
examples: ["{green $} auto shipit"],
options: [
...latestCommandArgs,
{
...useVersion,
description: `${useVersion.description} Currently only supported for the **npm plugin**.`,
}, Implement
|
One of many:
Why not resolve this once as Answer: it appears |
Ok, so while this is not documented for It appears that I can get satisfactory results as-is (npm plugin) with:
I'll try this path and see how it goes. |
So I did get this to work with the existing code, though it is a bit of a workaround. Here is how it worked: First, get the shipit version and bump it with lerna: # start release here so that builds uses the correct version
- run: yarn autoBumpVersion --verbose
- run: ./node_modules/.bin/appVersion --verbose
- run: yarn auto info NOTE: NOTE 2: Second, do my intermediate things like build apps/tag images, etc. Third, manipulate some conditions and shipit: - run:
name: shipit
# 1. Capture the bumped version
# 2. Stash the lerna.json to allow shipit to modify/commit it (so that git commit inside shipit succeeds without erroring on zero changes)
# 3. Commit the rest of the previously bumped changes
# 4. Shipit
command: |
export USE_VERSION=`./node_modules/.bin/appVersion`
git stash push lerna.json
yarn autoCommitDiff --verbose
yarn auto shipit --use-version $USE_VERSION NOTE: So, the only oddity here is that I have to specifically stash a file (any file that will get modified) so that shipit's execution of So, this issue could be closed, I'm satisfied enough to move on, or it could be left open knowing that it could be perhaps better specified/documented. It's up to the maintainers to decide. |
@rosskevin if there is anywhere you think we could improve the docs here I'm happy to accept a PR |
Is your feature request related to a problem? Please describe.
It is a problem for me, perhaps I am missing something or perhaps this is a feature request.
I have been integrating
auto
into multiple libraries, both simple and monorepos and it has worked well with only minor setup. Now I'm trying to bringauto
to a full stack CI process, and I am seeing a limitation.In our full stack application monorepo, we build multiple images, integration test, release sourcemaps to sentry, etc in our CI process to determine if a release candidate is certified to be
released
. The version value is statically built into the docker images/codebase for traceability e.g.APP_VERSION: 3.1.0
. Therefore, we must bump the version prior tobuild
andshipit
.We perform the upfront bump with KIND=
auto version
and the result fed intolerna version $KIND
so thatauto
's logic controls the semver bump. But, whenshipit
runs, it bumps again, resulting in a double bump. So what should be3.0.18->3.1.0
ends up being3.0.18->3.2.0
.Describe the solution you'd like
shipit --skip-version-bump
We want to run the typical shipit, but simply with a flag to omit the bump version process.
Describe alternatives you've considered
We must have the deterministic version statically upfront, so I'm not sure we have other options other than to revert to our homegrown release management.
Additional context
It may be important to know that in this use case,
auto version
up front is limited in value (versus shipit) and returns major/minor/patch etc, but if you want to release this code as a canary/next,auto version
is insufficient in this two-phase scenario. That's not necessarily a problem in our case, because it is simply a go/no-go deployment to a production stack. BUT, if someone wants to use this two-phase system, they may want a full version resolution upfront e.g. instead ofminor
they may want3.1.0-canary-tnoed283
. This may mean that another command would be useful such asauto version --fully-resolved
I hope I'm simply missing a flag and that a two-part/separate bump+ship process is achievable as-is.
The text was updated successfully, but these errors were encountered: