Skip to content

feat: Add "state" command to pull and push workspace state #1264

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 1 commit into from
May 2, 2022
Merged

Conversation

kylecarbs
Copy link
Member

@kylecarbs kylecarbs commented May 2, 2022

It's possible for a workspace to become in an invalid state.
This is something we'll detect for jobs, and allow monitoring of.

These commands will allow admins to manually reconcile state.

When the state is pushed, should we require a new workspace build to be created? That seems like a better approach than replacing it.

@kylecarbs kylecarbs requested a review from coadler May 2, 2022 21:47
@kylecarbs kylecarbs self-assigned this May 2, 2022
@codecov
Copy link

codecov bot commented May 2, 2022

Codecov Report

Merging #1264 (b341b93) into main (43c6bff) will increase coverage by 0.10%.
The diff coverage is 64.03%.

@@            Coverage Diff             @@
##             main    #1264      +/-   ##
==========================================
+ Coverage   65.90%   66.01%   +0.10%     
==========================================
  Files         275      276       +1     
  Lines       18034    18146     +112     
  Branches      216      216              
==========================================
+ Hits        11886    11979      +93     
- Misses       4913     4925      +12     
- Partials     1235     1242       +7     
Flag Coverage Δ
unittest-go-macos-latest 53.25% <64.03%> (+0.10%) ⬆️
unittest-go-postgres- 64.89% <64.03%> (+0.08%) ⬆️
unittest-go-ubuntu-latest 55.65% <63.15%> (+0.07%) ⬆️
unittest-go-windows-2022 51.45% <63.15%> (+0.03%) ⬆️
unittest-js 70.69% <ø> (ø)
Impacted Files Coverage Δ
codersdk/workspaces.go 63.63% <ø> (ø)
codersdk/workspacebuilds.go 54.34% <40.00%> (-3.99%) ⬇️
cli/state.go 61.11% <61.11%> (ø)
cli/root.go 79.13% <100.00%> (+0.15%) ⬆️
coderd/coderd.go 97.68% <100.00%> (+0.01%) ⬆️
coderd/provisionerdaemons.go 62.98% <100.00%> (-0.51%) ⬇️
coderd/workspacebuilds.go 57.14% <100.00%> (+2.79%) ⬆️
coderd/workspaces.go 58.51% <100.00%> (+0.44%) ⬆️
coderd/workspaceagents.go 56.04% <0.00%> (-1.87%) ⬇️
... and 7 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 43c6bff...b341b93. Read the comment docs.

var buildName string
cmd := &cobra.Command{
Use: "pull <workspace> [file]",
RunE: func(cmd *cobra.Command, args []string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs a cobra.MinimumNArgs(1)

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed!

It's possible for a workspace to become in an invalid state.
This is something we'll detect for jobs, and allow monitoring of.

These commands will allow admins to manually reconcile state.
@kylecarbs kylecarbs merged commit fd49a18 into main May 2, 2022
@kylecarbs kylecarbs deleted the state branch May 2, 2022 22:51
@misskniss misskniss added this to the V2 Beta milestone May 15, 2022
kylecarbs added a commit that referenced this pull request Jun 10, 2022
It's possible for a workspace to become in an invalid state.
This is something we'll detect for jobs, and allow monitoring of.

These commands will allow admins to manually reconcile state.
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.

3 participants