Draft: Import/export support for callback jobs
What does this MR do and why?
Adds the Importable
concern and supporting configuration to the new model added in !134938 (closed).
Note that there is currently no way for instances of these models to be created, as they will be configured using a new CI keyword that is to be added in a subsequent issue (#415737). There should therefore be no impact to existing imports/exports.
How to set up and validate locally
- Go to Admin -> Settings -> General -> Import & Export settings, enable "GitLab export" as an import source, and enable project exports.
- Create a project, and add a minimal
.gitlab-ci.yml
such as:test: stage: test when: manual # So the job won't get picked by a runner script: - echo 'test'
- In a Rails console, update the job's type in the pipeline that was created:
job = Ci::Build.find <job-id> job.update! type: 'Ci::CallbackJob', status: :waiting_for_callback job.ci_stage.update! status: :waiting_for_callback job.pipeline.update! status: :waiting_for_callback
- Go to Settings -> General and click "Export project"
- Refresh after a second or two, and click "Download export"
- Create a new project, selecting "Import", and then "GitLab export"
- Select the export file you downloaded previously
- When the import is finished, view the only pipeline for the project and observe the imported callback job (it will be in the cancelled state because all non-finished jobs are cancelled on import)
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.
Related to #415736
Edited by Tiger Watson