-
Notifications
You must be signed in to change notification settings - Fork 4
Automate example version updates in release workflow #454
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
Conversation
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
…tion Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
…ase) Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
|
@copilot can release:prepare be given additional tasks to perform? |
Yes,
To integrate it into
The current workflow approach is cleaner for this scenario. |
|
@copilot is it possible to have a simple test for the script? It shouldn't need to be part of the java test suite |
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Added a standalone test script at
Run with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR automates version number updates in documentation examples during the Maven release process. The automation aims to ensure that code examples in README.md always reflect the current release version, eliminating manual update errors. However, there is a critical issue with the git commit amendment logic that needs to be addressed before merging.
Key Changes:
- Adds a bash script to extract version from pom.xml and update dependency examples in README.md
- Integrates the script into the manual release workflow between
release:prepareandrelease:perform - Provides comprehensive bash-based tests for the update script
- Documents the automation in RELEASING.md and adds script documentation
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
.github/scripts/update-example-versions.sh |
Main automation script that extracts version from pom.xml and updates <version> tags within <dependency> blocks in README.md |
.github/scripts/test-update-example-versions.sh |
Standalone bash test suite with 6 tests validating version extraction, pattern matching, and error handling |
.github/workflows/manual-release.yml |
Integrates the version update script after release:prepare with git commit amendment to include documentation updates |
RELEASING.md |
Documents the automated version update process, workflow changes, and verification steps |
.github/scripts/README.md |
Provides usage documentation and test instructions for the automation scripts |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|



Description
Manual version updates in documentation examples are error-prone and frequently forgotten. This PR automates version number updates during the release process.
Changes
Script (
.github/scripts/update-example-versions.sh):pom.xml(skipping parent pom) if no argument provided<version>tags within<dependency>blocks in README.mdTest Script (
.github/scripts/test-update-example-versions.sh):bash .github/scripts/test-update-example-versions.shWorkflow (
.github/workflows/manual-release.yml):release:prepareruns the update script with explicit version argumentDocumentation (
RELEASING.mdand.github/scripts/README.md):Behavior
During release, the script transforms:
To:
Workflow Sequence
After Maven's
release:preparecreates two commits:The automation creates:
3. Commit C (documentation): README.md → version 1.2.0
The release tag (v1.2.0) points to Commit A. The main branch ends at Commit C with updated documentation.
Critical Fix: The script receives version 1.2.0 as an explicit argument, avoiding the issue where reading from pom.xml after
release:preparewould get 1.2.1-SNAPSHOT and incorrectly use 1.2.1 (the next release) instead of 1.2.0 (the current release).Testing
The test script validates:
All 7 tests pass successfully.
Checklist:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.