Skip to content

Commit

Permalink
Dedupe teams and owners
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneseymour committed Aug 6, 2020
1 parent 023aa21 commit 2859cf7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/kbn-dev-utils/src/code_owners/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ export const parseSourceOfTruth = (sourceOfTruth: []) => {
for (const path of pathPatterns as []) {
const existing = owners.get(path);

const ownersSet = new Set(existing ? [...existing.owners, handle] : [handle]);
const teamsSet = new Set(existing ? [...existing.teams, team] : [team]);

owners.set(path, {
owners: existing ? [...existing.owners, handle] : [handle],
teams: existing ? [...existing.teams, team] : [team],
owners: [...ownersSet],
teams: [...teamsSet],
});
}
}
Expand Down

0 comments on commit 2859cf7

Please sign in to comment.