Skip to content

Commit

Permalink
Merge pull request #27 from leanix/feature/CID-3018/Modify-repositori…
Browse files Browse the repository at this point in the history
…es-full-scan-to-not-send-manifest-content

CID-3018: Modify repositories full scan to no send manifest content
  • Loading branch information
mohamedlajmileanix authored Oct 2, 2024
2 parents b6b41b6 + 44473df commit 4b170e0
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ data class RepositoryDto(
val updatedAt: String,
val languages: List<String>,
val topics: List<String>,
val manifestFileContent: String?,
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import net.leanix.githubagent.dto.RepositoryDto
import net.leanix.githubagent.exceptions.GraphQLApiException
import net.leanix.githubagent.graphql.data.GetRepositories
import net.leanix.githubagent.graphql.data.GetRepositoryManifestContent
import net.leanix.githubagent.graphql.data.getrepositories.Blob
import net.leanix.githubagent.shared.ManifestFileName
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Component
Expand Down Expand Up @@ -62,13 +61,6 @@ class GitHubGraphQLService(
updatedAt = it.updatedAt,
languages = it.languages!!.nodes!!.map { language -> language!!.name },
topics = it.repositoryTopics.nodes!!.map { topic -> topic!!.topic.name },
manifestFileContent = if (it.manifestYaml != null) {
(it.manifestYaml as Blob).text.toString()
} else if (it.manifestYml != null) {
(it.manifestYml as Blob).text.toString()
} else {
null
}
)
}
)
Expand Down
16 changes: 2 additions & 14 deletions src/main/resources/graphql/GetRepositories.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,18 @@ query GetRepositories($pageCount: Int!, $cursor: String, $manifestYamlPath: Stri
owner{
login
}
languages(first: 10) {
languages(first: 25) {
nodes {
name
}
}
repositoryTopics(first:10) {
repositoryTopics(first:25) {
nodes {
topic {
name
}
}
}
manifestYaml: object(expression: $manifestYamlPath) {
__typename
... on Blob {
text
}
}
manifestYml: object(expression: $manifestYmlPath) {
__typename
... on Blob {
text
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class GitHubScanningServiceTest {
updatedAt = "2024-01-01T00:00:00Z",
languages = listOf("Kotlin", "Java"),
topics = listOf("test", "example"),
manifestFileContent = "content"
)
),
hasNextPage = false,
Expand Down

0 comments on commit 4b170e0

Please sign in to comment.