Skip to content

fix(release): Tighten version constant regex#463

Merged
dazuma merged 2 commits intomainfrom
pr/version-constant
Mar 18, 2026
Merged

fix(release): Tighten version constant regex#463
dazuma merged 2 commits intomainfrom
pr/version-constant

Conversation

@dazuma
Copy link
Owner

@dazuma dazuma commented Mar 18, 2026

No description provided.

@dazuma dazuma requested a review from Copilot March 18, 2026 21:18
Copy link

Copilot AI left a 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 tightens the VersionRbFile parsing/updating regex so the release tooling targets the intended VERSION constant even when other constants like SPEC_VERSION are present in the file.

Changes:

  • Tighten regexes used by VersionRbFile#update_version and .current_version_from_content to avoid matching SPEC_VERSION.
  • Add new fixture version files containing both SPEC_VERSION and VERSION.
  • Add a regression test ensuring VERSION is read/updated correctly when SPEC_VERSION is present.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
toys-release/toys/.lib/toys/release/version_rb_file.rb Updates regexes used to find and replace the version constant.
toys-release/toys/.test/test_version_rb_file.rb Adds coverage for files that define both SPEC_VERSION and VERSION.
toys-release/toys/.test/.data/version5.rb New expected fixture content after updating VERSION in presence of SPEC_VERSION.
toys-release/toys/.test/.data/version6.rb New input fixture containing both SPEC_VERSION and VERSION.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dazuma dazuma force-pushed the pr/version-constant branch from 640e15e to 7f9b4b3 Compare March 18, 2026 21:26
@dazuma dazuma merged commit cc3942a into main Mar 18, 2026
15 checks passed
@dazuma dazuma deleted the pr/version-constant branch March 18, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants