Migrate play manual jobs to use apollo and GraphQl instead of axios
What does this MR do and why?
Resolves #420630 (closed) - This MR replaces the axios call in pipeline manual actions with the jobPlay GraphQl mutation.
Note: The parent issue specifies we should:
Handle the new emit pattern, ideally without the eventhub and with native Vue events instead.
I believe this is already done in
Screenshots or screen recordings
| Before | After |
|---|---|
| before | after |
How to set up and validate locally
- Run gdk locally and navigate to Group > Project > Build > Pipeline Editor and create a ci/cd config file with a stage that has manual jobs (example below)
- Create a MR in the project to trigger a pipeline
- Go to Group > Project > Build > Pipelines
- Find the pipeline triggered by your MR, it should have a drop down of actions to run the manual jobs
- Open the dev tools in your browser and go to the Network tab, verify that the
playJobGraphQl mutation is called when you click one of the manual actions
Example CI/CD Config File
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- when: always
default:
image: busybox
stages:
- stage1
- stage2
- stage3
- stage4
job1:
stage: stage1
script:
- export
manual-job1:
stage: stage2
script: echo
when: manual
manual-job2:
stage: stage2
script: echo
when: manual
job2:
stage: stage3
script:
- exit 1
manual-job5:
stage: stage4
script: echo
when: on_success
manual-job6:
stage: stage4
script: echo
when: on_success
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Missy Davies