-
Notifications
You must be signed in to change notification settings - Fork 35
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
ErrataConnection Filter helper method - WIP #195
base: master
Are you sure you want to change the base?
Conversation
d20904d
to
0c35a5e
Compare
@@ -310,3 +310,37 @@ def get_paginated_data(self, api_url): | |||
if page_number >= PAGE_LIMIT: | |||
raise RuntimeError('hit pagination timeout: %d' % page_number) | |||
return data | |||
|
|||
def get_filter(self, endpoint, filter_arg, **kwargs): |
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.
I think "filter_arg" is always going to be the string "filter", right? Do we need this variable here?
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.
no it is not see '/errata' ... filter_args == 'errata_filter[filter_params]'
yazug@3a2bbad#diff-1a50735487483ddcd06dc38f02e580ebR379-R384
for a couple of examples, I used, extracted from various places where searching was done.
expose a general filter helper method to format kwargs up | ||
as parameters for ET filter request. Then return generated | ||
json object | ||
""" |
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.
should probably include the syntax for how the url is generated
- helper method to implement general filter query pattern - add support for release/product difference in nesting filter parameters - support for paginated requests - basic unittest for filter helper based on usage Works with the following et.get_filter('/api/v1/releases', 'filter', is_active="true", enabled="true", name='OpenStack 14.0.z for RHEL 7') works with the following et.get_filter('/errata', 'errata_filter[filter_params]', show_type_RHBA=1, show_type_RHEA=1, show_type_RHSA=1, show_state_NEW_FILES=1, show_state_QE=1, show_state_REL_PREP=1,show_state_PUSH_READY=1, open_closed_option='exclude', release=856) Note: errata endpoint releases and products have to be special handled to include extra [] and multiple entries if you want them Related: red-hat-storage#132
- replaced duplicated filter query with method ErrataConnector::get_filter
- replaced duplicated filter query with method ErrataConnector::get_filter - fixup unittests to use paginated api - add fixture symlinks for external_tests api
WIP usage of implemented ErrataConnector::get_filter and other helpers - get_releases_for_product - get_open_advisories_for_release - get_open_advisories_for_release_filter Note: errata endpoint releases and products have to be special handled to include extra [] and multiple entries if you want them Related: red-hat-storage#132
Extracted and extrapolated based on shale implementation
@yazug: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
the get_filter helper method encapsulates how to query ET using standard filter pattern, where you only have to specify method call instead of string manipulation to generate the query url to send
Related: #132