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

Release versioning helper script(s) #3110

Merged
merged 15 commits into from
Jun 24, 2019

Conversation

jimschubert
Copy link
Member

@jimschubert jimschubert commented Jun 6, 2019

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.
  • Filed the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

This is an attempt to make the release versioning scripts a little clearer. I've moved the scripts under ./bin/utils/release so they can live alongside related/supplemental scripts.

Rather than requiring release engineers to specify from/to target versions, I've made release_version_update.sh accept one of major, minor, build, or snapshot. This pulls the version from pom.xml. We could go one step further and if version ends in -SNAPSHOT then default to build and if not default to snapshot for the bump version type.

If this gets merged, we'd need to update the wiki as well.

Examples

build

image

minor

image

major

image

snapshot

image

Docs update

image

Options

release_version_update.sh

$ ./bin/utils/release/release_version_update.sh -h

USAGE: ./bin/utils/release/release_version_update.sh target

  This script will convert the current version in target files to the specified 'target'
  where target is one of:

  major
  minor
  build
  snapshot

EXAMPLES:

Update to new snapshot (1.0.0 -> 1.0.1-SNAPSHOT):
    ./bin/utils/release/release_version_update.sh snapshot
Update build version (1.0.0 -> 1.0.1)
    ./bin/utils/release/release_version_update.sh build
Update minor version (1.2.3 -> 1.3.0)
    ./bin/utils/release/release_version_update.sh minor
Update major version (1.2.3 -> 2.0.0)
    ./bin/utils/release/release_version_update.sh major

release_version_update_docs.sh

$ ./bin/utils/release/release_version_update_docs.sh -h

USAGE: ./bin/utils/release/release_version_update_docs.sh version target

  This script will convert the specified version in DOC target files to the 'target'
  where target is one of:

      major
      minor
      build

  or an explicitly defined version number.

NOTE:

  Files prepped by this script should never target SNAPSHOT, as the docs should refer to release artifacts.
  If intending to update to/from snapshots, please add target files to release_version_update.sh instead.

EXAMPLES:

Update build version (1.0.0 -> 1.0.1)
    ./bin/utils/release/release_version_update_docs.sh 1.0.0 build
Update minor version (1.2.3 -> 1.3.0)
    ./bin/utils/release/release_version_update_docs.sh 1.2.3 minor
Update major version (1.2.3 -> 2.0.0)
    ./bin/utils/release/release_version_update_docs.sh 1.2.3 major

@jimschubert
Copy link
Member Author

cc @OpenAPITools/generator-core-team

@jimschubert
Copy link
Member Author

I've updated bump.sh so it will display an error if a file's contents are unchanged.

See below, where 1.2.3 exists in the file but version 9.9.9 does not.

image

* master:
  [Java][okhttp-gson] Update dependencies (OpenAPITools#3103)
  Link query parameter to model object (OpenAPITools#2710)
  scala-play-server: fix enum names for reserved words (OpenAPITools#3080)
  Add @Sunn to openapi generator core team (OpenAPITools#3105)
  fix NPE in go generator (OpenAPITools#3104)
  scala-play-server: fix API doc url (OpenAPITools#3096)
  [maven-plugin] fix strictSpec parameter without alias (OpenAPITools#3095)
  Ruby: Avoid double escaping path items (OpenAPITools#3093)
  [Golang][client] Allow generating go client code as a submodule. (OpenAPITools#3012)
  [CI] Test maven plugin in Travis, move jobs from Shippable to Circle CI (OpenAPITools#3087)
  general support to add scopes for bearer auth too (OpenAPITools#1984)
  feat(java-jersey2): Making response headers case-insensitive (OpenAPITools#3072)
  [KOTLIN Spring] fix generation with modelNamePrefix/Suffix (OpenAPITools#3038)
  Mark nodejs-server as deprecated (OpenAPITools#3083)
  Use 4.0.2-SNAPSHOT version in gradle samples (OpenAPITools#3085)
@wing328
Copy link
Member

wing328 commented Jun 21, 2019

@jimschubert Please resolve the merge conflicts when you've time. We'll use it for the next release (4.0.3)

@jimschubert
Copy link
Member Author

jimschubert commented Jun 23, 2019

@wing328 this doesn't show me any merge conflicts. I do see a CircleCI failure which is unrelated.

What process did you follow to see merge conflicts? I'll follow the same and evaluate.

edit: nevermind, I see it now.

* master: (25 commits)
  Add #send to ruby reserved word list (OpenAPITools#3146)
  Merge java8 doc for spring (OpenAPITools#3122)
  added api key authentication to aspnetcore 2.1 (OpenAPITools#3089)
  Add "yue9944882" to Perl technical committee (OpenAPITools#3194)
  [csharp-netcore]: Adding http response details in api_docs and making example snippet compilable (OpenAPITools#3128)
  generate travis configuration (OpenAPITools#3193)
  Perl: Basic bearer auth support (OpenAPITools#3192)
  [R] feat(r) : Alternate PR for serialization fixes along with WithHttpInfo method enhancement (OpenAPITools#3099)
  improve release checkout script (OpenAPITools#3184)
  Prepare 4.0.3-SNAPSHOT  (OpenAPITools#3185)
  4.0.2 release (OpenAPITools#3181)
  Fix rubocop obsolescence (OpenAPITools#3175)
  Add Fuse to the company list (OpenAPITools#3164)
  Idiomatic Rust returns for Error conversions (OpenAPITools#2812)
  Add API timeout handling (OpenAPITools#3078)
  Import inner items for map (OpenAPITools#3123)
  update core team in pom.xml (OpenAPITools#3126)
  [gradle] Document consuming via gradle plugin portal (OpenAPITools#3125)
  Bump up babel-cli version to fix security alert (OpenAPITools#3121)
  [C++] [cpprestsdk] Add examples and test for cpprestsdk (OpenAPITools#3109)
  ...
@jimschubert
Copy link
Member Author

@wing328 I've merged master. I'll try to check back in a bit and see if the verification suite has passed before merging.

Here are the recommended updates to https://github.com/OpenAPITools/openapi-generator/wiki/Release-Checklist, for "File a PR" step in the "before release" section:


  • File a PR: (e.g. #280, #588)
    • Set the correct version by executing bin/utils/release/release_version_update.sh with the target version increment (major, minor, build, or snapshot). Example:
      bin/utils/release/release_version_update.sh build
    • mention the coming release in the docs. bin/utils/release/release_version_update_docs.sh accepts a version and the increment. Example:
      bin/utils/release/release_version_update_docs.sh 3.0.2 build`
      See commit 9056c1e5e3)
    • Verify or modify the updated values accordingly
      • update root README.md: (e.g. 167b2f5, 1029b69)
        • Update the release table
        • mention the last released version in Section "1.3 - Download JAR"
      • update OpenAPI Generator Maven Plugin README (modules/openapi-generator-maven-plugin/README.md): mention the last release version in the xml snippet <version>..</version> (e.g. 9c79297)
      • update version in the Maven Examples (modules/openapi-generator-maven-plugin/examples/java-client.xml,
        modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml, modules/openapi-generator-maven-plugin/examples/non-java.xml and modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml)
      • update OpenAPI Generator Gradle Plugin README (modules/openapi-generator-gradle-plugin/README.adoc): mention the last release version in the dependencies section.
      • update the Gradle Example Plugin README (modules/openapi-generator-gradle-plugin/samples/local-spec/README.md): update -PopenApiGeneratorVersion in the bash snippet

And the snapshot preparation in the "After Release" section:

  • update versions to next SNAPSHOT version (e.g. #285). Script bin/utils/release/release_version_update.sh snapshot can be used. Be careful this script may create changes that need to be reverted. Verify the output after running.

* master:
  Ruby-client: Don't encode slashes if strict-spec false (OpenAPITools#3204)
  [openapi-yaml] Config option outputFile was ignored by the generator. (OpenAPITools#3199)
  Add missing javax dependencies for Java > 8 (OpenAPITools#3188)
  update kotlin samples
  Minor fix to presentation link
  Add Flow import to kotlin spring reactive (OpenAPITools#3107)
  Ktor Fix KtorExperimentalAPI import (OpenAPITools#3108)
  Add a link to the speaker deck at Kubernetes Contributor Summit (OpenAPITools#3205)
  [csharp] Adding http response details on api_docs and making example snippet compilable (OpenAPITools#3129)
  [java][jesery2]: "InjectionManagerFactory not found" issue (OpenAPITools#3153)
@jimschubert jimschubert merged commit 6b428d6 into OpenAPITools:master Jun 24, 2019
@jimschubert jimschubert deleted the release-versioning-helper branch June 24, 2019 22:22
@wing328
Copy link
Member

wing328 commented Jun 26, 2019

I think this broke the release table in the readme.

<!-- RELEASE_VERSION -->[4.0.2](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.0.2) (latest stable release) | 20.06.2019 | Patch release (bug fixes, minor enhancements, etc)<!-- /RELEASE_VERSION -->

Filed #3221 to fix it

@wing328 wing328 added this to the 4.1.0 milestone Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants