-
Notifications
You must be signed in to change notification settings - Fork 881
feat: Add connection_timeout and troubleshooting_url to agent #4937
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 11 commits into
main
from
mafredri/agent-connection-timeout-troubleshooting
Nov 9, 2022
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
2bf20be
feat: Add connection_timeout and troubleshooting_url to agent
mafredri b567c55
Add testcase for cliui.Agent troubleshooting message
mafredri ecee858
Only enable connection timeouts when set to non-zero
mafredri 673e331
Improve testutil.Eventually autocomplete signature and add message
mafredri 788c1f4
Add coderd testcase for coder agent timeout
mafredri 0e395e2
Make gen
mafredri a6a095b
Rename to ConnectionTimeoutSeconds and TroubleshootingURL initialism
mafredri 0cfc7b8
What goes up must also come down
mafredri 15ef5ae
Update site mocks
mafredri e8a8311
Assign values from terraform resources
mafredri 7a7315a
chore: Update terraform resource testdata
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
There are no files selected for viewing
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
.../database/migrations/000072_add_agent_connection_timeout_and_troubleshooting_url.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
BEGIN; | ||
|
||
ALTER TABLE workspace_agents | ||
DROP COLUMN connection_timeout_seconds; | ||
|
||
ALTER TABLE workspace_agents | ||
DROP COLUMN troubleshooting_url; | ||
|
||
COMMIT; |
13 changes: 13 additions & 0 deletions
13
...rd/database/migrations/000072_add_agent_connection_timeout_and_troubleshooting_url.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
BEGIN; | ||
|
||
ALTER TABLE workspace_agents | ||
ADD COLUMN connection_timeout_seconds integer NOT NULL DEFAULT 0; | ||
|
||
COMMENT ON COLUMN workspace_agents.connection_timeout_seconds IS 'Connection timeout in seconds, 0 means disabled.'; | ||
|
||
ALTER TABLE workspace_agents | ||
ADD COLUMN troubleshooting_url text NOT NULL DEFAULT ''; | ||
|
||
COMMENT ON COLUMN workspace_agents.troubleshooting_url IS 'URL for troubleshooting the agent.'; | ||
|
||
COMMIT; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
mutate ...func
? You would get rid of thenil
insetupWorkspaceForAgent(t, nil)
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean suggestion, but I think we can keep this explicit for now, makes it slightly more convenient to add new arguments, if needed and I don't see a use-case for multiple mutation functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, the nil is considered to be an anti-pattern as it has an ambiguous meaning. This is the main reason why I raised this comment, so feel free to leave it as is.