-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: Add workspace agent lifecycle state reporting #5785
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
mafredri
merged 24 commits into
main
from
mafredri/feat-add-workspace-agent-ready-status
Jan 24, 2023
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
40e9c87
feat: Add new migrations
mafredri 5abf555
Generate database changes
mafredri a84e467
feat: Add agent state reporting
mafredri 8119e71
Generate docs
mafredri 515e342
WIP
mafredri 1e53635
Rename state -> lifecycle state
mafredri 534f954
Add tests, improve lifecycle reporting
mafredri 90192e5
Fix lint
mafredri aaf19bc
test: Update terraform tests for provider v0.6.7
mafredri bd1a87f
test(site): Update agent mocks
mafredri df9944e
Add new columns to workspace agent table
mafredri 60f414f
Fix plumbing
mafredri 087070e
Run OverrideVSCodeConfigs even on error
mafredri c6928e9
Use consistent Seconds terminology
mafredri c132d4e
Fix s/continue/break/
mafredri 903e850
Fix git auth override order
mafredri 034a850
Fix nit
mafredri f76247f
Publish workspace update
mafredri 2ccdcac
Hide report lifecycle endpoint from apidocs
mafredri 830f9f1
Set all existing agents to ready
mafredri 2b1569f
Add debug logging to lifecycle states
mafredri 71706e0
Add note about error during vscode git auth override
mafredri 21a9d28
Fix typo in tests
mafredri da67c73
Merge branch 'main' into mafredri/feat-add-workspace-agent-ready-status
mafredri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add new columns to workspace agent table
- Loading branch information
commit df9944e3b0b2ec92991ea2b21237d8223622407d
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
coderd/database/migrations/000091_add_workspace_agent_state.down.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| ALTER TABLE workspace_agents DROP COLUMN startup_script_timeout; | ||
| ALTER TABLE workspace_agents DROP COLUMN delay_login_until_ready; | ||
|
|
||
| ALTER TABLE workspace_agents DROP COLUMN lifecycle_state; | ||
|
|
||
| DROP TYPE workspace_agent_lifecycle_state; |
10 changes: 9 additions & 1 deletion
10
coderd/database/migrations/000091_add_workspace_agent_state.up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,13 @@ | ||
| CREATE TYPE workspace_agent_lifecycle_state AS ENUM ('created', 'starting', 'start_timeout', 'start_error', 'ready'); | ||
|
|
||
| ALTER TABLE workspace_agents ADD COLUMN lifecycle_state workspace_agent_lifecycle_state NOT NULL DEFAULT 'created'; | ||
|
|
||
| COMMENT ON COLUMN workspace_agents.lifecycle_state IS 'The current lifecycle state of the workspace agent.'; | ||
|
|
||
| /* Set default values that conform to current behavior */ | ||
| /* Allow logins immediately after agent connect */ | ||
| ALTER TABLE workspace_agents ADD COLUMN delay_login_until_ready boolean NOT NULL DEFAULT false; | ||
| COMMENT ON COLUMN workspace_agents.delay_login_until_ready IS 'If true, the agent will delay logins until it is ready (e.g. executing startup script has ended).'; | ||
|
|
||
| /* Disable startup script timeouts by default */ | ||
| ALTER TABLE workspace_agents ADD COLUMN startup_script_timeout_seconds int4 NOT NULL DEFAULT 0; | ||
| COMMENT ON COLUMN workspace_agents.startup_script_timeout_seconds IS 'The number of seconds to wait for the startup script to complete. If the script does not complete within this time, the agent lifecycle will be marked as start_timeout.'; | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.