This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch fix-cicd-deployment-no-data
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/fix-cicd-deployment-no-data by
this push:
new ffdd0e2b7 fix: some plugins get CicdDeploymentId
ffdd0e2b7 is described below
commit ffdd0e2b7fdd52764087ebe53fe025012934234c
Author: abeizn <[email protected]>
AuthorDate: Thu Oct 26 15:20:44 2023 +0800
fix: some plugins get CicdDeploymentId
---
backend/core/models/domainlayer/devops/cicd_deployment_commit.go | 2 +-
backend/plugins/bitbucket/tasks/deployment_convertor.go | 1 +
backend/plugins/github_graphql/tasks/deployment_convertor.go | 4 +++-
backend/plugins/gitlab/tasks/deployment_convertor.go | 4 +++-
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/backend/core/models/domainlayer/devops/cicd_deployment_commit.go
b/backend/core/models/domainlayer/devops/cicd_deployment_commit.go
index a04896e59..e32001f3f 100644
--- a/backend/core/models/domainlayer/devops/cicd_deployment_commit.go
+++ b/backend/core/models/domainlayer/devops/cicd_deployment_commit.go
@@ -49,7 +49,7 @@ func (cicdDeploymentCommit CicdDeploymentCommit) TableName()
string {
func (cicdDeploymentCommit CicdDeploymentCommit) ToDeployment()
*CICDDeployment {
return &CICDDeployment{
DomainEntity: domainlayer.DomainEntity{
- Id: cicdDeploymentCommit.Id,
+ Id: cicdDeploymentCommit.CicdDeploymentId,
NoPKModel: cicdDeploymentCommit.DomainEntity.NoPKModel,
},
CicdScopeId: cicdDeploymentCommit.CicdScopeId,
diff --git a/backend/plugins/bitbucket/tasks/deployment_convertor.go
b/backend/plugins/bitbucket/tasks/deployment_convertor.go
index 6cfdcee11..fab9dd479 100644
--- a/backend/plugins/bitbucket/tasks/deployment_convertor.go
+++ b/backend/plugins/bitbucket/tasks/deployment_convertor.go
@@ -114,6 +114,7 @@ func ConvertDeployments(taskCtx plugin.SubTaskContext)
errors.Error {
// So convert it to devlake's definition.
domainDeployCommit.Environment = devops.TESTING
}
+ domainDeployCommit.CicdDeploymentId =
domainDeployCommit.Id
return []interface{}{domainDeployCommit,
domainDeployCommit.ToDeployment()}, nil
},
})
diff --git a/backend/plugins/github_graphql/tasks/deployment_convertor.go
b/backend/plugins/github_graphql/tasks/deployment_convertor.go
index 68be29d71..fbfd33277 100644
--- a/backend/plugins/github_graphql/tasks/deployment_convertor.go
+++ b/backend/plugins/github_graphql/tasks/deployment_convertor.go
@@ -19,6 +19,8 @@ package tasks
import (
"fmt"
+ "reflect"
+
"github.com/apache/incubator-devlake/core/dal"
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/models/domainlayer"
@@ -27,7 +29,6 @@ import (
"github.com/apache/incubator-devlake/core/plugin"
"github.com/apache/incubator-devlake/helpers/pluginhelper/api"
githubModels "github.com/apache/incubator-devlake/plugins/github/models"
- "reflect"
)
var _ plugin.SubTaskEntryPoint = ConvertDeployment
@@ -98,6 +99,7 @@ func ConvertDeployment(taskCtx plugin.SubTaskContext)
errors.Error {
deploymentCommit.Environment =
data.RegexEnricher.ReturnNameIfMatched(devops.PRODUCTION,
githubDeployment.Environment)
}
+ deploymentCommit.CicdDeploymentId = deploymentCommit.Id
return []interface{}{
deploymentCommit,
deploymentCommit.ToDeployment(),
diff --git a/backend/plugins/gitlab/tasks/deployment_convertor.go
b/backend/plugins/gitlab/tasks/deployment_convertor.go
index e2348a98e..5777725f4 100644
--- a/backend/plugins/gitlab/tasks/deployment_convertor.go
+++ b/backend/plugins/gitlab/tasks/deployment_convertor.go
@@ -19,6 +19,8 @@ package tasks
import (
"fmt"
+ "reflect"
+
"github.com/apache/incubator-devlake/core/dal"
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/models/domainlayer"
@@ -28,7 +30,6 @@ import (
"github.com/apache/incubator-devlake/helpers/pluginhelper/api"
"github.com/apache/incubator-devlake/plugins/gitlab/models"
"github.com/spf13/cast"
- "reflect"
)
var _ plugin.SubTaskEntryPoint = ConvertDeployment
@@ -123,6 +124,7 @@ func ConvertDeployment(taskCtx plugin.SubTaskContext)
errors.Error {
domainDeployCommit.Environment =
data.RegexEnricher.ReturnNameIfOmittedOrMatched(devops.PRODUCTION,
gitlabDeployment.Environment)
}
+ domainDeployCommit.CicdDeploymentId =
domainDeployCommit.Id
return []interface{}{
domainDeployCommit,
domainDeployCommit.ToDeployment(),