diff --git a/ruby/Gemfile.lock b/ruby/Gemfile.lock index 2d456c62..800b4f49 100644 --- a/ruby/Gemfile.lock +++ b/ruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - ci-queue (0.96.0) + ci-queue (0.97.0) logger GEM diff --git a/ruby/lib/ci/queue.rb b/ruby/lib/ci/queue.rb index 5f27b189..ce0f5d91 100644 --- a/ruby/lib/ci/queue.rb +++ b/ruby/lib/ci/queue.rb @@ -81,7 +81,13 @@ def from_uri(url, config) Static when 'file', nil File - when 'redis', 'rediss' + when 'redis', 'rediss', 'unix' + # `unix://` URLs are forwarded to the Redis backend as-is; + # redis-client's URL parser accepts the unix:// scheme natively + # and treats the path as the socket path. This lets workloads + # that already run an in-process Redis on a unix socket (Nix + # build sandboxes, hermetic test harnesses, etc.) point ci-queue + # at it without exposing a TCP port. require 'ci/queue/redis' Redis else diff --git a/ruby/lib/ci/queue/version.rb b/ruby/lib/ci/queue/version.rb index 889b96f6..e187297a 100644 --- a/ruby/lib/ci/queue/version.rb +++ b/ruby/lib/ci/queue/version.rb @@ -2,7 +2,7 @@ module CI module Queue - VERSION = '0.96.0' + VERSION = '0.97.0' DEV_SCRIPTS_ROOT = ::File.expand_path('../../../../../redis', __FILE__) RELEASE_SCRIPTS_ROOT = ::File.expand_path('../redis', __FILE__) end diff --git a/ruby/test/ci/queue/redis_test.rb b/ruby/test/ci/queue/redis_test.rb index f3139582..6ceb2b20 100644 --- a/ruby/test/ci/queue/redis_test.rb +++ b/ruby/test/ci/queue/redis_test.rb @@ -624,6 +624,11 @@ def test_initialise_from_rediss_uri assert_instance_of CI::Queue::Redis::Worker, queue end + def test_initialise_from_unix_uri + queue = CI::Queue.from_uri('unix:///tmp/redis.sock', config) + assert_instance_of CI::Queue::Redis::Worker, queue + end + def test_first_reserve_at_is_set_on_first_reserve queue = worker(1) assert_nil queue.first_reserve_at