Skip to content

filter repo:contains support multiple content tags

Created by: jensim

Feature request description

To expand on (RFC 254) #18584 (closed)
I would like to propose supporting multiple content expressions in the filter repo:contains(file,content)
That way the backend can optimize the query a lot better than a user provided regexp could. Not to mention that the regular expression would need to be able to handle order in the matching, and be nearly impossible to write or read.

Describe alternatives you've considered.

  • Add multiple repo:contains tags
    Drawback: the actual result is not guaranteed to be matching on the same files
  • Write a regexp Drawback: REALLY complex

Additional context

Lets say you want to find all the pom.xml files with a direct dependenct on micrometer and spring-boot-starter, that also have java files that contain classes annotated with @RestController and public methods that are annotated with both @:[[_]]Request and @Timed

This pattern is a common spring+micrometer mistake, since it will essentially create a TimedAspectProxy that will destroy the default functionality provided by spring and micrometer, and you lose a bunch of metrics.