Re-land semantic versioning with review fixes - #487
Conversation
Re-applies the semantic versioning infrastructure from #471 (reverted in #479) with all feedback from the review addressed: - Fix pre-release floating tags: pre-releases (e.g., v1.0.0-alpha) no longer update vX/vX.Y floating tags or the latest Docker tag. Users pinned to @v0 now only receive stable releases. - Simplify push-to-main tagging: make the non-release case explicit with a clear comment instead of a fragile elif condition. - Remove unused PATCH variable from create-release.sh. - Add branch safety check: create-release.sh warns when run from a branch other than main and prompts for confirmation. - Consolidate BASH_REMATCH: the workflow now uses a single regex for both validation and capture, eliminating fragile two-regex flow. - Fix rollback example: RELEASING.md now uses realistic version numbers and explains the rollback target should be the actual last good release. - Sanitize git-describe output in release notes heredoc. - Add @main-vs-@v0 notes: docs explain to use @main until the first release creates the @v0 tag (addresses doc/implementation gap).
There was a problem hiding this comment.
No agent-mode design concerns.
This PR adds release infrastructure (versioning script, CI workflow for floating Docker tags, documentation) which doesn't involve agent prompts, workflows, or any of the patterns covered in the agent-mode design guidelines.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Review Summary
This PR re-lands the semantic versioning infrastructure from #471, addressing the 8 issues from the original review. Overall the implementation is sound and the claimed fixes are addressed. I found a couple of minor issues that should be fixed before merge.
Issues Requiring Changes
1. Inconsistent PREV_TAG Sanitization (Low Risk)
File: .github/scripts/create-release.sh (lines 210, 217)
The PR claims to fix "untrusted data in heredoc" by sanitizing PREV_TAG:
PREV_TAG_DISPLAY="${PREV_TAG//[^a-zA-Z0-9._-]/}"However, PREV_TAG_DISPLAY is only used in the HTML comment. The unsanitized PREV_TAG is still used in the git log command:
git log --oneline "$PREV_TAG"..HEAD | sed 's/^/- /'Since PREV_TAG comes from git describe, it's constrained to valid git ref names which can't contain shell metacharacters. The risk is minimal, but for consistency with the stated fix, either:
- Use
PREV_TAG_DISPLAYin the git log call too, or - Validate that PREV_TAG only contains safe characters before using it
Suggested fix:
git log --oneline "${PREV_TAG_DISPLAY}..HEAD" | sed 's/^/- /'Note: This would silently fail if PREV_TAG contained unusual but valid git characters (like / for hierarchical refs). Consider adding error handling if the git log fails.
Verified Fixes
The following issues from the #471 review are correctly addressed:
| Original Issue | Status | Notes |
|---|---|---|
| Fix #1 — Push-to-main tagging logic | ✅ Fixed | Replaced fragile elif with explicit else + no-op : |
| Fix #2 — Pre-release floating tags | ✅ Fixed | Both workflow and script now skip floating tags for pre-releases |
| Fix #3 — Unused PATCH variable | ✅ Fixed | PATCH removed from create-release.sh |
| Fix #4 — Documentation @v0 gap | ✅ Fixed | Added notes about using @main until first release |
| Fix #5 — Branch sanity check | ✅ Fixed | Script warns and prompts when not on main |
| Fix #6 — BASH_REMATCH consolidation | See observation below | |
| Fix #7 — Rollback example | ✅ Fixed | Uses realistic v0.x.y versions with explanatory note |
| Fix #8 — Untrusted data in heredoc | Display sanitized but git log uses original (see issue #1) |
Observation on Fix #6 (BASH_REMATCH)
The PR description claims "uses a single regex match for both validation and capture group extraction," but the workflow still has two separate regex checks in the workflow_dispatch path:
- Line 57:
$TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+(loose check for IS_RELEASE) - Line 66:
$TAG =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)(-[a-zA-Z0-9.]+)?$(validation + capture)
This is correct behavior since workflow_dispatch inputs might not be semver (e.g., "latest"). The first regex gates whether to treat it as a release. The logic works, but the PR description overstates the consolidation. Not blocking, just noting the discrepancy.
Quick Start Path Correction (Good Catch)
The Quick Start example changed from jwbron/egg@main to jwbron/egg/action@v0. This adds the /action path because action.yml lives in the action/ subdirectory, not the repo root. The original @main reference was incorrect. Good fix.
What Looks Good
- Pre-release handling is correct—
v1.0.0-alphaonly gets exact version tag, no floating tags orlatest - The semver validation regex properly handles all valid semver patterns including pre-release suffixes
- Dry-run mode works correctly and shows all operations that would be performed
- Documentation is comprehensive with clear version pinning guidance
- The workflow correctly splits version parsing and tag generation into separate steps for clarity
Recommendation
Request changes for issue #1 (PREV_TAG sanitization inconsistency). The fix is straightforward—use the sanitized variable in the git log call or validate before use.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Replace the partial sanitization approach (PREV_TAG_DISPLAY used only in comments) with upfront validation. Now PREV_TAG is validated against a whitelist of safe git ref characters before use. This ensures the same validated value is used in both the git log command and the output. The validation pattern allows alphanumeric, dots, underscores, hyphens, and forward slashes (for hierarchical refs like release/v1.0.0). Authored-by: egg
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
No agent-mode design concerns.
This PR adds release infrastructure (versioning script, CI workflow for floating Docker tags, documentation). It doesn't involve agent prompts, workflows, or any patterns covered in the agent-mode design guidelines.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Re-Review Summary
The issue from my previous review has been properly addressed.
Verified Fix: PREV_TAG Validation
Before: Partial sanitization—PREV_TAG_DISPLAY was created for the HTML comment while the unsanitized PREV_TAG was used in git log.
After: Upfront validation—PREV_TAG is validated against a whitelist before any use. The same validated value is used consistently in both the comment and the git log command.
The validation pattern ^[a-zA-Z0-9._/-]+$ correctly allows:
- Alphanumeric characters
- Dots, underscores, hyphens
- Forward slashes (for hierarchical refs like
release/v1.0.0)
The fail-safe behavior (clearing PREV_TAG and showing a warning) is appropriate—if git describe returns something unexpected, the script gracefully falls back to showing the first 10 commits.
Code Quality
The fix is minimal and targeted. The commit message clearly explains the rationale for validation over sanitization.
No blocking issues found.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
| egg is addressing review feedback... |
|
egg feedback addressed. View run logs 7 previous review(s) hidden. |
Re-land semantic versioning for releases
Re-applies the semantic versioning infrastructure from #471 (reverted
in #479) with all feedback from the review addressed.
Changes from original PR
Fix #1 — Push-to-main tagging logic: Replaced the fragile
elifcondition with an explicit
elsebranch and clear comment. Thenon-release path now has a no-op with documentation instead of relying
on an implicit string comparison.
Fix #2 — Pre-release floating tags (critical): Pre-releases like
v1.0.0-alphano longer updatevXorvX.Yfloating tags, and nolonger set the
latestDocker tag. This applies to both the workflow(
release-images.yml) and the release script (create-release.sh).Users pinned to
@v0will only receive stable releases.Fix #3 — Unused PATCH variable: Removed the
PATCHvariable thatwas extracted but never used in
create-release.sh.Fix #4 — Documentation @v0 gap: Added notes in README, action
README, and reusable-workflows guide explaining that
@mainshould beused until the first release creates the
@v0tag. Workflow examplesin the docs stay at
@mainsince that's what currently works.Fix #5 — Branch sanity check:
create-release.shnow warns andprompts for confirmation when run from a branch other than
main.Fix #6 — BASH_REMATCH consolidation: The workflow now uses a single
regex match for both validation and capture group extraction, instead
of two separate regex checks.
Fix #7 — Rollback example: Updated
RELEASING.mdto use realisticversion numbers and added a note explaining the rollback target should
be the actual last known-good release.
Fix #8 — Untrusted data in heredoc: Added sanitization of
PREV_TAGfromgit describebefore using it in release notes output.Issue: none (addresses review feedback on #471)
Test plan:
create-release.sh --dry-run v0.1.0to verify script outputcreate-release.sh --dry-run v0.1.0-rc.1to verify pre-release skips floating tagsAuthored-by: egg