Skip to content

Commit

Permalink
chore(fdr): update git datamodel to reflect github api
Browse files Browse the repository at this point in the history
  • Loading branch information
armandobelardo committed Sep 17, 2024
1 parent 2f616f7 commit bc1504f
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions fern/apis/fdr/definition/git.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ types:

GithubUser:
properties:
name: string
email: string
name: optional<string>
email: optional<string>
username: string

GithubTeam:
Expand All @@ -95,7 +95,7 @@ types:
pullRequestNumber: integer
repositoryName: string
repositoryOwner: string
author: GithubUser
author: optional<GithubUser>
reviewers: list<PullRequestReviewer>
title: string
url: string
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "PullRequest" ALTER COLUMN "author" DROP NOT NULL;
2 changes: 1 addition & 1 deletion servers/fdr/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ model PullRequest {
repositoryName String
repository Repository @relation(fields: [repositoryOwner, repositoryName], references: [owner, name], onDelete: Cascade)
author Bytes
author Bytes?
reviewers Bytes
checks Bytes
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion servers/fdr/src/db/git/GitDao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ function convertPrismaPullRequest(maybePR: prisma.PullRequest | null): PullReque
pullRequestNumber: maybePR.pullRequestNumber,
repositoryName: maybePR.repositoryName,
repositoryOwner: maybePR.repositoryOwner,
author: readBuffer(maybePR.author) as GithubUser,
author: maybePR.author != null ? (readBuffer(maybePR.author) as GithubUser) : undefined,
reviewers: readBuffer(maybePR.reviewers) as PullRequestReviewer[],
checks: readBuffer(maybePR.checks) as CheckRun[],
title: maybePR.title,
Expand Down

0 comments on commit bc1504f

Please sign in to comment.