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

FAILED_DEPLOY jobs cause infinite polling on app deployment #1047

Closed
davidsbond opened this issue Oct 10, 2023 · 1 comment · Fixed by #1048
Closed

FAILED_DEPLOY jobs cause infinite polling on app deployment #1047

davidsbond opened this issue Oct 10, 2023 · 1 comment · Fixed by #1048
Labels

Comments

@davidsbond
Copy link
Contributor

davidsbond commented Oct 10, 2023

Bug Report


Describe the bug

I have an app on app platform that consists of some jobs and a service which I deploy with terraform. I recently added a job with kind "FAILED_DEPLOY" which is intended to run after my service has failed deployment.

Since adding this, I've noticed that apply runs fr the digitalocean_app resource will hit the 30 minute timeout. I had a quick browse of the code for that resource and suspect that the polling does not take into account that in a successful deploy, the FAILED_DEPLOY step should never be ran. I think that it is waiting to see that step as complete when it never is. Here is the part of the code I'm referring to.

Affected Resource(s)

  • digitalocean_app

Expected Behavior

My deployment should succeed

Actual Behavior

The deployment succeeds in the digital ocean user interface, but the terraform apply hits the timeout.

Steps to Reproduce

Terraform version
v1.5.7

Debug Output

Panic Output

Additional context

Important Factoids

References

@davidsbond
Copy link
Contributor Author

I've raised a pull request that I think should resolve this issue, not sure the best way for me to test this though, so happy for some input!

andrewsomething added a commit that referenced this issue Oct 12, 2023
* Rework deployment logic

This commit modifies the logic used by the `digitalocean_app` resource to check each step for a success
status rather than using the counts of steps. The step counting method fails to work with jobs of kind
`FAILED_DEPLOY` as these will always be pending, meaning that any app deployed with a job of this type
will always time out even when it is successful.

Closes #1047

Signed-off-by: David Bond <[email protected]>

* Add FAILED_DEPLOY job to acceptance tests.

* Run terrafmt on new test case.

---------

Signed-off-by: David Bond <[email protected]>
Co-authored-by: Andrew Starr-Bochicchio <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant