Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(coderd/database): support exact tags match in AcquireProvisionerJob query#12244

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

Closed
johnstcn wants to merge3 commits intomainfromcj/provisionerd_tag_policy

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedFeb 21, 2024
edited
Loading

Part of#6442

Updates AcquireProvisionerJob query with parameter ExactTagMatch which toggles between existing behaviour (subset matches) or new behaviour (all match).
Adds unit tests for new behaviour.
A separate PR will wire this up to a configuration knob in coderd and provisionerd.

@johnstcnjohnstcnforce-pushed thecj/provisionerd_tag_policy branch from9b77b42 to3796e17CompareFebruary 21, 2024 13:41
@johnstcnjohnstcn changed the titlefeat(coderd/database): update AcquireProvisionerJob query to allow sp…feat(coderd/database): support exact tags match in AcquireProvisionerJob queryFeb 21, 2024
@johnstcnjohnstcnforce-pushed thecj/provisionerd_tag_policy branch from3796e17 to6c18525CompareFebruary 21, 2024 14:23
@johnstcnjohnstcn marked this pull request as ready for reviewFebruary 21, 2024 14:35
Copy link
Member

@mtojekmtojek left a comment

Choose a reason for hiding this comment

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

It's a nice and concise PR! Left 2 nit-picks.

AND nested.tags <@ @tags :: jsonb
-- Ensure the caller satisfies all job tags if requested,
AND CASE
WHEN @exact_tag_match :: boolean THEN nested.tags = @tags :: jsonb
Copy link
Member

Choose a reason for hiding this comment

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

Are both guaranteed to be sorted arrays? Might be a good idea to allow unsorted equality.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I think they'remap[string]string so we want to completely ignore order in comparisons.

Copy link
Member

Choose a reason for hiding this comment

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

Ah right, then ajsonb tojsonb comparison should be fine 👍🏻

@johnstcn
Copy link
MemberAuthor

Putting the scope of the change here has the unfortunate side-effect of enforcing a global tag policy. I'm going to make additional modifications to modify the scope of acquirer.AcquireJob and have the parameter be passed in from provisionerdserver. This should allow individual behaviour per provisioner daemon as we start a provisionerdserver for each provisioner daemon.

mtojek and mafredri reacted with thumbs up emoji

@johnstcn
Copy link
MemberAuthor

Alternative solution:#12269

I'm leaning in favour of this approach as it doesn't require another configuration knob.
However, we may want to revisit this approach in future once we know the exact scenarios in which folks are currently using provisioner tags.

@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsFeb 22, 2024
@github-actionsgithub-actionsbot deleted the cj/provisionerd_tag_policy branchAugust 22, 2024 00:05
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@mtojekmtojekmtojek approved these changes

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@johnstcn@mafredri@mtojek

[8]ページ先頭

©2009-2025 Movatter.jp