Skip to content

Use ci_runner_taggings.tag_id to match ci_pending_builds.tag_ids[]

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

See context in #470872 (comment 2382060671).

I'm assuming the change will be something like this (to be confirmed):

diff --git a/app/services/ci/queue/build_queue_service.rb b/app/services/ci/queue/build_queue_service.rb
index f742297c0e34..df455f996e72 100644
--- a/app/services/ci/queue/build_queue_service.rb
+++ b/app/services/ci/queue/build_queue_service.rb
@@ -28,7 +28,7 @@ def build_candidates
         candidates = builds_for_protected_runner(candidates) if runner.ref_protected?
 
         # pick builds that does not have other tags than runner's one
-        candidates = builds_matching_tag_ids(candidates, runner.tag_ids)
+        candidates = builds_matching_tag_ids(candidates, runner.taggings.pluck(:tag_id))
 
         # pick builds that have at least one tag
         candidates = builds_with_any_tags(candidates) unless runner.run_untagged?
Edited by 🤖 GitLab Bot 🤖