Project

Profile

Help

Issue #4780

Task search by invalid field should raise meaningful error

Added by rochacbruno 6 months ago. Updated about 17 hours ago.

Status:
MODIFIED
Priority:
Normal
Category:
API
Sprint/Milestone:
-
Start date:
Due date:
Severity:
2. Medium
Version:
Master
Platform Release:
3.0.0
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

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.


Subtasks

Test #4781: Assert search raises error when filtering by invalid fieldNEWActions

Related issues

Related to Pulp - Test #4230: Test task name and search for task based on their name CLOSED - COMPLETE Actions
Related to RPM Support - Issue #4857: Pulp 2 Nightly Regression in test_iso_crud.ISOUpdateTestCase.test_all CLOSED - DUPLICATE Actions

Associated revisions

Revision eb1760d8 View on GitHub
Added by Fabricio Aguiar about 18 hours ago

Raise meaningful error for invalid filters

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

History

#1 Updated by kersom 6 months ago

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

#2 Updated by amacdona@redhat.com 5 months 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

#3 Updated by sunnysunny 5 months ago

Really your post is really very good and I appreciate it. It’s hard to sort the good from the bad sometimes.You definitely put a new spin on a topic thats been written about for years.
[[https://shell-shockers.online]]

#4 Updated by bherring 5 months ago

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

#5 Updated by fabricio.aguiar 6 days ago

  • Status changed from NEW to POST
  • Assignee set to fabricio.aguiar

#6 Updated by Anonymous about 17 hours ago

  • Status changed from POST to MODIFIED

Please register to edit this issue

Also available in: Atom PDF