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

feat(java): add LTS versioning scheme and releaser #810

Merged
merged 16 commits into from Mar 9, 2021

Conversation

chingor13
Copy link
Contributor

@chingor13 chingor13 commented Mar 4, 2021

Adds a custom versioning scheme for Java.

To support service pack/LTS releases, we use a separate versioning scheme. The first LTS release after a mainline release will bump 1 patch version and add the -lts.1 qualifier. Future LTS releases to that branch will bump the LTS number (e.g. the next version would be -lts.2.

This also converts the JavaBom releaser to use stable branch names.

Example PRs:
snapshot after branch created
LTS release PR

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Mar 4, 2021
@codecov
Copy link

codecov bot commented Mar 4, 2021

Codecov Report

Merging #810 (baa4c84) into master (7b32d85) will increase coverage by 0.27%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #810      +/-   ##
==========================================
+ Coverage   93.28%   93.56%   +0.27%     
==========================================
  Files          63       64       +1     
  Lines        8888     8870      -18     
  Branches      919      930      +11     
==========================================
+ Hits         8291     8299       +8     
+ Misses        594      568      -26     
  Partials        3        3              
Impacted Files Coverage Δ
src/releasers/index.ts 100.00% <100.00%> (ø)
src/releasers/java-bom.ts 100.00% <100.00%> (+7.05%) ⬆️
src/releasers/java-lts.ts 100.00% <100.00%> (ø)
src/releasers/java-yoshi.ts 90.47% <100.00%> (+3.49%) ⬆️
src/releasers/java/bump_type.ts 78.94% <100.00%> (ø)
src/releasers/java/version.ts 96.58% <100.00%> (+0.83%) ⬆️

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 7b32d85...baa4c84. Read the comment docs.

@chingor13 chingor13 marked this pull request as ready for review March 4, 2021 01:03
@chingor13 chingor13 requested a review from a team as a code owner March 4, 2021 01:03
@chingor13 chingor13 requested a review from bcoe March 4, 2021 22:31
Copy link
Contributor

@bcoe bcoe left a comment

Choose a reason for hiding this comment

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

I was picturing us making the version bumping configurable, I like the approach you've instead taken of introducing a new releaser -- seems like it's ultimately a bit less complex.

I think it might be worth us adding some guides, such as docs/java-releases.md to a docs folder, so that external users can learn about our best practices -- what releasers are good for what tasks.

Perhaps open an enhancement issue for this?

const currentVersions = VersionsManifest.parseVersions(
versionsManifestContent.parsedContent
);
export class JavaBom extends JavaYoshi {
Copy link
Contributor

Choose a reason for hiding this comment

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

awesome, I love that you can extend the JavaYoshi base class now.

protected async getVersionManifestContent(): Promise<GitHubFileContents> {
if (!this.versionsManifestContent) {
this.versionsManifestContent = await this.gh.getFileContents(
'versions.txt'
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe add a TODO to consolidate with @joeldodge79's manifest format eventually, if we can figure out an approach that works for both needs?

if (match[4] === '-SNAPSHOT') {
snapshot = true;
let lts = undefined;
if (match[4]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be tempted to use named regexes here, just so we have less magic numbers.

@@ -14,49 +14,57 @@

import {BumpType} from './bump_type';

const VERSION_REGEX = /(\d+)\.(\d+)\.(\d+)(-\w+)?(-SNAPSHOT)?/;
const VERSION_REGEX = /(\d+)\.(\d+)\.(\d+)(-.+)?/;
Copy link
Contributor

Choose a reason for hiding this comment

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

wondering if it's worth pulling these files into a utils/ subfolder, maybe it's not worth the extra nesting? i'm on the fence.

@chingor13 chingor13 merged commit 89e5bed into googleapis:master Mar 9, 2021
@chingor13 chingor13 deleted the java-lts branch March 9, 2021 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants