Skip to content

feat: Add destroy to workspace provision job #373

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

Merged
merged 17 commits into from
Feb 28, 2022
Merged

feat: Add destroy to workspace provision job #373

merged 17 commits into from
Feb 28, 2022

Conversation

kylecarbs
Copy link
Member

This enables the full flow of create/update/delete.

This was detecting branches, but not our "main" branch before.
Hopefully this fixes it!
This enables a consistent API for project import and provisioned resources.
This is a much cleaner abstraction. Explicitly declaring the user
parameters for each provisioner makes for significantly simpler
testing.
Terraform (or other provisioners) may need to cleanup state, or
cancel actions before exit. This adds the ability to gracefully
exit provisionerd.
This enables the full flow of create/update/delete.
@kylecarbs kylecarbs self-assigned this Feb 28, 2022
@codecov
Copy link

codecov bot commented Feb 28, 2022

Codecov Report

Merging #373 (2a9772f) into main (9d2803e) will increase coverage by 0.46%.
The diff coverage is 28.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #373      +/-   ##
==========================================
+ Coverage   67.24%   67.70%   +0.46%     
==========================================
  Files         148      150       +2     
  Lines        8271     8454     +183     
  Branches       72       72              
==========================================
+ Hits         5562     5724     +162     
- Misses       2132     2150      +18     
- Partials      577      580       +3     
Flag Coverage Δ
unittest-go-macos-latest 66.17% <0.00%> (?)
unittest-go-ubuntu-latest 67.31% <28.57%> (-0.05%) ⬇️
unittest-go-windows-2022 65.43% <0.00%> (?)
unittest-js 66.10% <ø> (ø)
Impacted Files Coverage Δ
coderd/provisionerdaemons.go 57.29% <0.00%> (+0.86%) ⬆️
provisioner/terraform/provision.go 73.50% <40.00%> (-0.58%) ⬇️
pty/start_windows.go 51.30% <0.00%> (ø)
pty/pty_windows.go 60.31% <0.00%> (ø)
provisionerd/provisionerd.go 68.93% <0.00%> (+0.91%) ⬆️
peerbroker/proxy.go 57.23% <0.00%> (+1.25%) ⬆️
coderd/provisionerjobs.go 59.23% <0.00%> (+1.63%) ⬆️
coderd/workspacehistory.go 65.73% <0.00%> (+2.24%) ⬆️
peer/channel.go 82.45% <0.00%> (+2.33%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d2803e...2a9772f. Read the comment docs.

Comment on lines +452 to +454
if transition == proto.WorkspaceTransition_DESTROY {
args = append(args, "-destroy")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't know this flag was available - I thought it needed terraform destroy - TIL. This flag is certainly cleaner 👍

Base automatically changed from tfcancel to main February 28, 2022 18:40
@kylecarbs kylecarbs enabled auto-merge (squash) February 28, 2022 19:17
@kylecarbs kylecarbs merged commit b6017a7 into main Feb 28, 2022
@kylecarbs kylecarbs deleted the delete branch February 28, 2022 19:20
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.

2 participants