Skip to content

Remove Repositories::TreeFinder inheritance

Joe Woodward requested to merge chore/remove-git_ref_finder-inheritance into master

What does this MR do and why?

Repositories::TreeFinder was previously inheriting from GitRefFinder, however, on inspection of the logic I found that the inherited logic is never used except for the attr_accessors and the initializer

Describe in detail what your merge request does and why.

  1. Removes parent class GitRefFinder from Repositories::TreeFinder
  2. Adds attr_accessor for :params
  3. Delegates repository to user_project

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Make the FlightJS/flight project public
      project = Project.find_by_full_path('flightjs/flight')
      project.id => 6 # if this is not 6 you will need to update the curl command below
      project.update visibility_level: Project::PUBLIC
  2. Query the api endpoint for listing repo trees
      curl http://gdk.test:3000/api/v4/projects/6/repository/tree
      curl http://gdk.test:3000/api/v4/projects/6/repository/tree?recursive=true
      curl http://gdk.test:3000/api/v4/projects/6/repository/tree?recursive=true&path=doc
      curl http://gdk.test:3000/api/v4/projects/6/repository/tree?ref=trigger-hook

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 Joe Woodward

Merge request reports