Project

Profile

Help

Issue #3557

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

Added by daviddavis over 1 year ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
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:
Sprint 35

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=..."

Associated revisions

Revision dda4d7d8 View on GitHub
Added by dalley over 1 year ago

Fix date filtering being ambiguous

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

Revision dda4d7d8 View on GitHub
Added by dalley over 1 year ago

Fix date filtering being ambiguous

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

Revision dda4d7d8 View on GitHub
Added by dalley over 1 year ago

Fix date filtering being ambiguous

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

History

#1 Updated by daviddavis over 1 year ago

  • Tags Pulp 3, Pulp 3 MVP added

#2 Updated by dalley over 1 year 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=..."

#3 Updated by daviddavis over 1 year ago

That seems straightforward and unambiguous to me. +1.

#4 Updated by dalley over 1 year ago

  • Description updated (diff)

#5 Updated by dalley over 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dalley

#6 Updated by dalley over 1 year ago

  • Triaged changed from No to Yes

#7 Updated by dalley over 1 year ago

  • Status changed from ASSIGNED to POST
  • Sprint set to Sprint 35

#8 Updated by bmbouter over 1 year ago

+1 on this resolution.

#9 Updated by dalley over 1 year ago

  • Status changed from POST to MODIFIED

#10 Updated by dkliban@redhat.com over 1 year ago

  • Sprint/Milestone set to 3.0

#11 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3, Pulp 3 MVP)

Please register to edit this issue

Also available in: Atom PDF