Add possibility to cancel projects import from GitHub

What does this MR do and why?

Add the possibility to cancel projects import from GitHub issue

Screenshots or screen recordings

Public API endpoint POST {{host}}/api/v4/import/github/cancel

cancel_public_api

If the given id was an id of not existing project or id of project with provider other than GitHub it will return 404 error

Screenshot_2022-09-30_at_12.36.37

If the project was not in started or scheduled state it will return an error message:

Screenshot_2022-09-30_at_12.35.16

Private API endpoint POST {{host}}/import/github/cancel.json

cancel_api

How to set up and validate locally

Public API:

  1. Start import with POST {{host}}/api/v4/import/github
  2. Check import status, it has to be scheduled or started
  3. Cancel import with POST {{host}}/api/v4/import/github/cancel Request body: { "project_id": 12345 } Where project_id is the ID of the Gitlab project to be canceled.

Private API:

  1. Start import with POST {{host}}/import/github.json or from UI
  2. Check import status, it has to be scheduled or started
  3. Cancel import with POST {{host}}/api/v4/import/github/cancel Request body: { "project_id": 12345 } Where project_id is the ID of the Gitlab project to be canceled.
Edited by Kristina Doskich

Merge request reports

Loading