Open eseliger opened 1 year ago
We should also reconcile this with the type:diff author:$x
filter so that they are consistent with each other.
Author can also take a human-readable name ("Erik Seliger"), so it's gonna be slightly different, but I agree we should use this enriched logic in there too for nicer mapping.
That one can be a step 2 though, this ticket here I think we need to sort out rather quickly as it'll change pretty drastically how the ownership search works and we might want to do that before people start using it, if possible in the remaining time.
Agreed, consistency with author:
is nice-to-have for later.
I'd still gracefully fall back to the data in the CODEOWNERS file. Why not do that?
As a customer if I had a CODEOWNERS file existing, I would enable own, and I searched by an entry in the codeowners file, got no results, I would think that the feature does not work.
For Ownership Search (
file:has.owner()
filter andselect:file.owners
) we want to map users based on the following:f:has.owner(eseliger)
should look up the Sourcegraph user calledeseliger
(not the code host handle in the codeowners file)f:has.owner(erik@sourcegraph.com)
should look up the user by that email addressf:has.owner(own-team)
should look up the Sourcegraph team calledown-team
(after realizing there's no user calledown-team
)This should give us a slice of
ResolvedOwner
s for the input to the search, then we need to map the Ownership data from the CODEOWNERS toResolvedOwner
s as well, for equality checks:For ingested ownership data, we simply look up User, Team by name, and user by email, all that are not found are considered invalid. No code host specific logic happening here.
When parsing existing CODEOWNERS files in a repo, we will do the following to map it back to a Sourcegraph entity as a
ResolvedOwner
:/
, it must be a team. We should then look up a team by name, where name is the part following the/
. Later, we want to enrich teams by metadata about external team handles and this becomes unnecessary, where we would look upteams_external_accounts
(sort of, not necessarily adding this table but you get the idea).We will want to consider: