Project

Profile

Help

Issue #3557

closed

Date filters in Pulp are ambiguous and a bit of a misnomer

Added by daviddavis about 6 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 35
Quarter:

Description

We have a few filters in Pulp for filtering tasks, repo verisons, etc and they usually have names like "started_after". If I have a task that started at say "12:00" and I filter started_after=12:00, then I get the task back because it's filtering on started_at__gte. That seems wrong to me. At the very least, we should have docs that call out that started_after includes the time specified.

edit: The amended proposal is to remove "started_after" "finished_before" etc. filtering params entirely, and to make the underlying "started_at" and "finished_at" fields filterable using normal queries such as "/tasks/?started_at__lte=..."

Actions #1

Updated by daviddavis about 6 years ago

  • Tags Pulp 3, Pulp 3 MVP added
Actions #2

Updated by dalley about 6 years ago

I'm glad you posted this, and I have some general frustration about it.

On the Task model serializer, we have the following fields:

started_at
finished_at
{...}

And the Task viewset filter params are:

started_after
started_before
finished_after
finished_before
   {...}

If you look at a Task record, you might expect that you could perform a query such as "/tasks/?started_at__gte=..." but you cannot, because we've opted for entirely different names: "started_before", "finished_after", etc.

Likewise, on the RepositoryVersion serializer:

number
created
{...}

But on the viewset, the filter params:

version_min
version_max
created_after
created_before
{...}

Same here.

I don't like the inconsistency between the parameters we're providing to filter by and the actual names of the fields. I propose to delete "*_after" and "*_before" filters entirely, in favor of using normal conventions like e.g. "/tasks/?finished_at__lte=..."

Actions #3

Updated by daviddavis about 6 years ago

That seems straightforward and unambiguous to me. +1.

Actions #4

Updated by dalley about 6 years ago

  • Description updated (diff)
Actions #5

Updated by dalley about 6 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dalley
Actions #6

Updated by dalley about 6 years ago

  • Triaged changed from No to Yes
Actions #7

Updated by dalley about 6 years ago

  • Status changed from ASSIGNED to POST
  • Sprint set to Sprint 35
Actions #8

Updated by bmbouter about 6 years ago

+1 on this resolution.

Added by dalley about 6 years ago

Revision dda4d7d8 | View on GitHub

Fix date filtering being ambiguous

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

Added by dalley about 6 years ago

Revision dda4d7d8 | View on GitHub

Fix date filtering being ambiguous

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

Actions #9

Updated by dalley about 6 years ago

  • Status changed from POST to MODIFIED
Actions #10

Updated by dkliban@redhat.com about 6 years ago

  • Sprint/Milestone set to 3.0.0
Actions #11

Updated by bmbouter almost 5 years ago

  • Tags deleted (Pulp 3, Pulp 3 MVP)
Actions #12

Updated by bmbouter over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF