Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix!: enforce unique agent names per workspace #5497

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
Dec 22, 2022

Conversation

deansheather
Copy link
Member

This is only implemented in Go because writing a constraint would be difficult as the only way to check if an agent name is conflicting is by checking 3 different tables for information. Constraints don't support that, so we'd have to write a trigger. This is also how we do app name unique-per-workspace constraints because of the same problem.

I think this is good enough. Coder doesn't crash or have massively bad behavior if multiple agents share a name, it just will pick one instead of the other when doing operations by name.

@ghuntley
Copy link
Contributor

Progresses #5347?

Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

I didn’t try it yet, but this looks like it could prevent existing workspaces from starting or perhaps make templates unusable until they are updated (iff there are duplicates agent names)? Other than that, looks good to me. 👍

@deansheather
Copy link
Member Author

Yes it would prevent existing templates from starting if they were incorrect templates. The fix is easy though and the error message is clear as to what the error is so it should be easy for affected users to resolve.

@deansheather
Copy link
Member Author

Running workspaces are fine though

@mafredri
Copy link
Member

Sounds good 👍🏻. Considering that, should we mark this as a breaking change?

@deansheather
Copy link
Member Author

Sure I guess, feel free to mark it

@mafredri mafredri changed the title fix: enforce unique agent names per workspace fix!: enforce unique agent names per workspace Dec 22, 2022
@deansheather
Copy link
Member Author

@ghuntley this does not progress that PR, not related to usernames just agent names

@deansheather deansheather merged commit 3e2e2ac into main Dec 22, 2022
@deansheather deansheather deleted the dean/unique-agent-names branch December 22, 2022 23:20
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2022
@mafredri mafredri added the release/breaking This label is applied to PRs to detect breaking changes as part of the release process label Dec 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release/breaking This label is applied to PRs to detect breaking changes as part of the release process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants