Skip to content

Convert Octokit repository response to hash

What does this MR do and why?

This is the first of a series of merge requests to convert Octokit returned objects into a hash before using it in the codebase in order to rely less on Sawyer::Resource objects

This MR converts the object that is returned from Octokit#repository and Octokit#repos to a hash and updates the codebase to use the array notation.

Related to: https://gitlab.com/gitlab-org/gitlab/-/issues/372472

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Import via UI

Repeat the steps below with the FF remove_legacy_github_client enabled/disabled

  1. Create a new project, and choose to import from Github
  2. Provide your personal access token
  3. Then you should see a list of repositories
  4. Select one and import it
  5. Check if everything is imported

Import via API

Repeat the steps below with the FF remove_legacy_github_client enabled/disabled

  1. Use the command below to import a Github project via API
curl --request POST \
  --url "http://gdk.test:3000/api/v4/import/github" \
  --header "content-type: application/json" \
  --header "PRIVATE-TOKEN: GITLAB_ACCESS_TOKEN" \
  --data '{
  "personal_access_token": "GITHUB_ACCESS_TOKEN",
  "repo_id": "REPOSITORY_ID",
  "target_namespace": "root",
  "new_name": "NEW_REPO_SLUG"
}'
  1. Check if everything is imported

MR acceptance checklist

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

Edited by Rodrigo Tomonari

Merge request reports