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

fix: skip confirming on auto-apply enabled tfc workspaces #2397

Merged
merged 1 commit into from Dec 6, 2022

Conversation

michaellzc
Copy link
Contributor

@michaellzc michaellzc commented Dec 5, 2022

related issues & pr:

While #1955 is currently being worked on, this is the workaround for various causes of the issue described in #2232

Context

When a workspace has auto-apply enabled, cdktf deploy will error out with the following error message at the confirm stage. This PR added a check on run and skip confirming the plan if auto-apply is enabled.

default - Error in Deploy: {"message":"Request failed with status code 409","name":"Error","stack":"Error: Request failed with status code 409\n    at WGe.exports (/home/runner/work/cloud/cloud/terraform-cdk/packages/cdktf-cli/bundle/bin/cmds/handlers.js:199:4283)\n    at GGe.exports (/home/runner/work/cloud/cloud/terraform-cdk/packages/cdktf-cli/bundle/bin/cmds/handlers.js:199:4461)\n    at IncomingMessage.<anonymous> (/home/runner/work/cloud/cloud/terraform-cdk/packages/cdktf-cli/bundle/bin/cmds/handlers.js:200:8212)\n    at IncomingMessage.emit (node:events:525:35)\n    at IncomingMessage.emit (node:domain:489:12)\n    at endReadableNT (node:internal/streams/readable:1358:12)\n    at processTicksAndRejections (node:internal/process/task_queues:83:21)","config":{"url":"/runs/run-<redacted>/actions/apply","method":"post","data":"{}","headers":{"Authorization":"REDACTED","Accept":"application/json","Content-Type":"application/vnd.api+json","User-Agent":"terraform-cloud/1.15.0","Content-Length":2},"baseURL":"https://app.terraform.io/api/v2","transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false}}}
Deploy: Request to Terraform Cloud failed with status 409: {"status":"409","title":"transition not allowed"}

Testing

This is tested internally across our TFC workspaces with and without auto-apply enabled. I can confirm no more 409 error from TFC and all stacks are deployed in one go.

@michaellzc michaellzc requested a review from a team as a code owner December 5, 2022 20:23
@michaellzc michaellzc requested review from DanielMSchmidt and Maed223 and removed request for a team December 5, 2022 20:23
@michaellzc michaellzc changed the title Skip confirming on auto-apply enabled workspaces fix: skip confirming on auto-apply enabled workspaces Dec 5, 2022
@michaellzc michaellzc changed the title fix: skip confirming on auto-apply enabled workspaces fix: skip confirming on auto-apply enabled tfc workspaces Dec 5, 2022
Copy link
Member

@ansgarm ansgarm left a comment

Choose a reason for hiding this comment

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

Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2023

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants