Skip to content

Commit

Permalink
CID-3144 Persist default branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
geoandri committed Nov 8, 2024
1 parent 9bdc047 commit cd0a739
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ data class RepositoryDto(
val organizationName: String,
val description: String?,
val url: String,
val defaultBranch: String?,
val archived: Boolean,
val visibility: RepositoryVisibility,
val updatedAt: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class GitHubGraphQLService(
organizationName = it.owner.login,
description = it.description,
url = it.url,
defaultBranch = it.defaultBranchRef?.name,
archived = it.isArchived,
visibility = it.visibility,
updatedAt = it.updatedAt,
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/graphql/GetRepositories.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ query GetRepositories($pageCount: Int!, $cursor: String) {
name
description
url
defaultBranchRef{
name
}
isArchived
visibility
updatedAt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class GitHubScanningServiceTest {
organizationName = "testOrg",
description = "A test repository",
url = "https://github.com/testRepo",
defaultBranch = "main",
archived = false,
visibility = RepositoryVisibility.PUBLIC,
updatedAt = "2024-01-01T00:00:00Z",
Expand Down Expand Up @@ -130,6 +131,7 @@ class GitHubScanningServiceTest {
organizationName = "testOrg",
description = "A test repository",
url = "https://github.com/testRepo",
defaultBranch = "main",
archived = false,
visibility = RepositoryVisibility.PUBLIC,
updatedAt = "2024-01-01T00:00:00Z",
Expand Down Expand Up @@ -180,6 +182,7 @@ class GitHubScanningServiceTest {
organizationName = "testOrg",
description = "A test repository",
url = "https://github.com/testRepo",
defaultBranch = "main",
archived = false,
visibility = RepositoryVisibility.PUBLIC,
updatedAt = "2024-01-01T00:00:00Z",
Expand Down

0 comments on commit cd0a739

Please sign in to comment.