-
- Downloads
CE port for pipelines for external pull requests
Detect if pipeline runs for a GitHub pull request When using a mirror for CI/CD only we register a pull_request webhook. When a pull_request webhook is received, if the source branch SHA matches the actual head of the branch in the repository we create immediately a new pipeline for the external pull request. Otherwise we store the pull request info for when the push webhook is received. When using "only/except: external_pull_requests" we can detect if the pipeline has a open pull request on GitHub and create or not the job based on that.
Showing
- app/models/ci/pipeline.rb 10 additions, 0 deletionsapp/models/ci/pipeline.rb
- app/models/ci/pipeline_enums.rb 2 additions, 1 deletionapp/models/ci/pipeline_enums.rb
- app/models/external_pull_request.rb 96 additions, 0 deletionsapp/models/external_pull_request.rb
- app/models/project.rb 2 additions, 0 deletionsapp/models/project.rb
- app/services/ci/create_pipeline_service.rb 4 additions, 1 deletionapp/services/ci/create_pipeline_service.rb
- app/services/external_pull_requests/create_pipeline_service.rb 29 additions, 0 deletions...ervices/external_pull_requests/create_pipeline_service.rb
- app/workers/all_queues.yml 1 addition, 0 deletionsapp/workers/all_queues.yml
- app/workers/update_external_pull_requests_worker.rb 25 additions, 0 deletionsapp/workers/update_external_pull_requests_worker.rb
- config/sidekiq_queues.yml 1 addition, 0 deletionsconfig/sidekiq_queues.yml
- db/migrate/20190829131130_create_external_pull_requests.rb 25 additions, 0 deletionsdb/migrate/20190829131130_create_external_pull_requests.rb
- db/migrate/20190830075508_add_external_pull_request_id_to_ci_pipelines.rb 15 additions, 0 deletions...830075508_add_external_pull_request_id_to_ci_pipelines.rb
- db/migrate/20190830080123_add_index_to_ci_pipelines_external_pull_request.rb 17 additions, 0 deletions...080123_add_index_to_ci_pipelines_external_pull_request.rb
- db/migrate/20190830080626_add_foreign_key_to_ci_pipelines_external_pull_request.rb 17 additions, 0 deletions..._add_foreign_key_to_ci_pipelines_external_pull_request.rb
- db/schema.rb 19 additions, 0 deletionsdb/schema.rb
- lib/gitlab/ci/pipeline/chain/build.rb 1 addition, 0 deletionslib/gitlab/ci/pipeline/chain/build.rb
- lib/gitlab/ci/pipeline/chain/command.rb 1 addition, 1 deletionlib/gitlab/ci/pipeline/chain/command.rb
- lib/gitlab/import_export/import_export.yml 2 additions, 0 deletionslib/gitlab/import_export/import_export.yml
- spec/factories/external_pull_requests.rb 17 additions, 0 deletionsspec/factories/external_pull_requests.rb
- spec/lib/gitlab/ci/build/policy/refs_spec.rb 14 additions, 0 deletionsspec/lib/gitlab/ci/build/policy/refs_spec.rb
- spec/lib/gitlab/ci/pipeline/chain/build_spec.rb 34 additions, 0 deletionsspec/lib/gitlab/ci/pipeline/chain/build_spec.rb
app/models/external_pull_request.rb
0 → 100644
spec/factories/external_pull_requests.rb
0 → 100644
Please register or sign in to comment