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

Batch subcommand filter #199

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Jul 7, 2023

  1. add ErrataConnector::get_filter() helper method

    - 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
    yazug committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    88915e0 View commit details
    Browse the repository at this point in the history
  2. Add minimalistic batch subcommand

    errata-tool batch get <id or name of batch>
    errata-tool batch list
    based on ErrataConnector::get_filter method
    
    prints the returned json blob
    
    also has --summary to show some more details
    yazug committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    cc62ce3 View commit details
    Browse the repository at this point in the history
  3. Add Batch and BatchSearch objects

    BatchSearch encapsulates the searching functionality
    and exposes 2 methods for querying ET
    
    Batch is an object for a specific batch from ET
    
    Batch object has properties exposed for some of the relevant
    data extracted it also exposes the raw data returned for the
    batch as well as accessors methods to work with the raw returned data.
    
    Batch can be constructed from data already partially broken down
    from BatchSearch or to directly query ET and parse the data
    
    the Batch::errata property will lazy load the Errata objects.
    If you are just wanting to know which advisories you can look at
    Batch::errata_ids property which will provide you with the list of
    advisories ids that in the batch.
    yazug committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    626e6b9 View commit details
    Browse the repository at this point in the history
  4. cli cleanup to use the class

    yazug committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    fe0a317 View commit details
    Browse the repository at this point in the history