fix: clear stale workspace lock tags and improve lock error messages (CLOUD-933)#55
Closed
fix: clear stale workspace lock tags and improve lock error messages (CLOUD-933)#55
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…OUD-933) Add releaseWorkspaceLockTag method to RunStatusUpdater that removes the tfbuddylock-<MR_IID> tag from the TFC workspace when an apply run reaches a terminal state (applied, errored, canceled, discarded), preventing stale tags from blocking future applies while the MR stays open. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GetRun always includes tfe.RunWorkspace, so run.Workspace is guaranteed to be populated at this call site. The nil guard created false confidence without protecting the actual risk point. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TFLockTagPrefixfromtfc_triggerso other packages can reference the tag name without duplicationapplied,errored,canceled,discarded),releaseWorkspaceLockTagremoves thetfbuddylock-<MR_IID>workspace tag, preventing it from blocking future applies while the MR stays openTest Plan
go test ./pkg/tfc_trigger/...— 3 new tests covering TFC-lock + tag, TFC-lock + no tag, and tag-only lock scenariosgo test ./pkg/vcs/gitlab/...— 3 new tests: tag removed onRunApplied, tag removed onRunErrored, tag not removed for plan actiontfbuddylock-<IID>tag is gone from the TFC workspaceFixes CLOUD-933
🤖 Generated with Claude Code