Issue #3557
closedDate filters in Pulp are ambiguous and a bit of a misnomer
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=..."
Updated by dalley over 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=..."
Updated by daviddavis over 6 years ago
That seems straightforward and unambiguous to me. +1.
Updated by dalley over 6 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to dalley
Updated by dalley over 6 years ago
- Status changed from ASSIGNED to POST
- Sprint set to Sprint 35
Added by dalley over 6 years ago
Added by dalley over 6 years ago
Revision dda4d7d8 | View on GitHub
Fix date filtering being ambiguous
Updated by dalley over 6 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp|dda4d7d80f69f2a56788f7a7604b1b6d1b2e8135.
Updated by bmbouter about 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Fix date filtering being ambiguous
closes #3557 https://pulp.plan.io/issues/3557