feat(ci get): add --merge-request and --status flags
Summary
Implements #8210 (closed).
- Adds
--merge-request=<iid>(short: none) toglab ci getto target the head pipeline of a specific merge request. Differs from--branchwhen the MR's head pipeline diverges from the latest pipeline on its source branch (e.g. forks, detached pipelines). - Adds
--status=<state>(short:-s) to filter jobs by state. The value is passed through to the API'sscopeparameter, so it tracks whatever states the API accepts (failed,success,canceled,skipped, etc.) without client-side enumeration drift. - Extends the job details table (
--with-job-details) withStageandURLcolumns. - Switches error reporting in this command from printing a red ✘ to stdout to returning the error consistently, so it surfaces on stderr like the rest of the CLI.
--merge-request is mutually exclusive with --pipeline-id and --branch.
Example usage
# Show only failed jobs for the head pipeline of MR !42
glab ci get --merge-request=42 --status=failed --with-job-details
# Get the head pipeline for a specific MR
glab ci get --merge-request=42
# Filter jobs by an arbitrary status, with the short flag
glab ci get -s successWorking example
glab ci get -R gitlab-org/modelops/applied-ml/code-suggestions/ai-assist --merge-request 5141 --status failed --with-job-detailsTest plan
- Unit tests added for
--merge-request(resolves MR head pipeline by IID) - Unit tests added for the
--merge-requesterror paths (no head pipeline, head pipeline with zero ID) - Unit tests added for
--statusfiltering (asserts the API scope param is set) - Existing
--with-job-detailstest updated for the newStage/URLcolumns - Documentation regenerated (
docs/source/ci/get.md) - All pre-push hooks pass (build, tests, lint, docs)
Edited by Eduardo Bonet