-
Notifications
You must be signed in to change notification settings - Fork 1
LITE-28666 search by parameter value was fixed #91
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,11 @@ | |
| NOT_FOUND_CHOICES = ['leave_empty', 'fail'] | ||
| MULTIPLE_CHOICES = ['leave_empty', 'fail', 'use_most_actual'] | ||
|
|
||
| FF_REQ_COMMON_FILTERS = { | ||
| 'status': 'approved', | ||
| } | ||
| FF_REQ_SELECT = ['-activation_key', '-template'] | ||
|
|
||
|
|
||
| def validate_lookup_ff_request(data): # noqa: CCR001 | ||
| data = data.dict(by_alias=True) | ||
|
|
@@ -119,3 +124,23 @@ def validate_lookup_ff_request(data): # noqa: CCR001 | |
| return { | ||
| 'overview': overview, | ||
| } | ||
|
|
||
|
|
||
| def filter_requests_with_changes(requests): | ||
| """ FF requests without any changes can be produced during synchronization. | ||
| Exclude them. | ||
| """ | ||
| filtered_requests = [] | ||
| for request in requests: | ||
| changed = False | ||
| for item_data in request['asset']['items']: | ||
| if item_data['quantity'] != item_data['old_quantity']: | ||
|
Contributor
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 not sure that this will work for 100% of scenarios. Can it be 2 request found and both are SYNC? If yes, we will get an empty result.
Contributor
Author
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. Yes, this is theoretically possible. Thanks! |
||
| changed = True | ||
| break | ||
| if changed: | ||
| filtered_requests.append(request) | ||
|
|
||
| if not filtered_requests: | ||
| return requests[0] | ||
|
|
||
| return filtered_requests | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| <!doctype html><html><head><meta charset="utf-8"/><title>Transformations/Lookup FF request</title><script defer="defer" src="../vendors.b7829ba6a3fa12b6e5cb.js"></script><script defer="defer" src="../transformations/lookup_ff_request.5ad2ce11ef60a735c477.js"></script><link href="../transformations/lookup_ff_request.421df6826da3f2351526.css" rel="stylesheet"></head><body><div id="loader"></div><div id="app"><div class="main-container lookup" id="content"><div class="subtitle">Supported search by parameter and optional search by Subscription ID or Subscription External ID. Result contains only one item information, matching selected criteria.</div><div class="input-group"><p>Choose search by Subscription ID</p><label class="label" for="criteria">Subscription ID type</label> <select class="input" id="criteria"></select></div><div class="input-group" id="subscription_column"><label class="label" for="column">Input Column</label> <select class="input" id="column"></select></div><div class="input-group"><p>Choose search by parameter</p><label class="label" for="parameter">Parameter name</label> <select class="input" id="parameter"></select></div><div><label class="label" for="parameter_column">Input Column</label> <select class="input" id="parameter_column"></select></div><div class="input-group"><p>Choose Item match criteria</p><label class="label" for="item">Item ID type</label> <select class="input" id="item"></select></div><div id="item_column_group"><label class="label" for="item_column">Input Column</label> <select class="input" id="item_column"></select></div><div class="input-group"><p class="radio-buttons label">Choose what to do if match is not found:</p><div class="radio-buttons input"><input type="radio" id="not_found_leave_empty" name="if_not_found" value="leave_empty"/> <label for="not_found_leave_empty">Leave empty</label> <input type="radio" id="not_found_fail" name="if_not_found" value="fail"/> <label for="not_found_fail">Fail</label></div></div><div class="input-group"><p class="radio-buttons label">Choose what to do if multiple matches are found:</p><div class="radio-buttons input"><input type="radio" id="multiple_use_most_actual" name="if_multiple" value="use_most_actual"/> <label for="multiple_use_most_actual">Use the most recent</label> <input type="radio" id="multiple_leave_empty" name="if_multiple" value="leave_empty"/> <label for="multiple_leave_empty">Leave empty</label> <input type="radio" id="multiple_fail" name="if_multiple" value="fail"/> <label for="multiple_fail">Fail</label></div></div><div class="output"><label>Output columns:</label><div id="output-columns"></div><div class="button-container"><button id="add" class="button">ADD</button></div></div></div></div></body></html> | ||
| <!doctype html><html><head><meta charset="utf-8"/><title>Transformations/Lookup FF request</title><script defer="defer" src="../vendors.b7829ba6a3fa12b6e5cb.js"></script><script defer="defer" src="../transformations/lookup_ff_request.2d9834915db04892e9cf.js"></script><link href="../transformations/lookup_ff_request.421df6826da3f2351526.css" rel="stylesheet"></head><body><div id="loader"></div><div id="app"><div class="main-container lookup" id="content"><div class="subtitle">Supported search by parameter and optional search by Subscription ID or Subscription External ID. Result contains only one item information, matching selected criteria.</div><div class="input-group"><p>Choose search by Subscription ID</p><label class="label" for="criteria">Subscription ID type</label> <select class="input" id="criteria"></select></div><div class="input-group" id="subscription_column"><label class="label" for="column">Input Column</label> <select class="input" id="column"></select></div><div class="input-group"><p>Choose search by parameter</p><label class="label" for="parameter">Parameter name</label> <select class="input" id="parameter"></select></div><div><label class="label" for="parameter_column">Input Column</label> <select class="input" id="parameter_column"></select></div><div class="input-group"><p>Choose Item match criteria</p><label class="label" for="item">Item ID type</label> <select class="input" id="item"></select></div><div id="item_column_group"><label class="label" for="item_column">Input Column</label> <select class="input" id="item_column"></select></div><div class="input-group"><p class="radio-buttons label">Choose what to do if match is not found:</p><div class="radio-buttons input"><input type="radio" id="not_found_leave_empty" name="if_not_found" value="leave_empty"/> <label for="not_found_leave_empty">Leave empty</label> <input type="radio" id="not_found_fail" name="if_not_found" value="fail"/> <label for="not_found_fail">Fail</label></div></div><div class="input-group"><p class="radio-buttons label">Choose what to do if multiple matches are found:</p><div class="radio-buttons input"><input type="radio" id="multiple_use_most_actual" name="if_multiple" value="use_most_actual"/> <label for="multiple_use_most_actual">Use the most recent</label> <input type="radio" id="multiple_leave_empty" name="if_multiple" value="leave_empty"/> <label for="multiple_leave_empty">Leave empty</label> <input type="radio" id="multiple_fail" name="if_multiple" value="fail"/> <label for="multiple_fail">Fail</label></div></div><div class="output"><label>Output columns:</label><div id="output-columns"></div><div class="button-container"><button id="add" class="button">ADD</button></div></div></div></div></body></html> |
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.
Can you please clarify why you decided to remove retries?
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.
This timeout was needed because the Connect client wasn't retrying in case of connection errors.
It was fixed cloudblue/connect-python-openapi-client#74
What I forgot to do is bump the requirements to apply this patch.
This retry should be also deleted in subscriptions lookup. I will do it a bit later.