From 1890c10f36a6ad567d24f23e2ffa76da346f5a58 Mon Sep 17 00:00:00 2001 From: Dave Winiarski Date: Fri, 6 Jan 2023 12:39:28 -0700 Subject: [PATCH 1/2] revert change on how release locks msg is created Signed-off-by: Dave Winiarski --- pkg/tfc_trigger/tfc_trigger.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/tfc_trigger/tfc_trigger.go b/pkg/tfc_trigger/tfc_trigger.go index 0c5baf1..2fed192 100644 --- a/pkg/tfc_trigger/tfc_trigger.go +++ b/pkg/tfc_trigger/tfc_trigger.go @@ -416,9 +416,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(), From 2dd1d1d9e2a2de55f26acbcad9e389eae0586dc0 Mon Sep 17 00:00:00 2001 From: davidwin93 Date: Mon, 9 Jan 2023 12:22:15 -0700 Subject: [PATCH 2/2] do not return an error when there's no changes in a dir Signed-off-by: davidwin93 --- pkg/tfc_trigger/tfc_trigger.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/tfc_trigger/tfc_trigger.go b/pkg/tfc_trigger/tfc_trigger.go index 2fed192..a4da8b6 100644 --- a/pkg/tfc_trigger/tfc_trigger.go +++ b/pkg/tfc_trigger/tfc_trigger.go @@ -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.")