Skip to content

Simplify parameter lookup in issues_finder_shared_examples.rb

Stan Hu requested to merge sh-fix-issue-finder-params-lookup into master

What does this MR do and why?

Prior to Ruby 3.1, WorkItems::WorkItemsFinder::Params would be resolved to IssuesFinder::Params.

However, with https://github.com/ruby/ruby/pull/4585 to fix https://bugs.ruby-lang.org/issues/17887, Ruby 3.1 now resolves WorkItems::WorksItemsFinder::Params as EE::IssuesFinder::Params. However, since the latter is a prepended module, it does not have the constants FILTER_NONE or FILTER_ANY. As a result, the test fails with unintialized constant errors in Ruby 3.1 and up.

Simplify the test to use IssuableFinder::Params since we can use a straightforward lookup that doesn't depend on the finder.

How to set up and validate locally

  1. Switch to Ruby 3.1 (e.g. edit .tool-versions to use ruby 3.1.4).
  2. Run bundle exec rspec spec/finders/work_items/work_items_finder_spec.rb. On master, this test will fail
  3. Check out this branch and repeat 2.

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 Stan Hu

Merge request reports

Loading