From d6c2f0324d3efd7c8176ae579e29022e9abc4d93 Mon Sep 17 00:00:00 2001 From: Mark Dorison Date: Fri, 18 Sep 2026 17:05:47 -0400 Subject: [PATCH] Stop referencing CI::Queue constants at gemspec top level Every Dependabot bundler job for ruby/ has failed since at least 2025-08-11 with: uninitialized constant CI > dir = Pathname.new(CI::Queue::RELEASE_SCRIPTS_ROOT)... Dependabot's GemspecSanitizer wraps each `require` in a rescue LoadError block and evaluates the gemspec in a checkout without lib/ci/queue/version.rb. spec.version and spec.files are rewritten to literals, so the only thing that still needs the constant is the top-level Lua glob. That line raises before the spec block runs, and Dependabot reports dependency_file_not_evaluatable. No Bundler update PR, including the open security updates for json, msgpack and concurrent-ruby, has been able to open. Glob the release scripts relative to __dir__ instead. Same paths in spec.files (verified identical with the Lua files copied in), and the gemspec now loads under a Dependabot-style evaluation with the require rescued and no gems installed. The pathname require is no longer needed. Assisted-By: devx/6b388d1b-b275-4664-9297-6db9839a7769 --- ruby/ci-queue.gemspec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ruby/ci-queue.gemspec b/ruby/ci-queue.gemspec index eac9a1b0..b9230684 100644 --- a/ruby/ci-queue.gemspec +++ b/ruby/ci-queue.gemspec @@ -3,10 +3,11 @@ lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'ci/queue/version' -require 'pathname' -dir = Pathname.new(CI::Queue::RELEASE_SCRIPTS_ROOT).relative_path_from(Pathname.new(__dir__).realpath) -lua_scripts = Dir[dir.join('*.lua').to_s] +# Release Lua scripts are gitignored copies made by `rake scripts:copy`, so +# `git ls-files` misses them. Glob without touching CI::Queue constants: +# Dependabot evaluates this file with the `require` above rescued away. +lua_scripts = Dir.glob('lib/ci/queue/redis/*.lua', base: __dir__) Gem::Specification.new do |spec| spec.name = 'ci-queue'