Prefer `CI_API_V4_URL` over hard coded API endpoint
We have a few scripts having hard coded API endpoint:
config.endpoint = 'https://gitlab.com/api/v4'
Those should be changed to prefer CI_API_V4_URL
so it works on GitLab.cn as well: https://gitlab.cn/gitlab-cn/gitlab/-/jobs/15951 (via https://gitlab.cn/gitlab-cn/gitlab/-/merge_requests/2)
config.endpoint = ENV['CI_API_V4_URL'] || 'https://gitlab.com/api/v4'
Scripts
-
tooling/bin/find_tests
!67617 (merged) - [-]
scripts/perf/query_limiting_report.rb
- Introduced in !57209 (merged) and looks like we're using it locally only
-
scripts/api/cancel_pipeline.rb
!67978 (merged)- This is used to cancel the running pipeline itself, so we should update this.
-
scripts/api/get_job_id.rb
!67978 (merged)- In
fail_pipeline_early
we need this to request against the running instance, while in other places it needs to request against GitLab.com
- In
-
scripts/api/download_job_artifact.rb
!67978 (merged)- This is used to retrieve test metadata, which if it runs against GitLab.com it should work
-
scripts/api/play_job.rb
!67978 (merged)- We're not using this right now
-
scripts/review_apps/automated_cleanup.rb
=> https://gitlab.com/gitlab-jh/gitlab-jh-enablement/-/issues/131
Caveats
It can be possible that the scripts do intend to read from GitLab.com rather than its on endpoint on the instance. We need to make sure it's still working on dev.gitlab.org and ops.gitlab.net.
Edited by Lin Jen-Shin