Respect original visibility for instrumented methods
What does this MR do?
Related issue: #238949 (closed)
After fixing, private methods remain private
list_service = Boards::ListService.new Project.first, User.first
Loading development environment (Rails 6.0.3.1)
[1] pry(main)> list_service = Boards::ListService.new Project.first, User.first
Project Load (3.7ms) SELECT "projects".* FROM "projects" ORDER BY "projects"."id" ASC LIMIT $1 [["LIMIT", 1]]
User Load (13.5ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT $1 [["LIMIT", 1]]
Route Load (3.0ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = $1 AND "routes"."source_type" = $2 LIMIT $3 [["source_id", 1], ["source_type", "Project"], ["LIMIT", 1]]
=> #<Boards::ListService:0x00007fa7c8605c80 @current_user=#<User id:1 @root>, @params={}, @parent=#<Project id:1 gitlab-org/gitlab-test>>>
[2] pry(main)> list_service.boards
NoMethodError: private method `boards' called for #<Boards::ListService:0x00007fa7c8605c80>
from (pry):2:in `<main>'
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
Edited by Peter Leitzen