-
Notifications
You must be signed in to change notification settings - Fork 77
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
Fixes #26075: Trying to save a group with empty criteria removes all entries #6097
Open
clarktsiory
wants to merge
4
commits into
Normation:branches/rudder/8.1
Choose a base branch
from
clarktsiory:bug_26075/trying_to_save_a_group_with_empty_criteria_removes_all_entries
base: branches/rudder/8.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+130
−48
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c90ec36
Fixes #26075: Trying to save a group with empty criteria removes all …
clarktsiory 8f3203d
fixup! Fixes #26075: Trying to save a group with empty criteria remov…
clarktsiory b74e676
fixup! fixup! Fixes #26075: Trying to save a group with empty criteri…
clarktsiory 02e02dc
fixup! fixup! fixup! Fixes #26075: Trying to save a group with empty …
clarktsiory File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1122,6 +1122,78 @@ response: | |
} | ||
} | ||
--- | ||
description: Update a node group query with empty query comparator value | ||
method: POST | ||
url: /api/latest/groups/00000000-cb9d-4f7b-abda-ca38c5d643ea | ||
headers: | ||
- "Content-Type: application/json" | ||
body: >- | ||
{ | ||
"id": "00000000-cb9d-4f7b-abda-ca38c5d643ea", | ||
"query": { | ||
"select": "nodeAndPolicyServer", | ||
"composition": "and", | ||
"transform": "invert", | ||
"where":[ | ||
{ | ||
"objectType": "node", | ||
"attribute": "nodeId", | ||
"comparator": "eq", | ||
"value": "" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm really not sure that we want to forbid that. Things could be the empty string and being valid. And it could be different than "present/absent". Typically in overriding case, where you specifficaly want to override a description to empty string. |
||
} | ||
] | ||
} | ||
} | ||
response: | ||
code: 200 | ||
content: >- | ||
{ | ||
"action":"updateGroup", | ||
"id":"00000000-cb9d-4f7b-abda-ca38c5d643ea", | ||
"result":"success", | ||
"data":{ | ||
"groups":[ | ||
{ | ||
"id":"00000000-cb9d-4f7b-abda-ca38c5d643ea", | ||
"displayName":"clone from api of debian group", | ||
"description":"Some long description", | ||
"category":"GroupRoot", | ||
"query": { | ||
"select": "nodeAndPolicyServer", | ||
"composition": "and", | ||
"transform": "invert", | ||
"where":[ | ||
{ | ||
"objectType": "node", | ||
"attribute": "nodeId", | ||
"comparator": "eq", | ||
"value": "" | ||
} | ||
] | ||
}, | ||
"nodeIds":[], | ||
"dynamic":true, | ||
"enabled":true, | ||
"groupClass":[ | ||
"group_00000000_cb9d_4f7b_abda_ca38c5d643ea", | ||
"group_clone_from_api_of_debian_group" | ||
], | ||
"properties":[ | ||
{ | ||
"name":"os", | ||
"value":{ | ||
"name":"debian", | ||
"nickname":"Buster" | ||
} | ||
} | ||
], | ||
"target":"group:00000000-cb9d-4f7b-abda-ca38c5d643ea", | ||
"system":false | ||
} | ||
] | ||
} | ||
} | ||
--- | ||
description: Move a node group to a new category | ||
method: POST | ||
url: /api/latest/groups/3fa29229-1a4b-4fd6-9edd-af114289fc9a | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
why invert ? (really to know: it's not the default queries, and not relevant to that problem, so I'm wondering)
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.
it's to have it at least covered in test somewhere, I don't think the value is tested anywhere.
I think the value for "transform" is validated before the criteria