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

fix: define a two-phase release process #1163

Merged
merged 10 commits into from May 10, 2023

Conversation

mdelapenya
Copy link
Collaborator

  • 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

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.

scripts/pre-release.sh Outdated Show resolved Hide resolved
HofmeisterAn
HofmeisterAn previously approved these changes May 10, 2023
RELEASING.md Outdated Show resolved Hide resolved
RELEASING.md Outdated Show resolved Hide resolved
RELEASING.md Outdated Show resolved Hide resolved
RELEASING.md Outdated Show resolved Hide resolved
Co-authored-by: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com>
@sonarcloud
Copy link

sonarcloud bot commented May 10, 2023

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
56 checks passed
@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.

None yet

2 participants