-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP][QA] Canonical Code Coverage Teams and CODEOWNERS Assignment #72692
Comments
I'm thinking the config file would be something like this: interface Team {
title: string;
githubGroup: string;
patterns: string[];
}
export const TEAMS: Team[] = [
{
title: 'Operations',
githubGroup: '@elastic/kibana-operations'
patterns: [
'/src/dev/',
'/src/setup_node_env/',
'/src/optimize/',
'/src/es_archiver/',
'/packages/*eslint*/',
'/packages/*babel*/',
'/packages/kbn-dev-utils*/',
'/packages/kbn-es/',
'/packages/kbn-optimizer/',
'/packages/kbn-pm/',
'/packages/kbn-test/',
'/packages/kbn-ui-shared-deps/',
'/src/legacy/server/keystore/',
'/src/legacy/server/pid/',
'/src/legacy/server/sass/',
'/src/legacy/server/utils/',
'/src/legacy/server/warnings/',
'/.ci/es-snapshots/',
'/vars/',
]
},
...
] We could then take the |
Ahh, this makes more sense now. I knew you were on to something last week, but now I grok it. |
@spalger @LeeDr I was interested in what the community has in this space. FYI:I ran two of it's commands, Just an interesting finding. |
I think the general problem is that we want all code to have a team assignment for code coverage reports but don't necessarily want all those code paths to require team review of PRs (which is what the CODEOWNERS file does). |
@LeeDr trying to understand this statement. It sounds like you mean we want the assignments, w/o using Codeowners. Is that correct? |
Linking the previous discussion: #72150 (comment) |
Sounds like we want to support different pattern list in those cases, |
We still have at least one outstanding issue. @LeeDr and I think we could just use the first team as the "priority" and only show that one. Your thoughts? @spalger |
So, is there a real use-case for there being more than one owner per file when it comes to coverage? If not then we could add a check to CI that verifies that every file in the repository maps to exactly one "owner". This check would create a stream of all the files in the repo, and then run them through some sort of matcher to determine which coverage/codeowner patterns match it. If more or less than one code owner matches it could throw an error and prevent changes to the repo until the configuration is updated. This is what we do for typescript projects and it's proven effective. Every typescript file in the repository is validated to match a single project and that ensures that we are always checking types in CI. The same could be true here and would ensure that the coverage config stays up to date as files move around without QA constantly having to update or resync this config with reality. If we decide that allowing more than 1 team assignment per path is actually useful then I'm not sure what I think we should so. I'd need to see the visualizations, but my instinct is that if we have a file owned by both Team A and Team B, then both teams should get credit for that file. Not just whichever team is listed first in the config. I can imagine an argument for the "first" team approach, but I think that it's very challenging to understand the implications of the ordering in the ownership config and relying on it will likely introduce ambiguity that makes the visualizations less useful/accurate. Enforcing that a single "owner" is always assigned to every path removes a lot of ambiguity if you ask me. |
Yeah that's our line of thinking as well, regarding one owner. I must say I like the idea of QA not having to keep the books on the file to team mappings. The other outstanding issue is that, at this moment, the logic for inlining the painless script is not exposed. I still agree that with the new approach, we would no longer need to store the script, as it's generated, but the issue of uploading it to the cluster still stands. |
Well, if we can establish confidence in the assignment logic because it's backed by a CI check that verifies that every file is mapped to a specific team maybe we don't need to use a script anymore and can instead assign ownership when we're ingesting the coverage? |
That has my vote, what say you @LeeDr |
We are assigning ownership during ingest (using an ingest pipeline). But I think you're saying to make the assignments before we ingest it, in the code coverage scripts. I guess I'd be OK with that if it was relatively simple to do. |
I would like to make an update, and test going through the current process. It's not great. https://github.com/elastic/kibana/pull/73336/files |
Once we have the logic in place to output the two lists (teams, codeowners), it'd just be a lookup. |
Pinging @elastic/kibana-qa (Team:QA) |
Add the first draft of the TEAMS assignments, including defaults for code coverage and teams. After this PR, we will add a CI check to verify all defined paths have CODEOWNERship, and possibly code coverage teams. Resovles #72692
We discussed this in a zoom call earlier today and agreed that if multiple teams want the same code paths reflected in their code coverage reports we can support that. The simplest solution then is to always make it match the codeowners relationship.
One point we discussed on the |
Add the first draft of the TEAMS assignments, including defaults for code coverage and teams. After this PR, we will add a CI check to verify all defined paths have CODEOWNERship, and possibly code coverage teams. Resovles #72692
@LeeDr after pondering this, I'm wondering if it's good to ever NOT define a path in CODEOWNERS. |
Add the first draft of the TEAMS assignments, including defaults for code coverage and teams. After this PR, we will add a CI check to verify all defined paths have CODEOWNERship, and possibly code coverage teams. Resovles #72692
@LeeDr I'm currently working out the lookup. I "feel" like some amalgamation of your previous work in the painless script could be of use here. Your thoughts? |
Yes. The CODEOWNERS is a subset of the code coverage team assignment list. We want code coverage team assignment for all the product code (not required but OK on test code). |
@spalger @LeeDr Currently, the source of truth is an array of objects, that gets converted into a Map. Lee would like a structure that essentially mimics the Map object, having all the paths as the keys. What time is good gents? |
Also, @spalger how do we want to handle committing the generated CODEOWNERS file? |
|
Notes from discussion today;
|
Notes from further discussion:
|
@spalger Any ideas on this ownership config file: interface OwnerRecord {
requiresApproval: {
approver: string, // CODEOWNERS Team Name
files: string[], // Files listed in CODEOWNERS
};
noApproval: {
team: string; // Code Coverage Team Name
files: string[] // Files not listed in CODEOWNERS, but are listed for code coverage team assignment
},
}
export const ownershipConfig: OwnerRecord[] = [
{
requiresApproval: {
approver: '@elastic/kibana-operations',
files: [
'/src/dev/',
'/src/setup_node_env/',
'/src/optimize/',
'/packages/*eslint*/',
'/packages/*babel*/',
'/packages/kbn-dev-utils*/',
'/vars/',
'!/vars/kibanaCoverage.groovy',
'!/vars/kibanaTeamAssign.groovy',
],
},
noApproval: {
team: 'kibana-operations',
files: [],
},
},
{
requiresApproval: {
approver: '@elastic/kibana-qa',
files: [
'/src/dev/code_coverage',
'/test/functional/services/common',
'/test/functional/services/lib',
'/test/functional/services/remote',
'/vars/kibanaCoverage.groovy',
'/vars/kibanaTeamAssign.groovy',
],
},
noApproval: {
team: 'kibana-operations',
files: [],
},
},
{
requiresApproval: {
approver: '@elastic/kibana-security',
files: [
'/src/core/server/csp/',
],
},
noApproval: {
team: 'kibana-security',
files: [],
},
},
{
requiresApproval: {
approver: '@elastic/kibana-platform',
files: [
'/src/core/server/csp/',
'/src/core/',
],
},
noApproval: {
team: 'kibana-platform',
files: [],
},
},
]; |
Yeah, it has the same problem we discussed about the explosion of combinations it creates if we add any responsibilities to the config file... What's wrong with the format we decided on in the meeting? |
It seems almost identical to me. No? |
CI Check must ensure all paths have a code-coverage team assigned. |
Remove de-duplication from the source of truth. |
@tylersmalley this issue details what we are attempting in #74691 |
Canonical Code Coverage Teams and CODEOWNERS Assignment
WIP - Dumping ground for ideas (stolen from Brian S) :)
Goals
High Level
Impl Details
How it works now
Currently, the coverage ingestion process uploads an "inlined" version of the team assignment painless script, via the ES Client.
The text was updated successfully, but these errors were encountered: