Skip to content

Include release authors during Github imports

Bala Kumar requested to merge 343448-fix-github-importers-release-author into master

What does this MR do and why?

Fixes Github Import releases to have author_id.

This is second MR for issue #343448 (closed) . The first MR !89694 (merged) covers author_id validation for releases model.

See related discussion: #343448 (comment 985979730)

Each of these MR's will have its own feature flag rollout. The idea is to enable Github importer fix, observe production data and then enable the validation feature flag.

Screenshots or screen recordings

fix-releases-author-id-github-import

  1. Project id 22 was imported with this MR fix and we can observe the releases is imported with author_id.
  2. Project id 23 was imported with current master as source and we can observe the releases are imported without author_id.

How to set up and validate locally

  1. Feature.enable(:import_release_authors_from_github)

  2. Import a project with releases from Github using the Gitlab API.

curl --request POST \
  --url "http://localhost:3000/api/v4/import/github" \
  --header "content-type: application/json" \
  --header "PRIVATE-TOKEN: <gitlab-token>" \
  --data '{
    "personal_access_token": "<github-token>",
    "repo_id": "12116599",
    "target_namespace": "root",
    "new_name": "test-github-import"
}'

Import a project with Releases from Github and we can observe the releases records in Gitlab is created with a author_id.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #343448 (closed)

Edited by Bala Kumar

Merge request reports