codetribute icon indicating copy to clipboard operation
codetribute copied to clipboard

Allow to match on substrings of component names.

Open emilio opened this issue 6 years ago • 3 comments

#320 wouldn't have needed to be such a massive change if we could, for example, wildcard on component names.

It'd be nice if we could automatically include all the Layout: * and DOM: * components there, that way renaming/reorganizing them wouldn't silently break the tool.

emilio avatar Aug 10 '19 17:08 emilio

I believe these are translated to search queries against Bugzilla and GitHub, so we are limited to what those support. But, if they support wildcards, then this should be possible.

So the place to start solving this is to research wildcard support in those queries.

djmitche avatar Aug 12 '19 14:08 djmitche

Great idea Dustin. I think Bugzilla and the bugzilla-graphql-wrapper provides it.

Below is how I search for a combination of bugs who has Core as product and whose component matches either Layout: * or DOM: *

{
  "search": {
    "products": "Core",
    "fields": ["component"],
    "operators": ["MATCHES_REGEX"],
    "values": ["(Layout: *)|(DOM: *)"]
  },
  "paging": {
    "page": 0,
    "pageSize": 10
  }
}

I think we can combine all component that belong in a product with an OR operator, but I haven't found bugzilla component naming standard, can a bugzilla component name contain a regex special character? If so, how do we differentiate a component full name vs regex?

fiennyangeln avatar Aug 16 '19 14:08 fiennyangeln

Nice research!

I suspect a bugzilla component name can contain at least .. One common technique is to put / at the beginning and end of a string that should be treated as a regex -- so for example

  • ["air.mozilla.org"] would only match air.mozilla.org, but
  • ["/air.mozilla.org/"] would also match airXmozillaXorg.

djmitche avatar Aug 17 '19 00:08 djmitche