Skip to content
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

Get correct next version when using onlyGraduateWithReleaseLabel #2229

Merged
merged 1 commit into from Jul 15, 2022

Conversation

adierkens
Copy link
Collaborator

@adierkens adierkens commented Jul 15, 2022

When using the onlyGraduateWithReleaseLabel for shipit the next prerelease version was being calculated as the latest tag not present in the main branch. This is problematic when the prerelease and main branch are the same (as is the case for onlyGraduateWithReleaseLabel)

This would cause auto to always create the -next.0 tag for a release (since it's based off of the latest release in the repo), and publishing would fail due to conflicting versions being published.

This change update the calculation in the version-file plugin to use getLatestTagInBranch() when the current and main branch are the same.

A similar change (or broken out into a standalone util) may be needed for other versioning plugins

🐤 Download canary assets:

auto-linux--canary.2229.26380.gz
auto-macos--canary.2229.26380.gz
auto-win.exe--canary.2229.26380.gz

📦 Published PR as canary version: under canary scope @auto-canary@10.37.2--canary.2229.26380.0

✨ Test out this PR locally via:

npm install @auto-canary/bot-list@10.37.2--canary.2229.26380.0
npm install @auto-canary/auto@10.37.2--canary.2229.26380.0
npm install @auto-canary/core@10.37.2--canary.2229.26380.0
npm install @auto-canary/package-json-utils@10.37.2--canary.2229.26380.0
npm install @auto-canary/all-contributors@10.37.2--canary.2229.26380.0
npm install @auto-canary/brew@10.37.2--canary.2229.26380.0
npm install @auto-canary/chrome@10.37.2--canary.2229.26380.0
npm install @auto-canary/cocoapods@10.37.2--canary.2229.26380.0
npm install @auto-canary/conventional-commits@10.37.2--canary.2229.26380.0
npm install @auto-canary/crates@10.37.2--canary.2229.26380.0
npm install @auto-canary/docker@10.37.2--canary.2229.26380.0
npm install @auto-canary/exec@10.37.2--canary.2229.26380.0
npm install @auto-canary/first-time-contributor@10.37.2--canary.2229.26380.0
npm install @auto-canary/gem@10.37.2--canary.2229.26380.0
npm install @auto-canary/gh-pages@10.37.2--canary.2229.26380.0
npm install @auto-canary/git-tag@10.37.2--canary.2229.26380.0
npm install @auto-canary/gradle@10.37.2--canary.2229.26380.0
npm install @auto-canary/jira@10.37.2--canary.2229.26380.0
npm install @auto-canary/magic-zero@10.37.2--canary.2229.26380.0
npm install @auto-canary/maven@10.37.2--canary.2229.26380.0
npm install @auto-canary/microsoft-teams@10.37.2--canary.2229.26380.0
npm install @auto-canary/npm@10.37.2--canary.2229.26380.0
npm install @auto-canary/omit-commits@10.37.2--canary.2229.26380.0
npm install @auto-canary/omit-release-notes@10.37.2--canary.2229.26380.0
npm install @auto-canary/pr-body-labels@10.37.2--canary.2229.26380.0
npm install @auto-canary/released@10.37.2--canary.2229.26380.0
npm install @auto-canary/s3@10.37.2--canary.2229.26380.0
npm install @auto-canary/sbt@10.37.2--canary.2229.26380.0
npm install @auto-canary/slack@10.37.2--canary.2229.26380.0
npm install @auto-canary/twitter@10.37.2--canary.2229.26380.0
npm install @auto-canary/upload-assets@10.37.2--canary.2229.26380.0
npm install @auto-canary/version-file@10.37.2--canary.2229.26380.0
npm install @auto-canary/vscode@10.37.2--canary.2229.26380.0
# or 
yarn add @auto-canary/bot-list@10.37.2--canary.2229.26380.0
yarn add @auto-canary/auto@10.37.2--canary.2229.26380.0
yarn add @auto-canary/core@10.37.2--canary.2229.26380.0
yarn add @auto-canary/package-json-utils@10.37.2--canary.2229.26380.0
yarn add @auto-canary/all-contributors@10.37.2--canary.2229.26380.0
yarn add @auto-canary/brew@10.37.2--canary.2229.26380.0
yarn add @auto-canary/chrome@10.37.2--canary.2229.26380.0
yarn add @auto-canary/cocoapods@10.37.2--canary.2229.26380.0
yarn add @auto-canary/conventional-commits@10.37.2--canary.2229.26380.0
yarn add @auto-canary/crates@10.37.2--canary.2229.26380.0
yarn add @auto-canary/docker@10.37.2--canary.2229.26380.0
yarn add @auto-canary/exec@10.37.2--canary.2229.26380.0
yarn add @auto-canary/first-time-contributor@10.37.2--canary.2229.26380.0
yarn add @auto-canary/gem@10.37.2--canary.2229.26380.0
yarn add @auto-canary/gh-pages@10.37.2--canary.2229.26380.0
yarn add @auto-canary/git-tag@10.37.2--canary.2229.26380.0
yarn add @auto-canary/gradle@10.37.2--canary.2229.26380.0
yarn add @auto-canary/jira@10.37.2--canary.2229.26380.0
yarn add @auto-canary/magic-zero@10.37.2--canary.2229.26380.0
yarn add @auto-canary/maven@10.37.2--canary.2229.26380.0
yarn add @auto-canary/microsoft-teams@10.37.2--canary.2229.26380.0
yarn add @auto-canary/npm@10.37.2--canary.2229.26380.0
yarn add @auto-canary/omit-commits@10.37.2--canary.2229.26380.0
yarn add @auto-canary/omit-release-notes@10.37.2--canary.2229.26380.0
yarn add @auto-canary/pr-body-labels@10.37.2--canary.2229.26380.0
yarn add @auto-canary/released@10.37.2--canary.2229.26380.0
yarn add @auto-canary/s3@10.37.2--canary.2229.26380.0
yarn add @auto-canary/sbt@10.37.2--canary.2229.26380.0
yarn add @auto-canary/slack@10.37.2--canary.2229.26380.0
yarn add @auto-canary/twitter@10.37.2--canary.2229.26380.0
yarn add @auto-canary/upload-assets@10.37.2--canary.2229.26380.0
yarn add @auto-canary/version-file@10.37.2--canary.2229.26380.0
yarn add @auto-canary/vscode@10.37.2--canary.2229.26380.0

@adierkens adierkens added the patch Increment the patch version when merged label Jul 15, 2022
@codecov
Copy link

codecov bot commented Jul 15, 2022

Codecov Report

Merging #2229 (72d7460) into main (a15f77b) will decrease coverage by 0.02%.
The diff coverage is 40.00%.

@@            Coverage Diff             @@
##             main    #2229      +/-   ##
==========================================
- Coverage   80.44%   80.42%   -0.03%     
==========================================
  Files          67       67              
  Lines        5519     5523       +4     
  Branches     1292     1294       +2     
==========================================
+ Hits         4440     4442       +2     
- Misses        711      712       +1     
- Partials      368      369       +1     
Impacted Files Coverage Δ
plugins/version-file/src/index.ts 86.90% <40.00%> (-1.85%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a15f77b...72d7460. Read the comment docs.

@adierkens adierkens merged commit b99c0e2 into main Jul 15, 2022
@adierkens adierkens deleted the next-with-onlyGraduateWithReleaseLabel branch July 15, 2022 21:02
@intuit-svc
Copy link

🚀 PR was released in v10.37.2 🚀

@intuit-svc intuit-svc added the released This issue/pull request has been released. label Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants