Context selection issue with 'dependency_proxy_spec'
Goal
Fix context selection for 'dependency_proxy_spec' to ensure it's running in places where orchestrated can run - QA main and nightly packages
Details
dependency_proxy_spec
is being skipped in GitLab main QA pipelines, however it should run based on dependency_proxy_spec.rb#L4
RSpec.describe 'Package', :orchestrated, :registry, only: { pipeline: :main }, product_group: :container_registry do
only: { pipeline: :main }
was added in Fix registry related tests (gitlab-org/gitlab!73825 - merged) based on gitlab-org/gitlab#344246 (comment 725097281)
these tests can't be running on a pipeline other than master, or where we can orchestrate the scenarios
If we look at latest master pipeline - this test is not running - https://gitlab.com/gitlab-org/gitlab/-/jobs/3964710241 or Omnibus pipeline example https://gitlab.com/gitlab-org/gitlab-qa-mirror/-/jobs/3951876756
It appears to be caused by the way pipeline context selection works:
if option[:pipeline].present?
return true if Runtime::Env.ci_project_name.blank?
return pipeline_matches?(option[:pipeline])
....
def pipeline_matches?(pipeline_to_run_in)
Array(pipeline_to_run_in).any? { |pipeline| pipeline.to_s.casecmp?(pipeline_from_project_name(Runtime::Env.ci_project_name)) }
end