Skip to content

Convert Sawyer::Resource objects to hash

Rodrigo Tomonari requested to merge rodrigo/log-sawyer-resource-key-usage into master

What does this MR do and why?

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

This change converts Octokit returned objects into a hash, and since previous MRs have already modified Github Import to use the array notation, this change shouldn't break GitHub Import.

This change also updates the Sawyer patch to log any access to a Sawyer Resource property. The log will help us identify any remaining place that we will need to convert to a hash before completely disabling Sawyer::Resource's methods.

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

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

  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

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