Skip to content

Commit a1f79f1

Browse files
committed
default flag true & avoid already commited log
1 parent 2a3a987 commit a1f79f1

File tree

6 files changed

+8
-5
lines changed

6 files changed

+8
-5
lines changed

env_gen.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

env_gen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
| DEFAULT_TARGET_PLATFORM | string | | | | false |
7777
| DOCKER_BUILD_CACHE_PATH | string |/var/lib/docker | | | false |
7878
| ENABLE_BUILD_CONTEXT | bool |false | | | false |
79-
| ENABLE_WORKFLOW_EXECUTION_STAGE | bool |false | if enabled then we will display build stages separately for CI/Job/Pre-Post CD | false | false |
79+
| ENABLE_WORKFLOW_EXECUTION_STAGE | bool |true | if enabled then we will display build stages separately for CI/Job/Pre-Post CD | true | false |
8080
| EXTERNAL_BLOB_STORAGE_CM_NAME | string |blob-storage-cm | | | false |
8181
| EXTERNAL_BLOB_STORAGE_SECRET_NAME | string |blob-storage-secret | | | false |
8282
| EXTERNAL_CD_NODE_LABEL_SELECTOR | | | | | false |

pkg/pipeline/CiService.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import (
4040
"github.com/devtron-labs/devtron/pkg/pipeline/workflowStatus"
4141
bean2 "github.com/devtron-labs/devtron/pkg/plugin/bean"
4242
"github.com/devtron-labs/devtron/pkg/sql"
43+
util3 "github.com/devtron-labs/devtron/util"
4344
"github.com/devtron-labs/devtron/util/sliceUtil"
4445
"path"
4546
"path/filepath"
@@ -1183,7 +1184,7 @@ func (impl *CiServiceImpl) UpdateCiWorkflowWithStage(wf *pipelineConfig.CiWorkfl
11831184

11841185
defer func() {
11851186
dbErr := impl.transactionManager.RollbackTx(tx)
1186-
if dbErr != nil {
1187+
if dbErr != nil && dbErr.Error() != util3.SqlAlreadyCommitedErrMsg {
11871188
impl.Logger.Errorw("error in rolling back transaction", "workflowName", wf.Name, "error", dbErr)
11881189
}
11891190
}()

pkg/pipeline/types/CiCdConfig.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ type CiCdConfig struct {
160160
UseArtifactListingQueryV2 bool `env:"USE_ARTIFACT_LISTING_QUERY_V2" envDefault:"true"`
161161
UseImageTagFromGitProviderForTagBasedBuild bool `env:"USE_IMAGE_TAG_FROM_GIT_PROVIDER_FOR_TAG_BASED_BUILD" envDefault:"false"` // this is being done for https://github.com/devtron-labs/devtron/issues/4263
162162
UseDockerApiToGetDigest bool `env:"USE_DOCKER_API_TO_GET_DIGEST" envDefault:"false"`
163-
EnableWorkflowExecutionStage bool `env:"ENABLE_WORKFLOW_EXECUTION_STAGE" envDefault:"false" description:"if enabled then we will display build stages separately for CI/Job/Pre-Post CD" example:"false"`
163+
EnableWorkflowExecutionStage bool `env:"ENABLE_WORKFLOW_EXECUTION_STAGE" envDefault:"true" description:"if enabled then we will display build stages separately for CI/Job/Pre-Post CD" example:"true"`
164164
}
165165

166166
type CiConfig struct {

pkg/workflow/cd/CdWorkflowRunnerService.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/devtron-labs/devtron/pkg/sql"
2929
"github.com/devtron-labs/devtron/pkg/workflow/cd/adapter"
3030
"github.com/devtron-labs/devtron/pkg/workflow/cd/bean"
31+
"github.com/devtron-labs/devtron/util"
3132
"go.uber.org/zap"
3233
)
3334

@@ -95,7 +96,7 @@ func (impl *CdWorkflowRunnerServiceImpl) SaveCDWorkflowRunnerWithStage(wfr *pipe
9596

9697
defer func() {
9798
dbErr := impl.transactionManager.RollbackTx(tx)
98-
if dbErr != nil {
99+
if dbErr != nil && dbErr.Error() != util.SqlAlreadyCommitedErrMsg {
99100
impl.logger.Errorw("error in rolling back transaction", "workflowName", wfr.Name, "error", dbErr)
100101
}
101102
}()

util/CommonConstant.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ const (
3030
ConfigMapSecretUsageTypeVolume string = "volume"
3131
YamlSeparator string = "---\n"
3232
NotSupportedErr = "This feature is not supported"
33+
SqlAlreadyCommitedErrMsg = "sql: transaction has already been committed or rolled back"
3334
)

0 commit comments

Comments
 (0)