Skip to content

fix: define a two-phase release process#1163

Merged
mdelapenya merged 10 commits intotestcontainers:mainfrom
mdelapenya:fix-release-docs
May 10, 2023
Merged

fix: define a two-phase release process#1163
mdelapenya merged 10 commits intotestcontainers:mainfrom
mdelapenya:fix-release-docs

Conversation

@mdelapenya
Copy link
Copy Markdown
Member

  • chore: improve dry_run log when hitting the Golang proxy
  • chore: bump tc-go version in mkdocs
  • docs: verify that the origin remote is set
  • fix: define a two-phase release process

What does this PR do?

This PR resolves the inconsistencies in the current release script, defining two separate phases for the release: pre-release and release.

The pre-release phase includes the modification of the files, based on the state of the version value in the version.go file. This version contains the next development version, and it's the value used to perform a release.
Therefore, that value drives the release process to set it as the version for all downstream modules and examples.

This pre-release phase will modify the files without creating a commit, so that an eventual release engineer is able to check that the git state is correct.

Once the modified files are correct, we can safely trigger the second phase with the release.sh script. This script does:

  • commits the modified files.
  • creates the git tags for the new release, in the core module and examples and modules.
  • calculates the next development version (default a minor bump).
  • modifies the version.go file with the next version, creating a commit for that.
  • pushes the main branch and all tags to the remote origin repository.
  • triggers the Golang proxy to fetch all modules in the project, based on the git tags.

As a consequence of these changes in the release scripts, the RELEASE.md has been updated.

Why is it important?

We do not want to mess the state of a release. A wrong git tag in the repo and an eventual fetch of the Golang proxy will cache the tag forever, causing disastrous consequences to our users, as that cached version will be there forever. This happened with the v0.20.0 release, were the script failed in the middle but created an inconsistent state of the git tags, so I manually performed a release deleting the upstream tags.

How to test this PR

To perform a release in DRY_RUN mode:

  1. change the version.go to a version of your interest: e.g. 1.0.0
  2. run DRY_RUN=false ./scripts/pre-release.sh
  • the files will be modified, so all modules should contain the v1.0.0 version in their go.mod files.
  1. run DRY_RUN=true ./scripts/release.sh
  • a log output will show up with all the operations that are described in the release document, withouht changing the state of both the local and remote git repository.

@mdelapenya mdelapenya requested a review from a team as a code owner May 10, 2023 06:27
@mdelapenya mdelapenya added documentation Docs, docs, docs. chore Changes that do not impact the existing functionality labels May 10, 2023
@mdelapenya mdelapenya self-assigned this May 10, 2023
@mdelapenya mdelapenya requested a review from kiview May 10, 2023 06:27
@netlify
Copy link
Copy Markdown

netlify bot commented May 10, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 3c263ab
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/645b7748c2f5170007d286df
😎 Deploy Preview https://deploy-preview-1163--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

HofmeisterAn
HofmeisterAn previously approved these changes May 10, 2023
Co-authored-by: Andre Hofmeister <[email protected]>
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@mdelapenya mdelapenya merged commit 38b35a3 into testcontainers:main May 10, 2023
@mdelapenya mdelapenya deleted the fix-release-docs branch May 10, 2023 11:12
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request May 11, 2023
* main:
  docs: enrich docs for modules (testcontainers#1167)
  chore: prepare for next minor development cycle (0.21.0)
  chore: use new version (v0.20.1) in modules and examples
  Revert "fix: don't panic when logs waits for more than 5 seconds (testcontainers#947)" (testcontainers#1164)
  fix: define a two-phase release process (testcontainers#1163)
  ci(lint): enable misspell and gci linters (testcontainers#1162)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Changes that do not impact the existing functionality documentation Docs, docs, docs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants