Fix DEPRECATION_HORIZON sed pattern in script/release - #2704
Closed
joelhawksley wants to merge 1 commit into
Closed
Conversation
The value in lib/view_component/deprecation.rb is a quoted string
('DEPRECATION_HORIZON = "4.0.0"'), but the sed pattern was:
s/DEPRECATION_HORIZON = [0-9]+/DEPRECATION_HORIZON = $((major + 1))/g
'[0-9]+' requires at least one digit immediately after the '= ', but
the next character is the opening quote. So the substitution matched
nothing and silently no-oped on every 3.x release — the deprecation
horizon has never been bumped as a result.
Match the full quoted 'X.Y.Z' and replace with '"<major+1>.0.0"'.
Verified locally on macOS (BSD sed): a starting value of "5.0.0"
with major=3 becomes "4.0.0", and ruby -c reports Syntax OK on the
result.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 217f0a0d-a9f2-4607-9643-5fcb3e34f20f
Member
Author
|
Superseded by the port PR (opening next), which includes this fix along with the full release-workflow port. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of the DEPRECATION_HORIZON sed fix from main (companion to #2691 on main).
Root cause
lib/view_component/deprecation.rbstores the value as a quoted string:But
script/release's sed was:[0-9]+requires ≥1 digit immediately after=, but the next character is the opening quote. So the substitution matched nothing and silently no-oped on every 3.x release — the horizon has never actually been bumped by the script.Fix
Match the full quoted
X.Y.Zand replace with"<major+1>.0.0", mirroring the fix I made on main.Applicability of other main-branch release fixes
For reference, most of the recent main-branch release fixes do not apply to 3.x:
release.yml,publish-release.yml, orpush_gem.ymlworkflows — releases are done locally.script/releaseon 3.x is interactive-only (no CI-args branch) and doesn't callbuild_docs.script/publishon 3.x is justbundle exec rake release+ gh-pages push — nogh release create, nocheck_github_permissions.Only this sed bug is relevant. Verified locally on macOS with BSD sed: starting value
"5.0.0"+ major=3 →"4.0.0";ruby -creportsSyntax OK.