Skip to content

Commit

Permalink
fix: Check if WriteCommitData is enabled before writing skip causes (#…
Browse files Browse the repository at this point in the history
…1897)

Fixes #1895

Ref: SRX-ORIWUQ
  • Loading branch information
ahmed-nour-fdc authored Aug 20, 2024
1 parent 91a826e commit a234984
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion services/cd-service/pkg/repository/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3747,14 +3747,16 @@ func (c *envReleaseTrain) Transform(
return "", prognosis.Error
}
if prognosis.SkipCause != nil {
if !c.WriteCommitData {
return renderEnvironmentSkipCause(prognosis.SkipCause), nil
}
for appName := range prognosis.AppsPrognoses {
release, err := state.GetLastRelease(ctx, transaction, state.Filesystem, appName)
if err != nil {
return "", fmt.Errorf("error getting latest release for app '%s' - %v", appName, err)
}
releaseDir := releasesDirectoryWithVersion(state.Filesystem, appName, release)
newEvent := createLockPreventedDeploymentEvent(appName, c.Env, prognosis.FirstLockMessage, "environment")

if state.DBHandler.ShouldUseOtherTables() {
commitID, err := getCommitID(ctx, transaction, state, state.Filesystem, release, releaseDir, appName)
if err != nil {
Expand Down

0 comments on commit a234984

Please sign in to comment.