Closed
Description
Summary
The release process for Powertools Java is mostly manual as of today. We do have some github actions to help (release-drafter for the release note, release-prep to upgrade versions) but they are not used and not complete.
To improve our MTTR, ease our release process and avoid any manual (human) error, we need to make it as automated as possible.
Why is this needed?
Manual releases are:
- source of error (deploying a wrong version to maven central),
- slow ("what's the next step?"),
- infrequent ("too long, will do it another day")
And this is a vicious circle. slow/infrequent releases increase the risk of errors.
Which area does this relate to?
Automation, Governance
Solution
Leverage knowledge and existing process for Python version, especially see:
- A running release: https://github.com/aws-powertools/powertools-lambda-python/actions/runs/5288817403
- github worklow: https://github.com/aws-powertools/powertools-lambda-python/blob/develop/.github/workflows/release.yml
Also get inspiration on release-maven-plugin.
More precisely:
Inputs:
- the release version (ex:
1.16.0
) - the next snapshot version (ex:
1.17.0-SNAPSHOT
)
Steps:
- checkout code
- Update maven pom files with the new version. Note sure using
jacobtomlinson/gha-find-replace
action is a good idea, because if we have a version similar to a dependency, it will also update it. Prefer using theversions-maven-plugin
:
mvn versions:set -DnewVersion=x.y.z
- Create a hash of the code, to make sure code is not tampered when releasing
- Build / verify (unit + e2e tests + quality checks)
mvn -Pbuild-with-spotbugs clean verify -Dspotbugs.failOnError=true && mvn -Pe2e -B verify --file powertools-e2e-tests/pom.xml
- Commit and create a tag on git (❓can we do that on
main
branch. Otherwise we need to do a PR, but then the release process stops as we need to validate the PR. In python they release to Pypi before doing the tag/PR which is weird IMHO, release plugin is tagging before deploying... which is what we want/should do):
git commit -am "chore: version bump ${RELEASE_VERSION}"
git tag -a v"${RELEASE_VERSION}" -m "release_version: v${RELEASE_VERSION}"
- Checkout the tag
- Verify the hash: if someone committed in between, there will be a difference and release will stop
- Build & Release to maven central (use GitHub environments)
mvn clean deploy -Pbuild-without-spotbugs
- Close issues related to the release (see python script)
- Update CHANGELOG/releases (can we / do we want to automate this ❓), not sure with the dependabot PRs. We have the draft available, we need to have a human cleaning this.
- Update maven pom files and everything with the next snapshot version (see step 2):
mvn versions:set -DnewVersion=x.y.z-SNAPSHOT
- Commit/push (same question as step 5, we may not be able to push to main directly)
Acknowledgment
- This request meets Powertools for AWS Lambda (Java) Tenets
- Should this be considered in other Powertools for AWS Lambda (Java) languages? i.e. Python, TypeScript
Metadata
Metadata
Assignees
Type
Projects
Status
Working on it