Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert change on how release locks msg is created and fix infinite loop bug #12

Merged
merged 2 commits into from
Jan 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pkg/tfc_trigger/tfc_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,9 @@ func (t *TFCTrigger) TriggerTFCEvents() (*TriggeredTFCWorkspaces, error) {
}

} else if t.cfg.GetTriggerSource() == CommentTrigger {
return nil, t.handleError(ErrNoChangesDetected, "")
log.Error().Err(ErrNoChangesDetected)
t.postUpdate(ErrNoChangesDetected.Error())
return nil, nil

} else {
log.Debug().Msg("No Terraform changes found in changeset.")
Expand Down Expand Up @@ -416,9 +418,8 @@ func (t *TFCTrigger) TriggerCleanupEvent() error {
t.handleError(err, "Error removing locking tag from workspace")
continue
}
wsNames = append(wsNames, cfgWS.Name)
}
// record workspace even if there are not tags since we could have cleared them earlier (same event can be called multiple times)
wsNames = append(wsNames, cfgWS.Name)
}
_, err = t.gl.CreateMergeRequestDiscussion(mr.GetInternalID(),
t.cfg.GetProjectNameWithNamespace(),
Expand Down