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

Skip to content

chore: add prebuilds system user #16916

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 28 commits into from
Mar 25, 2025
Merged

chore: add prebuilds system user #16916

merged 28 commits into from
Mar 25, 2025

Conversation

dannykopping
Copy link
Contributor

@dannykopping dannykopping commented Mar 13, 2025

Pre-requisite for #16891

Closes coder/internal#515

This PR introduces a new concept of a "system" user.

Our data model requires that all workspaces have an owner (a users relation), and prebuilds is a feature that will spin up workspaces to be claimed later by actual users - and thus needs to own the workspaces in the interim.

Naturally, introducing a change like this touches a few aspects around the codebase and we've taken the approach default hidden here; in other words, queries for users will by default exclude all system users, but there is a flag to ensure they can be displayed. This keeps the changeset relatively small.

This user has minimal permissions (it's equivalent to a member since it has no roles). It will be associated with the default org in the initial migration, and thereafter we'll need to somehow ensure its membership aligns with templates (which are org-scoped) for which it'll need to provision prebuilds; that's a solution we'll have in a subsequent PR.

@evgeniy-scherbina
Copy link
Contributor

Looks okay to me

@dannykopping dannykopping force-pushed the prebuilds-system-user branch from c92fb1b to e7e9c27 Compare March 17, 2025 12:12
Signed-off-by: Danny Kopping <[email protected]>
@dannykopping dannykopping marked this pull request as ready for review March 17, 2025 12:54
SasSwart added a commit that referenced this pull request Mar 18, 2025
When trying to add [system
users](#16916), we discovered an
issue in two migrations that added values to the login_type enum.
After some
[consideration](#16916 (comment)),
we decided to retroactively correct them.
EdwardAngert pushed a commit that referenced this pull request Mar 18, 2025
When trying to add [system
users](#16916), we discovered an
issue in two migrations that added values to the login_type enum.
After some
[consideration](#16916 (comment)),
we decided to retroactively correct them.
@SasSwart SasSwart assigned SasSwart and unassigned dannykopping Mar 19, 2025
@SasSwart SasSwart enabled auto-merge (squash) March 25, 2025 11:55
@SasSwart SasSwart disabled auto-merge March 25, 2025 11:57
@SasSwart SasSwart enabled auto-merge (squash) March 25, 2025 12:04
@SasSwart SasSwart merged commit 4c33846 into main Mar 25, 2025
34 checks passed
@SasSwart SasSwart deleted the prebuilds-system-user branch March 25, 2025 12:18
@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for system users to the database
6 participants