From 5c172dc0d97fd4b983f14618bc71a7014027c3aa Mon Sep 17 00:00:00 2001 From: Joel Hawksley Date: Mon, 24 Aug 2026 14:47:47 -0600 Subject: [PATCH] Fix DEPRECATION_HORIZON sed pattern in script/release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 '".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 --- script/release | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/script/release b/script/release index cbbf7d7aa..dd7d5bef7 100755 --- a/script/release +++ b/script/release @@ -47,10 +47,13 @@ update_ruby_version() { -e "s/PATCH = [0-9]+/PATCH = $3/g" \ lib/view_component/version.rb - # Update deprecation horizon version + # Update deprecation horizon version. deprecation.rb stores the value + # as a quoted string (e.g. "4.0.0"), so match/replace the full quoted + # X.Y.Z — the previous [0-9]+ pattern matched no digits before the + # opening quote and silently no-oped on every release. major=$1 sed -E -i '' \ - -e "s/DEPRECATION_HORIZON = [0-9]+/DEPRECATION_HORIZON = $((major + 1))/g" \ + -e "s/DEPRECATION_HORIZON = \"[0-9]+\.[0-9]+\.[0-9]+\"/DEPRECATION_HORIZON = \"$((major + 1)).0.0\"/g" \ lib/view_component/deprecation.rb }