Skip to content

Commit

Permalink
Fix TypeScript errors arising from generating new Prisma client
Browse files Browse the repository at this point in the history
Co-authored-by: Natasha <[email protected]>
Co-authored-by: Akash Askoolum <[email protected]>
Co-authored-by: TJ Silver <[email protected]>
  • Loading branch information
4 people committed Mar 4, 2024
1 parent fdb211a commit f9c9b73
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import type { Team } from '../../types';
import { createBranchProtectionEvents } from './branch-protection';

const nullOwner: view_repo_ownership = {
full_name: '',
full_repo_name: '',
github_team_id: BigInt(0),
github_team_name: '',
repo_name: '',
github_team_slug: '',
short_repo_name: '',
role_name: '',
archived: false,
galaxies_team: null,
Expand Down Expand Up @@ -40,9 +41,10 @@ describe('Team slugs should be findable for every team associated with a repo',

const teamOneOwner: view_repo_ownership = {
...nullOwner,
full_name: repo,
full_repo_name: repo,
github_team_id: BigInt(1),
github_team_name: 'Team One',
github_team_slug: teamOne.slug,
};

const actual = createBranchProtectionEvents(
Expand Down
2 changes: 1 addition & 1 deletion packages/repocop/src/remediation/shared-utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function findContactableOwners(
allRepoOwners: view_repo_ownership[],
teams: Team[],
): string[] {
const owners = allRepoOwners.filter((owner) => owner.full_name === repo);
const owners = allRepoOwners.filter((owner) => owner.full_repo_name === repo);
const teamSlugs = owners
.map((owner) => findTeamSlugFromId(owner.github_team_id, teams))
.filter((slug): slug is string => !!slug);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ const date = new Date('2021-01-01');
const ownershipRecord: view_repo_ownership = {
github_team_name: teamName,
github_team_id: teamId,
repo_name: removeRepoOwner(fullName),
full_name: fullName,
github_team_slug: teamSlug,
short_repo_name: removeRepoOwner(fullName),
full_repo_name: fullName,
role_name: '',
archived: false,
galaxies_team: null,
Expand All @@ -52,7 +53,7 @@ const anotherOwnershipRecord: view_repo_ownership = {
...ownershipRecord,
github_team_name: anotherTeam.name,
github_team_id: anotherTeam.id,
full_name: anotherFullName,
full_repo_name: anotherFullName,
};

const anotherRepocopRuleEvaluation: repocop_github_repository_rules = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function getOwningRepos(

const resultsOwnedByTeam = reposOwnedByTeam
.map((repo) => {
return results.find((result) => result.fullName === repo.full_name);
return results.find((result) => result.fullName === repo.full_repo_name);
})
.filter((result): result is EvaluationResult => result !== undefined);

Expand Down

0 comments on commit f9c9b73

Please sign in to comment.