- Notifications
You must be signed in to change notification settings - Fork907
chore(coderd/database): enforce agent name unique within workspace build#18052
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
053251c
to2aadf9f
Compare…enessThis PR creates a new database trigger to ensure an inserted workspaceagent has a unique name within the scope of its workspace.
Child agents are a new concept so there are very little existing testsfor them. This means we can easily make the change for them withouthaving to update a mountain of tests. So they get a special case forchecking properly, whilst parent agents have less scrutiny due to thevast number of tests that appear to not work properly.
c331dca
toe51c8be
Comparecoderd/database/migrations/000331_workspace_agent_name_unique_trigger.up.sql OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
coderd/database/migrations/000331_workspace_agent_name_unique_trigger.up.sql OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
The CI will fail for this as there are test failures for insights.
coderd/database/migrations/000331_workspace_agent_name_unique_trigger.up.sql OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
coderd/database/migrations/000331_workspace_agent_name_unique_trigger.up.sql OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
coderd/database/migrations/000331_workspace_agent_name_unique_trigger.up.sql OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
coderd/database/migrations/000331_workspace_agent_name_unique_trigger.up.sql OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
coderd/database/migrations/000331_workspace_agent_name_unique_trigger.up.sql OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
- replace spaces with tabs.- remove _var suffixes.- check if provisioner job as a workspace build
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.
Minor suggestions but otherwise looking good, nice job!
coderd/database/migrations/000332_workspace_agent_name_unique_trigger.up.sql OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
coderd/database/migrations/000332_workspace_agent_name_unique_trigger.up.sqlShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
- add a comment on trigger- spaces to tabs
6e255c7
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This PR creates a database trigger that runs on insert and update of the
workspace_agents
table. The trigger ensures that the agent name is unique within the context of the workspace build it is being inserted into.