You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ly...@apache.org on 2023/12/08 08:55:04 UTC

(incubator-devlake) branch main updated: feat: cicd_pipeline_commits add commit msg (#6607)

This is an automated email from the ASF dual-hosted git repository.

lynwee pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 0296425c2 feat: cicd_pipeline_commits add commit msg (#6607)
0296425c2 is described below

commit 0296425c2b7ee7444bac2ab1f2c985b8b39fb6bc
Author: abeizn <zi...@merico.dev>
AuthorDate: Fri Dec 8 16:55:00 2023 +0800

    feat: cicd_pipeline_commits add commit msg (#6607)
    
    * feat: cicd_pipeline_commits add commit msg
    
    * fix: rename cicd_deployment_commits name
---
 .../domainlayer/devops/cicd_pipeline_commmit.go    |  1 +
 ...27_add_commit_msg_to_cicd_deployment_commits.go | 12 ++++++------
 ...208_add_commit_msg_to_cicd_pipeline_commits.go} | 22 +++++++++++-----------
 backend/core/models/migrationscripts/register.go   |  3 ++-
 4 files changed, 20 insertions(+), 18 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..7de776528 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 {
-	return "add commit_msg to cicd_deployment_commit table"
+func (*addCommitMsgtoDeploymentCommit) Name() string {
+	return "add commit_msg to cicd_deployment_commits 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),
 	}
 }