Ensure asset fetch works properly when triggered from other projects
What does this MR do?
When pipelines were triggered from projects other than gitlab-org/gitlab
or gitlab-org/gitlab-foss
, but still had the substring gitlab
in them, the fetch assets job incorrectly attempted to pull asset images from that project.
For example, https://gitlab.com/gitlab-org/build/omnibus-gitlab-mirror/-/jobs/2219830946 from gitlab-pages!714 (merged).
This MR fixes it.
Testing
$ export TOP_UPSTREAM_SOURCE_PROJECT="gitlab-org/gitlab"; if [[ -n "${TOP_UPSTREAM_SOURCE_PROJECT}" && "${TOP_UPSTREAM_SOURCE_PROJECT}" =~ gitlab-org/(security/)?gitlab(-foss)?$ ]]; then echo "Yes"; else echo "No"; fi
Yes
$ export TOP_UPSTREAM_SOURCE_PROJECT="gitlab-org/gitlab-foss"; if [[ -n "${TOP_UPSTREAM_SOURCE_PROJECT}" && "${TOP_UPSTREAM_SOURCE_PROJECT}" =~ gitlab-org/(security/)?gitlab(-foss)?$ ]]; then echo "Yes"; else echo "No"; fi
Yes
$ export TOP_UPSTREAM_SOURCE_PROJECT="gitlab-org/security/gitlab"; if [[ -n "${TOP_UPSTREAM_SOURCE_PROJECT}" && "${TOP_UPSTREAM_SOURCE_PROJECT}" =~ gitlab-org/(security/)?gitlab(-foss)?$ ]]; then echo "Yes"; else echo "No"; fi
Yes
$ export TOP_UPSTREAM_SOURCE_PROJECT="gitlab-org/security/gitlab-foss"; if [[ -n "${TOP_UPSTREAM_SOURCE_PROJECT}" && "${TOP_UPSTREAM_SOURCE_PROJECT}" =~ gitlab-org/(security/)?gitlab(-foss)?$ ]]; then echo "Yes"; else echo "No"; fi
Yes
$ export TOP_UPSTREAM_SOURCE_PROJECT="gitlab-org/gitlab-pages"; if [[ -n "${TOP_UPSTREAM_SOURCE_PROJECT}" && "${TOP_UPSTREAM_SOURCE_PROJECT}" =~ gitlab-org/(security/)?gitlab(-foss)?$ ]]; then echo "Yes"; else echo "No"; fi
No
$ export TOP_UPSTREAM_SOURCE_PROJECT="gitlab-org/gitlab-workhorse"; if [[ -n "${TOP_UPSTREAM_SOURCE_PROJECT}" && "${TOP_UPSTREAM_SOURCE_PROJECT}" =~ gitlab-org/(security/)?gitlab(-foss)?$ ]]; then echo "Yes"; else echo "No"; fi
No
$ export TOP_UPSTREAM_SOURCE_PROJECT="gitlab-org/gitaly"; if [[ -n "${TOP_UPSTREAM_SOURCE_PROJECT}" && "${TOP_UPSTREAM_SOURCE_PROJECT}" =~ gitlab-org/(security/)?gitlab(-foss)?$ ]]; then echo "Yes"; else echo "No"; fi
No
Related issues
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion
Required
-
Merge Request Title, and Description are up to date, accurate, and descriptive -
MR targeting the appropriate branch -
MR has a green pipeline on GitLab.com -
Pipeline is green on dev.gitlab.org if the change is touching anything besides documentation or internal cookbooks -
trigger-package
has a green pipeline running against latest commit
Expected (please provide an explanation if not completing)
-
Test plan indicating conditions for success has been posted and passes -
Documentation created/updated -
Tests added -
Integration tests added to GitLab QA -
Equivalent MR/issue for the GitLab Chart opened
Edited by Balasankar 'Balu' C