Skip to content

Enable #entry_for_path for sectional CODEOWNERS behind feature flag

What does this MR do?

This MR is the first pass at adding a method to handle #entry_for_path(path) calls with the new sectional CODEOWNERS data structure, which sorts entries into sectional sub-hashes

# Proposed new data structure
#
{
  Default => {
    [Entry, Entry, Entry, ]
  },
  Documentation => {
    [Entry, Entry, Entry, ]
  },
  Database => {
    [Entry, Entry, Entry, ]
  }
}

(example from #215191 (closed))

The bulk of the LOC here is extracting the tests into a shared_example for reuse.

This is really a first pass, as in getting this change put together today, I realized that since I standardized the response from both #entry_for_path and #sectional_entry_for_path, and that #get_parsed_sectional_data must handle both sectional and non-sectional CODEOWNERS files, we can simplify this even further. However, I wanted to submit this MR now, both to get a full CI run, and to focus review on small number of meaningful changes here so far -- this MR was already getting big enough, and I've come to a logical shipping point (especially true since we're behind a feature flag..)

Related to #215191 (closed)

Merge request reports