feat(ci/get): add with-downstream-pipelines flag
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
Description
This change adds the flag for glab ci get called --with-downstream-pipelines that also fetches downstream pipelines if there are any.
I have added the bridge jobs to the struct that was already used for the merged response
type PipelineBridge struct {
Bridge *gitlab.Bridge `json:"bridge"`
Pipeline *gitlab.Pipeline `json:"pipeline"`
Jobs []*gitlab.Job `json:"jobs"`
Variables []*gitlab.PipelineVariable `json:"variables"`
}
type PipelineMergedResponse struct {
*gitlab.Pipeline
Jobs []*gitlab.Job `json:"jobs"`
Bridges []PipelineBridge `json:"bridges"`
Variables []*gitlab.PipelineVariable `json:"variables"`
}
Related Issues
Resolves [#7933]
How has this been tested?
I have extended the testing that was already there for glab ci get, to include tests with the flag --with-downstream-pipelines.
I have also built the binary and run it against our GitLab self-hosted instance, which worked.
Screenshots (if appropriate):
Screenshot running in a real scenario.
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap
Edited by uiop860
