This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch feat#6521
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/feat#6521 by this push:
new 53988e045 feat: cicd_pipeline_commits add commit msg
53988e045 is described below
commit 53988e0457c6e38632e4f96bc680a42c7c487b23
Author: abeizn <[email protected]>
AuthorDate: Fri Dec 8 16:20:32 2023 +0800
feat: cicd_pipeline_commits add commit msg
---
.../domainlayer/devops/cicd_pipeline_commmit.go | 1 +
...27_add_commit_msg_to_cicd_deployment_commits.go | 10 +++++-----
...208_add_commit_msg_to_cicd_pipeline_commits.go} | 22 +++++++++++-----------
backend/core/models/migrationscripts/register.go | 3 ++-
4 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/backend/core/models/domainlayer/devops/cicd_pipeline_commmit.go
b/backend/core/models/domainlayer/devops/cicd_pipeline_commmit.go
index 9818856f4..10e0dac57 100644
--- a/backend/core/models/domainlayer/devops/cicd_pipeline_commmit.go
+++ b/backend/core/models/domainlayer/devops/cicd_pipeline_commmit.go
@@ -25,6 +25,7 @@ type CiCDPipelineCommit struct {
common.NoPKModel
PipelineId string `gorm:"primaryKey;type:varchar(255)"`
CommitSha string `gorm:"primaryKey;type:varchar(255)"`
+ CommitMsg string
Branch string `gorm:"type:varchar(255)"`
RepoId string `gorm:"index;type:varchar(255)"`
RepoUrl string
diff --git
a/backend/core/models/migrationscripts/20231127_add_commit_msg_to_cicd_deployment_commits.go
b/backend/core/models/migrationscripts/20231127_add_commit_msg_to_cicd_deployment_commits.go
index 087ec8a9d..7b3fbc380 100644
---
a/backend/core/models/migrationscripts/20231127_add_commit_msg_to_cicd_deployment_commits.go
+++
b/backend/core/models/migrationscripts/20231127_add_commit_msg_to_cicd_deployment_commits.go
@@ -23,7 +23,7 @@ import (
"github.com/apache/incubator-devlake/core/plugin"
)
-var _ plugin.MigrationScript = (*addCommitMsg)(nil)
+var _ plugin.MigrationScript = (*addCommitMsgtoDeploymentCommit)(nil)
type cicdDeploymentCommit20231127 struct {
CommitMsg string
@@ -33,9 +33,9 @@ func (cicdDeploymentCommit20231127) TableName() string {
return "cicd_deployment_commits"
}
-type addCommitMsg struct{}
+type addCommitMsgtoDeploymentCommit struct{}
-func (u *addCommitMsg) Up(basicRes context.BasicRes) errors.Error {
+func (u *addCommitMsgtoDeploymentCommit) Up(basicRes context.BasicRes)
errors.Error {
db := basicRes.GetDal()
if err := db.AutoMigrate(&cicdDeploymentCommit20231127{}); err != nil {
return err
@@ -43,10 +43,10 @@ func (u *addCommitMsg) Up(basicRes context.BasicRes)
errors.Error {
return nil
}
-func (*addCommitMsg) Version() uint64 {
+func (*addCommitMsgtoDeploymentCommit) Version() uint64 {
return 20231127142100
}
-func (*addCommitMsg) Name() string {
+func (*addCommitMsgtoDeploymentCommit) Name() string {
return "add commit_msg to cicd_deployment_commit table"
}
diff --git
a/backend/core/models/migrationscripts/20231127_add_commit_msg_to_cicd_deployment_commits.go
b/backend/core/models/migrationscripts/20231208_add_commit_msg_to_cicd_pipeline_commits.go
similarity index 64%
copy from
backend/core/models/migrationscripts/20231127_add_commit_msg_to_cicd_deployment_commits.go
copy to
backend/core/models/migrationscripts/20231208_add_commit_msg_to_cicd_pipeline_commits.go
index 087ec8a9d..22261b485 100644
---
a/backend/core/models/migrationscripts/20231127_add_commit_msg_to_cicd_deployment_commits.go
+++
b/backend/core/models/migrationscripts/20231208_add_commit_msg_to_cicd_pipeline_commits.go
@@ -23,30 +23,30 @@ import (
"github.com/apache/incubator-devlake/core/plugin"
)
-var _ plugin.MigrationScript = (*addCommitMsg)(nil)
+var _ plugin.MigrationScript = (*addCommitMsgtoPipelineCommit)(nil)
-type cicdDeploymentCommit20231127 struct {
+type cicdPipelineCommit20231208 struct {
CommitMsg string
}
-func (cicdDeploymentCommit20231127) TableName() string {
- return "cicd_deployment_commits"
+func (cicdPipelineCommit20231208) TableName() string {
+ return "cicd_pipeline_commits"
}
-type addCommitMsg struct{}
+type addCommitMsgtoPipelineCommit struct{}
-func (u *addCommitMsg) Up(basicRes context.BasicRes) errors.Error {
+func (u *addCommitMsgtoPipelineCommit) Up(basicRes context.BasicRes)
errors.Error {
db := basicRes.GetDal()
- if err := db.AutoMigrate(&cicdDeploymentCommit20231127{}); err != nil {
+ if err := db.AutoMigrate(&cicdPipelineCommit20231208{}); err != nil {
return err
}
return nil
}
-func (*addCommitMsg) Version() uint64 {
- return 20231127142100
+func (*addCommitMsgtoPipelineCommit) Version() uint64 {
+ return 20231208142100
}
-func (*addCommitMsg) Name() string {
- return "add commit_msg to cicd_deployment_commit table"
+func (*addCommitMsgtoPipelineCommit) Name() string {
+ return "add commit_msg to cicd_pipeline_commits table"
}
diff --git a/backend/core/models/migrationscripts/register.go
b/backend/core/models/migrationscripts/register.go
index ce92add2b..31921d499 100644
--- a/backend/core/models/migrationscripts/register.go
+++ b/backend/core/models/migrationscripts/register.go
@@ -100,7 +100,8 @@ func All() []plugin.MigrationScript {
new(addSomeDateFieldsToDevopsTables),
new(addOriginalStatusAndResultToDevOpsTables),
new(addQueuedDurationSecFieldToDevopsTables),
- new(addCommitMsg),
+ new(addCommitMsgtoDeploymentCommit),
new(modifyIssueOriginalTypeLength),
+ new(addCommitMsgtoPipelineCommit),
}
}