Skip to content

[first-time] Check for existing runs when a workspace is locked#122

Open
chrisnellis wants to merge 2 commits intohashicorp:mainfrom
chrisnellis:feature/issue-121
Open

[first-time] Check for existing runs when a workspace is locked#122
chrisnellis wants to merge 2 commits intohashicorp:mainfrom
chrisnellis:feature/issue-121

Conversation

@chrisnellis
Copy link

Description

As multiple integrations attempt to trigger runs on a workspace, it can happen that one integration triggers a run on a workspace while it is locked and applying an existing run.

In the current logic, when a new run is attempted as the workspace has an existing run, it fails out with an error stating that the workspace is locked.

In desired behavior, if a workspace is locked due to an existing/pending run, it should queue the the run.

Testing plan

  1. Initiate a run on a workspace
  2. Trigger a new run while the workspace is planning or applying
  3. If the newly triggered run triggers instead of errors, consider success

External links

Fixes #121

@chrisnellis chrisnellis requested a review from a team as a code owner July 29, 2024 14:07
@chrisnellis chrisnellis requested a review from lilincmu July 29, 2024 14:07
@hashicorp-cla-app
Copy link

hashicorp-cla-app bot commented Jul 29, 2024

CLA assistant check
All committers have signed the CLA.

@chrisnellis chrisnellis changed the title [first-time] Check for existing runs when a worspace is locked [first-time] Check for existing runs when a workspace is locked Jul 29, 2024
@mjyocca mjyocca self-requested a review July 30, 2024 20:36
Copy link
Contributor

@mjyocca mjyocca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologize for the delay in reviewing your contribution.

I'm not sure that adding this check in this if block will prevent the validation from executing.

The original intention of this validation is to prevent CI workflows from continuously polling a run that will never run in a reasonable time or that the workspace was intentionally locked.

We could consider altering this behavior but would like to know a little more about your specific use case.

@lilincmu lilincmu removed their request for review October 7, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Queuing a Run when Workspace is Running

2 participants