Skip to content

fix(ruby): retrieve devtools version dynamically for package verification#17335

Merged
diemol merged 1 commit intotrunkfrom
improve-ruby-release-verification
Apr 10, 2026
Merged

fix(ruby): retrieve devtools version dynamically for package verification#17335
diemol merged 1 commit intotrunkfrom
improve-ruby-release-verification

Conversation

@diemol
Copy link
Copy Markdown
Member

@diemol diemol commented Apr 10, 2026

💥 What does this PR do?

The release workflow fails because, at the step where packages are verified to see if they are published, the devtools package in RubyGems is being checked with the wrong version. This PR makes the check use the actual and correct version.

Copilot AI review requested due to automatic review settings April 10, 2026 10:32
@qodo-code-review
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Fix Ruby release verification using dynamic devtools version

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Adds dynamic devtools version retrieval for package verification
• Fixes release workflow by using correct devtools version
• Prevents verification failures during Ruby package publishing

Grey Divider

File Changes

1. rake_tasks/ruby.rake 🐞 Bug fix +7/-1

Add devtools version retrieval for package verification

• Added new devtools_version function to dynamically retrieve devtools version from
 rb/lib/selenium/devtools/version.rb
• Updated verify task to use devtools_version instead of ruby_version for selenium-devtools
 package verification
• Ensures correct version is checked during release workflow verification step

rake_tasks/ruby.rake


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review bot commented Apr 10, 2026

Code Review by Qodo

🐞 Bugs (0)   📘 Rule violations (2)   📎 Requirement gaps (0)   🎨 UX Issues (0)
📘\ ☼ Reliability (1) ⚙ Maintainability (1)

Grey Divider


Action required

1. devtools_version lacks validation 📘
Description
devtools_version can return nil when the version file is missing or no matching VERSION line
is found, producing an invalid RubyGems URL in the publish verification step. This violates the
requirement to validate external/config-derived inputs early with clear, actionable exceptions.
Code

rake_tasks/ruby.rake[R12-16]

+def devtools_version
+  File.foreach('rb/lib/selenium/devtools/version.rb') do |line|
+    return line.split('=').last.strip.tr("'", '') if line.include?('VERSION')
+  end
+end
Evidence
PR Compliance ID 13 requires early validation with clear exceptions for external/config-derived
inputs. The added devtools_version reads from a file and returns a parsed value only if a
VERSION line is found; otherwise it implicitly returns nil, and the modified verification URL
interpolates that value without any validation.

rake_tasks/ruby.rake[12-16]
rake_tasks/ruby.rake[101-101]
Best Practice: Learned patterns

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`devtools_version` may return `nil` (missing file / missing `VERSION` match), which then gets interpolated into the RubyGems verification URL and causes confusing failures.

## Issue Context
This is a release verification path; failures should be fast and actionable.

## Fix Focus Areas
- rake_tasks/ruby.rake[12-16]
- rake_tasks/ruby.rake[101-101]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Duplicate version parsing logic 📘
Description
The new devtools_version duplicates the parsing logic already used by ruby_version, increasing
drift risk if parsing rules change. This conflicts with the guidance to centralize shared workflow
logic in tooling/scripts.
Code

rake_tasks/ruby.rake[R12-16]

+def devtools_version
+  File.foreach('rb/lib/selenium/devtools/version.rb') do |line|
+    return line.split('=').last.strip.tr("'", '') if line.include?('VERSION')
+  end
+end
Evidence
PR Compliance ID 16 calls for centralized logic in scripts to prevent drift. The added
devtools_version introduces a second copy of the same line-based parsing approach used by
ruby_version instead of extracting a shared helper.

rake_tasks/ruby.rake[6-16]
Best Practice: Learned patterns

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The same version-parsing logic is duplicated in `ruby_version` and the newly added `devtools_version`, which can drift over time.

## Issue Context
This file is tooling/release automation; shared parsing logic should be centralized for reliability.

## Fix Focus Areas
- rake_tasks/ruby.rake[6-16]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@selenium-ci selenium-ci added the B-build Includes scripting, bazel and CI integrations label Apr 10, 2026
Copy link
Copy Markdown
Contributor

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

Updates the Ruby release verification rake task to check the selenium-devtools gem using its own dynamically-derived version (instead of incorrectly reusing the selenium-webdriver gem version), fixing release workflow package-published verification.

Changes:

  • Add devtools_version helper to read the Ruby DevTools gem version from rb/lib/selenium/devtools/version.rb.
  • Use devtools_version when verifying the selenium-devtools RubyGems publication URL.

@diemol diemol merged commit 172f44c into trunk Apr 10, 2026
31 checks passed
@diemol diemol deleted the improve-ruby-release-verification branch April 10, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-build Includes scripting, bazel and CI integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants