Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3d45f55
feat(coderd/database): allow filtering provisioner daemons by tags
SasSwart Nov 8, 2024
92b9d25
feat(coderd/database): allow filtering provisioner daemons by tags
SasSwart Nov 8, 2024
e68a8fc
add a type hint for sqlc
SasSwart Nov 8, 2024
93058e6
ensure BC with GetProvisionerDaemonsByOrganization
SasSwart Nov 8, 2024
a2bfae3
add a type hint for sqlc
SasSwart Nov 11, 2024
39ab8a0
fix unit test
SasSwart Nov 11, 2024
8bf79c8
Add tags param to provisioner daemons endpoint
SasSwart Nov 11, 2024
86f7dab
fix provisioner tag filtering
SasSwart Nov 11, 2024
bd6f3ed
handle tag reading error
SasSwart Nov 11, 2024
a2476dc
remove assignment to a nil map
SasSwart Nov 11, 2024
e835326
filter by tags in dbmem
SasSwart Nov 11, 2024
23bd23f
correctly set the default value when no tags are provided
SasSwart Nov 11, 2024
9985ef6
support the zero value tag in sql
SasSwart Nov 11, 2024
a173bfb
update the default value for when no tags are provided
SasSwart Nov 12, 2024
70c7ea9
use a sql domain as a type alias so that we can override it as a Stri…
SasSwart Nov 12, 2024
1c57bd2
complete down migration
SasSwart Nov 12, 2024
ebb716d
complete down migration
SasSwart Nov 12, 2024
96b64f4
update the default value for when no tags are provided
SasSwart Nov 12, 2024
5941dc3
fix job acquisition for untagged provisioners
SasSwart Nov 12, 2024
ff75f5e
make gen
SasSwart Nov 12, 2024
85b1ef4
review notes
SasSwart Nov 12, 2024
071fdc4
fix down migration
SasSwart Nov 12, 2024
78abf67
use the correct name for provisionerdaemons' tag field
SasSwart Nov 12, 2024
d1c7d3e
typo
SasSwart Nov 12, 2024
38d77cf
use the updated tag name
SasSwart Nov 12, 2024
1c64353
fix special case of tagset_contains
SasSwart Nov 12, 2024
8508cd8
Use a stringmap instead of a stringslice for provisioner tags
SasSwart Nov 13, 2024
9dcbb83
update tags param parsing in provisionerDaemons
SasSwart Nov 13, 2024
4c1fc0d
update tags param parsing in provisionerDaemons
SasSwart Nov 13, 2024
fbd70f3
fix special case of tagset_contains
SasSwart Nov 13, 2024
69126f4
rename tagset_contains function
SasSwart Nov 13, 2024
e109caf
attempt to fix the special case for provisioner_tagset_contains
SasSwart Nov 13, 2024
f10561e
attempt to fix the special case for provisioner_tagset_contains
SasSwart Nov 13, 2024
a56b130
attempt to fix the special case for provisioner_tagset_contains
SasSwart Nov 13, 2024
2bce007
fix provisioner_tagset_contains
SasSwart Nov 13, 2024
2860f5d
remove defunct code
SasSwart Nov 14, 2024
d6f26df
Add tag filtering tests for GetProvisionerDaemons
SasSwart Nov 14, 2024
1ce410f
fix foreign key constraint in tests
SasSwart Nov 14, 2024
c065742
Add linting
SasSwart Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add a type hint for sqlc
  • Loading branch information
SasSwart committed Nov 11, 2024
commit a2bfae31a2cfe5697a2510634580b0318a9b9d7b
6 changes: 3 additions & 3 deletions coderd/database/queries.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions coderd/database/queries/provisionerdaemons.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ FROM
provisioner_daemons
WHERE
-- This is the original search criteria:
(@organization_id IS NULL OR organization_id = @organization_id)
(@organization_id :: uuid IS NULL OR organization_id = @organization_id :: uuid)
AND
-- adding support for searching by tags:
(@tags :: jsonb IS NULL OR tags_compatible(@tags :: jsonb, provisioner_daemons.tags :: jsonb))
AND
-- Because we're adding @tags as a second search parameter, we need to do this check to
-- ensure that the first parameter's behavior remains unchanged when no second parameter is provided:
(@organization_id IS NOT NULL OR @tags IS NOT NULL);
(@organization_id :: uuid IS NOT NULL OR @tags IS NOT NULL);

-- name: DeleteOldProvisionerDaemons :exec
-- Delete provisioner daemons that have been created at least a week ago
Expand Down
Loading