Ensure only projects from the same organization can be assigned to the runner
The following discussion from !189579 (merged) should be addressed:
-
@mrincon started a discussion: (+4 comments) Question: @narendran-kannan @pedropombeiro While testing this locally I came across this error for some of my runners:
runner can only be assigned to projects in the same organization
{ "data": { "runnerAssignToProject": { "errors": [ "runner can only be assigned to projects in the same organization" ], "__typename": "RunnerAssignToProjectPayload" } } }I used the following query to list the "assignable" runners so they can be selected:
@current_user.ci_owned_runners.assignable_for(project)Is it possible this is just something wrong with my testing seed data? Perhaps we should close a gap in
assignable_forso it returns runner in the same partition?Related MR code.
Proposal
Change Ci::Runner.assignable_for scope so that it filters additionally by the runner's organization ID. The organization_id column backfilling will only be finalized #523850 (closed) (so we'll only be able to rely on its presence for self-managed customers starting in %18.3, after the next required stop).
