Issue #1534
closedErrata search not working
Description
I can reproduce this both on API and via pulp-admin
1) Get the zoo5 repo from -> https://github.com/Katello/runcible/tree/master/test/fixtures/repositories/zoo5 (we just need the repo.) Steps below will assume file:///var/www/repositories/zoo5 is the destination
2)
$ pulp-admin rpm repo create --repo-id=ideate --feed=file:///var/www/repositories/zoo5
$ pulp-admin rpm repo sync run --repo-id=ideate
$ pulp-admin rpm repo content errata --repo-id=ideate
...
Id: RHEA-2010:0001
..
Id: RHEA-2010:0002
......
$ pulp-admin rpm repo content errata --repo-id=ideate --fields=id
<BLANK>
$ pulp-admin -vv rpm repo content errata --repo-id=ideate --in='id=RHEA-2010:0001'
<BLANK>
Above 2 commands are blanks for different reasons.
--fields=id => I am assuming is a client side thing since -vv tells me 2 responses with no "id" column
--in='id=RHEA-2010:0001' => Is a server side thing since -vv should [] as server response.
Related issues
Updated by paji@redhat.com almost 9 years ago
- Copied from Issue #1527: package group/category/distribution search not working added
Updated by mhrivnak almost 9 years ago
- Priority changed from Normal to High
- Severity changed from 2. Medium to 3. High
- Platform Release set to 2.8.0
- Triaged changed from No to Yes
Updated by mhrivnak almost 9 years ago
- Related to Issue #1533: package group/category unassociate not working added
Updated by mhrivnak almost 9 years ago
- Related to Issue #1535: Errata unassociate not working added
Updated by semyers almost 9 years ago
- Status changed from NEW to POST
- Assignee set to semyers
This is also fixed by https://github.com/pulp/pulp/pull/2341 (woot)
Added by semyers almost 9 years ago
Added by semyers almost 9 years ago
Revision 8d462ca8 | View on GitHub
unit association query uses model serializers
When building mongo queries, UnitAssociationQuery wasn't translating the incoming fields to their proper mongo fields via the model serializer.
To start, this change makes "public" the serializer translate methods that provide useful functionality when incoming criteria get broken down into their actual mongo queries.
Then, those public methods are used by UnitAssociationQuery to translate model fields before building queries to mongo.
https://pulp.plan.io/issues/1527 fixes #1527
https://pulp.plan.io/issues/1533 re #1533
Updated by semyers almost 9 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulp|8d462ca81bb1c39d8403a3fe00013628c97b8b6c.
Updated by dkliban@redhat.com almost 9 years ago
- Status changed from MODIFIED to 5
Updated by placko almost 9 years ago
- Status changed from 5 to 6
$ pulp-admin status
+----------------------------------------------------------------------+
Status of the server
+----------------------------------------------------------------------+
Api Version: 2
Database Connection:
Connected: True
Known Workers:
_id: scheduler@host.internal
_ns: workers
Last Heartbeat: 2016-03-03T10:34:24Z
_id: reserved_resource_worker-0@host.internal
_ns: workers
Last Heartbeat: 2016-03-03T10:34:56Z
_id: reserved_resource_worker-1@host.internal
_ns: workers
Last Heartbeat: 2016-03-03T10:34:58Z
_id: resource_manager@host.internal
_ns: workers
Last Heartbeat: 2016-03-03T10:34:58Z
Messaging Connection:
Connected: True
Versions:
Platform Version: 2.8.0b6
$ pulp-admin rpm repo create --repo-id=ideate --feed=file:///var/www/repositories/zoo5
Successfully created repository [ideate]
$ pulp-admin rpm repo sync run --repo-id=ideate
+----------------------------------------------------------------------+
Synchronizing Repository [ideate]
+----------------------------------------------------------------------+
===================================== Snip ====================================
===============================================================================
Task Succeeded
$ pulp-admin rpm repo content errata --repo-id=ideate
Description: One package errata
Id: RHEA-2010:0002
Severity:
Summary:
Title: One package errata
Type: security
Description: Empty errata
Id: RHEA-2010:0001
Severity:
Summary:
Title: Empty errata
Type: security
$ pulp-admin rpm repo content errata --repo-id=ideate --fields=id
Id: RHEA-2010:0002
Id: RHEA-2010:0001
$ pulp-admin -vv rpm repo content errata --repo-id=ideate --in='id=RHEA-2010:0001'
2016-03-03 06:55:42,201 - DEBUG - sending POST request to /pulp/api/v2/repositories/ideate/search/units/
2016-03-03 06:55:42,290 - INFO - POST request to /pulp/api/v2/repositories/ideate/search/units/ with parameters {"criteria": {"type_ids": ["erratum"], "filters": {"unit": {"id": {"$in": ["RHEA-2010:0001"]}}}}}
2016-03-03 06:55:42,290 - INFO - Response status : 200
2016-03-03 06:55:42,290 - INFO - Response body :
[
{
"updated": "2016-03-03T11:55:14Z",
"repo_id": "ideate",
"created": "2016-03-03T11:55:14Z",
"unit_id": "ec465ac4-d081-4f71-931e-80190646d373",
"unit_type_id": "erratum",
"_id": {
"$oid": "56d82622cbba263a6aedbbcb"
},
"metadata": {
"issued": "2010-01-01 01:01:01",
"references": [],
"pulp_user_metadata": {},
"_content_type_id": "erratum",
"id": "RHEA-2010:0001",
"from": "lzap+pub@redhat.com",
"severity": "",
"title": "Empty errata",
"_ns": "units_erratum",
"version": "1",
"reboot_suggested": false,
"type": "security",
"pkglist": [],
"status": "stable",
"updated": "",
"description": "Empty errata",
"_last_updated": 1457006114,
"pushcount": "",
"rights": "",
"solution": "",
"summary": "",
"release": "1",
"_id": "ec465ac4-d081-4f71-931e-80190646d373"
}
}
]
Description: Empty errata
Id: RHEA-2010:0001
Severity:
Summary:
Title: Empty errata
Type: security
$ http POST https://host/pulp/api/v2/repositories/ideate/search/units/ --verify=cert.crt -vvv --auth=admin:admin <<< '{"criteria": {"type_ids": ["erratum"], "filters": {"unit": {"id": {"$in": ["RHEA-2010:0001"]}}}}}'
POST /pulp/api/v2/repositories/ideate/search/units/ HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Authorization: Basic YWRtaW46YWRtaW4=
Connection: keep-alive
Content-Length: 98
Content-Type: application/json
Host: host
User-Agent: HTTPie/0.9.2
{
"criteria": {
"filters": {
"unit": {
"id": {
"$in": [
"RHEA-2010:0001"
]
}
}
},
"type_ids": [
"erratum"
]
}
}
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 756
Content-Type: application/json; charset=utf-8
Date: Thu, 03 Mar 2016 12:36:17 GMT
Keep-Alive: timeout=5, max=10000
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
[
{
"_id": {
"$oid": "56d82dddcbba263a6aedbbdd"
},
"created": "2016-03-03T12:28:13Z",
"metadata": {
"_content_type_id": "erratum",
"_id": "94c8097f-527d-44b1-a949-8696a3dff43c",
"_last_updated": 1457008093,
"_ns": "units_erratum",
"description": "Empty errata",
"from": "lzap+pub@redhat.com",
"id": "RHEA-2010:0001",
"issued": "2010-01-01 01:01:01",
"pkglist": [],
"pulp_user_metadata": {},
"pushcount": "",
"reboot_suggested": false,
"references": [],
"release": "1",
"rights": "",
"severity": "",
"solution": "",
"status": "stable",
"summary": "",
"title": "Empty errata",
"type": "security",
"updated": "",
"version": "1"
},
"repo_id": "ideate",
"unit_id": "94c8097f-527d-44b1-a949-8696a3dff43c",
"unit_type_id": "erratum",
"updated": "2016-03-03T12:28:13Z"
}
]
$ http POST https://host/pulp/api/v2/repositories/ideate/search/units/ --verify=cert.crt -vvv --auth=admin:admin <<< '{"criteria": {"fields": {"unit": ["id"]}, "type_ids": ["erratum"], "filters": {"unit": {}}}}'
POST /pulp/api/v2/repositories/ideate/search/units/ HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Authorization: Basic YWRtaW46YWRtaW4=
Connection: keep-alive
Content-Length: 93
Content-Type: application/json
Host: host
User-Agent: HTTPie/0.9.2
{
"criteria": {
"fields": {
"unit": [
"id"
]
},
"filters": {
"unit": {}
},
"type_ids": [
"erratum"
]
}
}
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 664
Content-Type: application/json; charset=utf-8
Date: Thu, 03 Mar 2016 12:36:40 GMT
Keep-Alive: timeout=5, max=10000
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
[
{
"_id": {
"$oid": "56d82dddcbba263a6aedbbde"
},
"created": "2016-03-03T12:28:13Z",
"metadata": {
"_content_type_id": "erratum",
"_id": "0f361c69-97b6-4104-9066-af79d2df37fa",
"id": "RHEA-2010:0002"
},
"repo_id": "ideate",
"unit_id": "0f361c69-97b6-4104-9066-af79d2df37fa",
"unit_type_id": "erratum",
"updated": "2016-03-03T12:28:13Z"
},
{
"_id": {
"$oid": "56d82dddcbba263a6aedbbdd"
},
"created": "2016-03-03T12:28:13Z",
"metadata": {
"_content_type_id": "erratum",
"_id": "94c8097f-527d-44b1-a949-8696a3dff43c",
"id": "RHEA-2010:0001"
},
"repo_id": "ideate",
"unit_id": "94c8097f-527d-44b1-a949-8696a3dff43c",
"unit_type_id": "erratum",
"updated": "2016-03-03T12:28:13Z"
}
]
Updated by dkliban@redhat.com almost 9 years ago
- Status changed from 6 to CLOSED - CURRENTRELEASE
Updated by bmbouter over 4 years ago
- Category deleted (
14)
We are removing the 'API' category per open floor discussion June 16, 2020.
unit association query uses model serializers
When building mongo queries, UnitAssociationQuery wasn't translating the incoming fields to their proper mongo fields via the model serializer.
To start, this change makes "public" the serializer translate methods that provide useful functionality when incoming criteria get broken down into their actual mongo queries.
Then, those public methods are used by UnitAssociationQuery to translate model fields before building queries to mongo.
https://pulp.plan.io/issues/1527 fixes #1527
https://pulp.plan.io/issues/1533 re #1533
https://pulp.plan.io/issues/1534 fixes #1534
https://pulp.plan.io/issues/1535 re #1535