Project

Profile

Help

Issue #4780

closed

Task search by invalid field should raise meaningful error

Added by rochacbruno almost 5 years ago. Updated about 2 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
(Total: 0:00 h)
Severity:
2. Medium
Version:
Master
Platform Release:
3.0.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

Reference and discussion: https://github.com/pulp/pulpcore/pull/115#issuecomment-488880787

When we request:

/pulp/api/v3/tasks/?name=pulpcore.app.tasks.repository.update

We get the correct results of all update tasks.

But if we request an invalid field name:

/pulp/api/v3/tasks/?invalidfield=foobar

Or an invalid value to a proper field like the escaped `+`

/pulp/api/v3/tasks/?name=+'

We get all results, the same result if I simply request /pulp/api/v3/tasks/ without params.

What I expected was to see an error like:

Invalid Field name

And for the second case to get `0` results.


Sub-issues 1 (0 open1 closed)

Test #4781: Assert search raises error when filtering by invalid fieldCLOSED - DUPLICATEActions

Related issues

Related to Pulp - Test #4230: Test task name and search for task based on their nameCLOSED - COMPLETErochacbrunoActions
Related to RPM Support - Issue #4857: Pulp 2 Nightly Regression in test_iso_crud.ISOUpdateTestCase.test_allCLOSED - DUPLICATEActions
Actions #1

Updated by kersom almost 5 years ago

  • Related to Test #4230: Test task name and search for task based on their name added
Actions #2

Updated by amacdona@redhat.com almost 5 years ago

  • Triaged changed from No to Yes

IMO this is a valid issue, but since our filter functionality comes from Django Rest Framework, I'm not sure if this can be done cleanly. If there is a DRF configuration that we can add to fix this across the board, 1, otherwise we should bump this to 3.1

Actions #3

Updated by bherring almost 5 years ago

  • Related to Issue #4857: Pulp 2 Nightly Regression in test_iso_crud.ISOUpdateTestCase.test_all added
Actions #4

Updated by fao89 over 4 years ago

  • Status changed from NEW to POST
  • Assignee set to fao89

Added by Fabricio Aguiar over 4 years ago

Revision eb1760d8 | View on GitHub

Raise meaningful error for invalid filters

closes #4780 https://pulp.plan.io/issues/4780

Actions #5

Updated by Anonymous over 4 years ago

  • Status changed from POST to MODIFIED
Actions #6

Updated by bmbouter over 4 years ago

  • Sprint/Milestone set to 3.0.0
Actions #7

Updated by bmbouter over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions #8

Updated by bmbouter almost 4 years ago

  • Category deleted (14)

We are removing the 'API' category per open floor discussion June 16, 2020.

Also available in: Atom PDF