- Notifications
You must be signed in to change notification settings - Fork1.1k
feat(coderd): add owner-related fields to tasks_with_status view#20471
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
c7880c2 to9506ec0Compare
mafredri left a comment
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.
LGMT, just one suggestion for the join.
coderd/database/dump.sql Outdated
| task_owner.owner_name, | ||
| task_owner.owner_avatar_url | ||
| FROM (((((tasks | ||
| LEFT JOIN LATERAL (SELECTvu.usernameAS owner_username, |
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.
(Inner)JOIN LATERAL should be fine here. As long as there can only be one unique owner and the owner id must always be set to an existing user (fk constraint).
That removes nullability from the user columns, although I see sqlc isn't picking that up.
Edit: Actually a regular join might also be fine (non lateral) 🤔
6f5243b tof663689Compare659f89e intomainUh oh!
There was an error while loading.Please reload this page.
Relates tohttps://github.com/coder/coder/pull/20431/files#diff-9cfc826a6ce7e77d977b2025482474dd263d12965b2a94479a74c7f1d872b782
If the workspace relating to a task was deleted, most of the workspace-related fields in
taskFromDBTaskAndWorkspacewill be zero-valued. However, we can still get information relating to the owner so that "created by" shows up correctly in the UI.Updates the
tasks_with_statusview with a join onvisible_usersto get owner-related info.