Make cross-repo CI triggers first-class
Description
Before implementing a full multi-project pipeline, let's start by utilizing our existing trigger functionality, and make it a first-class citizen in .gitlab-ci.yml.
As a developer, I want to be able to trigger CI build and test on one component after completing tests on another component. e.g. make a change to the API, then trigger tests on the front-end to make sure the front-end integration tests still succeed.
Initial Proposal
We currently support triggers via the API, but to use it in a .gitlab-ci.yml requires ugly CURLing and passing secure tokens. We can simplify that process by providing some higher-level construct. Total rough draft:
test_front_end:
stage: test
trigger:
project: gitlab-org/front-end
vars:
api_ref: $CI_BUILD_REF
only:
- tags
I'm not sure how passing references should work. It's probably common to need to know the ref of the upstream build, so maybe we just pass that automatically with some convention. But we probably need to support passing other variables too.
One problem with this is the token. The current API expects you to have pre-generated tokens for the downstream project, but as a user, I'd like to be able to just specify the project name and let some other permission system allow the transaction.
Links / references
- Originally from gitlab-ce#15655 (Multi-project pipeline)
- Some discussion in gitlab-ce#3743 (GitLab Pipeline)
- Related feature proposal: gitlab-ce#17069 (Dependencies)