Skip to content
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

Limit filtering match-all filter to DynamicGroups of group_type dynam… #822

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

johanek
Copy link

@johanek johanek commented Oct 22, 2024

…ic-filter

Dynamic Groups of type dynamic-set have an empty filter, and were not being applied previously

This resolves #706

…ic-filter

Dynamic Groups of type dynamic-set have an empty filter, and were not being applied previously
@itdependsnetworks
Copy link
Contributor

@lampwins can you look at this, and comment made here about performance?

@@ -70,7 +70,7 @@ def get_job_filter(data=None):

raw_qs = Q()
# If scope is set to {} do not loop as all devices are in scope.
if not models.GoldenConfigSetting.objects.filter(dynamic_group__filter__iexact="{}").exists():
if not models.GoldenConfigSetting.objects.filter(dynamic_group__filter__iexact="{}", dynamic_group__group_type="dynamic-filter").exists():
Copy link
Contributor

@itdependsnetworks itdependsnetworks Oct 31, 2024

Choose a reason for hiding this comment

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

Getting verification, but can you import and then use the ChoiceSet definition: DynamicGroupTypeChoices.TYPE_DYNAMIC_FILTER instead of "dynamic-filter"

Copy link
Author

Choose a reason for hiding this comment

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

Done, I've only taken into account filter and set groups - does anything need to be done to also support static groups?

Copy link
Contributor

Choose a reason for hiding this comment

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

Will rope in @lampwins to help out here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Device filtering in jobs wrongly matches excluded devices when GC dynamic group uses child groups
2 participants