Add array notation to GitHub Import representation objects
What does this MR do and why?
This is the second 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
Representation objects allow their properties to be accessed using dot notation like Sawyer Resources that are used by Octokit, which allows methods in GitHub Import to receive as a parameter a representation object or a Sawyer resource object.
Because Sawyer Resource objects will be converted to a hash in future changes, this change makes representation objects also to support the array notation. So now, methods in GitHub Import will be able to receive representation objects, Sawyer Resource, or hashes as parameters.
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
- Create a new project, and choose to import from Github
- Provide your personal access token
- Then you should see a list of repositories
- Select one and import it
- 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.
-
I have evaluated the MR acceptance checklist for this MR.