This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch fix-github-fields
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/fix-github-fields by this push:
new 91bf2bd3a fix: github some fields
91bf2bd3a is described below
commit 91bf2bd3aadafb03e6a7688c101dd657ae6177a3
Author: abeizn <[email protected]>
AuthorDate: Fri Oct 27 11:51:31 2023 +0800
fix: github some fields
---
backend/plugins/github_graphql/tasks/deployment_convertor.go | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/backend/plugins/github_graphql/tasks/deployment_convertor.go
b/backend/plugins/github_graphql/tasks/deployment_convertor.go
index 118f20ce8..60479dc90 100644
--- a/backend/plugins/github_graphql/tasks/deployment_convertor.go
+++ b/backend/plugins/github_graphql/tasks/deployment_convertor.go
@@ -53,7 +53,8 @@ func ConvertDeployment(taskCtx plugin.SubTaskContext)
errors.Error {
}
defer cursor.Close()
- jobBuildIdGen :=
didgen.NewDomainIdGenerator(&githubModels.GithubDeployment{})
+ deploymentIdGen :=
didgen.NewDomainIdGenerator(&githubModels.GithubDeployment{})
+ deploymentScopeIdGen :=
didgen.NewDomainIdGenerator(&githubModels.GithubRepo{})
converter, err := api.NewDataConverter(api.DataConverterArgs{
InputRowType:
reflect.TypeOf(githubModels.GithubDeployment{}),
@@ -63,10 +64,10 @@ func ConvertDeployment(taskCtx plugin.SubTaskContext)
errors.Error {
githubDeployment :=
inputRow.(*githubModels.GithubDeployment)
deploymentCommit := &devops.CicdDeploymentCommit{
DomainEntity: domainlayer.DomainEntity{
- Id:
jobBuildIdGen.Generate(githubDeployment.ConnectionId, githubDeployment.Id),
+ Id:
deploymentIdGen.Generate(githubDeployment.ConnectionId, githubDeployment.Id),
},
- CicdScopeId: fmt.Sprintf("%d:%d",
githubDeployment.ConnectionId, githubDeployment.GithubId),
- Name: fmt.Sprintf("%s:%d",
githubDeployment.RepositoryName, githubDeployment.DatabaseId), // fixme where
does the deploy name field exist?
+ CicdScopeId:
deploymentScopeIdGen.Generate(githubDeployment.ConnectionId,
githubDeployment.GithubId),
+ Name: githubDeployment.CommitOid,
Result: devops.GetResult(&devops.ResultRule{
Success: []string{"SUCCESS"},
Failed: []string{"ERROR", "FAILURE"},
@@ -88,7 +89,7 @@ func ConvertDeployment(taskCtx plugin.SubTaskContext)
errors.Error {
FinishedDate: &githubDeployment.UpdatedDate, //
fixme there is no such field
CommitSha: githubDeployment.CommitOid,
RefName: githubDeployment.RefName,
- RepoId: githubDeployment.RepositoryID,
+ RepoId: fmt.Sprintf("%d",
githubDeployment.GithubId),
RepoUrl: githubDeployment.RepositoryUrl,
}