Removes dependence on formatPipelinesGraphQLDataToREST method
Epic: MR Pipelines migration to GraphQL (&14144) • Sahil Sharma • 18.7
Issues:
- Apollo MR pipelines - Add manual actions (#467551 - closed) • Sahil Sharma • 18.7
- Ensure stages mini graph works with GraphQL res... (#581322 - closed) • Sahil Sharma • 18.7
What does this MR do and why?
This MR removes the deprecated formatPipelinesGraphQLDataToREST utility method and migrates the merge request pipelines table to use native GraphQL data structures.
Key changes:
-
Removes data transformation layer: Eliminates
formatPipelinesGraphQLDataToRESTmethod that was converting GraphQL responses to REST format -
Uses
pipeline_detailsfragment: Adopts the shared GraphQL fragment which provides all necessary pipeline properties including:- hasManualActions
- hasScheduledActions
- stages
- Merge request metadata (added
sourceBranchfield)
- Updates property access: Modifies components to handle both GraphQL and REST property names during the transition period
- Improves error handling: Enhances pipeline action error handling with specific error messages and Sentry logging
What's not included:
Currently this MR does not display downstream pipeline jobs, which is a known bug and will be handled separately.
Screenshots or screen recordings
Before (master) |
After |
|---|---|
|
|
How to set up and validate locally
- Update any project's
.gitlab-ci.ymlto include manual & scheduled jobs with multiple stages.
Example yaml:
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
stages:
- build
- test
- deploy
- cleanup
# Build stage - runs automatically and creates artifacts
build_app:
stage: build
script:
- echo "Building application..."
- mkdir -p build
- echo "Build output $(date)" > build/app.txt
- echo "Version 1.0.0" > build/version.txt
artifacts:
paths:
- build/
expire_in: 1 week
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Test stage - runs automatically with artifacts from build
test_unit:
stage: test
script:
- echo "Running unit tests..."
- cat build/app.txt
- echo "Tests passed!"
artifacts:
paths:
- build/
reports:
junit: build/test-results.xml
expire_in: 1 day
dependencies:
- build_app
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Manual test job - requires manual trigger
test_integration:
stage: test
script:
- echo "Running integration tests..."
- cat build/version.txt
- echo "Integration tests completed"
when: manual
dependencies:
- build_app
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Deploy to staging - manual trigger
deploy_staging:
stage: deploy
script:
- echo "Deploying to staging environment..."
- cat build/app.txt
- echo "Deployment complete"
artifacts:
paths:
- build/
name: "staging-deployment-$CI_COMMIT_SHORT_SHA"
expire_in: 3 days
when: manual
dependencies:
- build_app
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# Deploy to production - manual trigger (only on default branch)
deploy_production:
stage: deploy
script:
- echo "Deploying to production environment..."
- cat build/app.txt
- echo "Production deployment complete"
when: manual
allow_failure: false
dependencies:
- build_app
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Scheduled job - only runs on schedules
nightly_cleanup:
stage: cleanup
script:
- echo "Running nightly cleanup..."
- echo "Cleanup completed at $(date)"
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
# Manual cleanup job
manual_cleanup:
stage: cleanup
script:
- echo "Running manual cleanup..."
- echo "Manual cleanup completed"
when: manual
allow_failure: true
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- Enable
Feature.enable(:mr_pipelines_graphql)feature flag - Navigate to a merge request in this project with pipelines
- Verify the pipelines table displays correctly with:
- Pipeline stages and jobs
- Manual action buttons (if applicable)
- Scheduled action buttons (if applicable)
- Test pipeline actions (cancel/retry/run manual jobs/download artifacts) work as expected
- Verify no console errors
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Sahil Sharma

