Merge ~philroche/simplestreams/+git/simplestreams:feture/filter-items-before-filter-versions into simplestreams:master
Status: | Merged |
---|---|
Approved by: | Robert C Jennings |
Approved revision: | 3075f5c857e66cb4732747cbbe576b30055b99ea |
Merge reported by: | Server Team CI bot |
Merged at revision: | not available |
Proposed branch: | ~philroche/simplestreams/+git/simplestreams:feture/filter-items-before-filter-versions |
Merge into: | simplestreams:master |
Diff against target: |
37 lines (+17/-3) 1 file modified
simplestreams/mirrors/__init__.py (+17/-3) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Server Team CI bot | continuous-integration | Approve | |
Robert C Jennings (community) | Approve | ||
Tobias Koch (community) | Approve | ||
Cody Shepherd (community) | Approve | ||
Review via email: mp+369682@code.launchpad.net |
Commit message
Apply filters to items before filtering versions
Filters were applied to versions before being applied to
items which meant if you were using --max option then
you often were not getting the expected output as the
version filter was filtering out the expected items.
This happens if there is a version greater than the version
of the item you expect despite the fact that the item
with the greater version never passing your supplied
filters.
Description of the change
Apply filters to items before filtering versions
Filters were applied to versions before being applied to
items which meant if you were using --max option then
you often were not getting the expected output as the
version filter was filtering out the expected items.
This happens if there is a version greater than the version
of the item you expect despite the fact that the item
with the greater version never passing your supplied
filters.
An example query where the problem this commit fixes is
``` cloud-images. ubuntu. com/releases/ streams/ v1/com. ubuntu. cloud:released: aws-cn. sjson crsn=cn-north-1 release=xenial arch=amd64 virt=hvm root_store=ssd --output- format= "16.04 %(version_name)s %(arch)s %(id)s %(root_store)s %(virt)s"
sstream-query --max=1 -U http://
```
This would return no results despite there being 41 images that satisfy those filters.