Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pagination in some endpoints #5557

Merged
merged 14 commits into from Jan 19, 2023
Merged

Fix pagination in some endpoints #5557

merged 14 commits into from Jan 19, 2023

Conversation

zhiltsov-max
Copy link
Contributor

@zhiltsov-max zhiltsov-max commented Jan 6, 2023

Motivation and context

  • Added missing pagination or page parameters in /projects/{id}/tasks, /tasks/{id}/jobs, /jobs/{id}/issues, /jobs/{id}/commits, /issues/{id}/comments, /organizations
  • Updated SDK, tests and UI

How has this been tested?

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@bsekachev bsekachev self-requested a review as a code owner January 11, 2023 08:00
@zhiltsov-max zhiltsov-max changed the title [WIP] Fix pagination in some endpoints Fix pagination in some endpoints Jan 11, 2023
@nmanovic
Copy link
Contributor

@zhiltsov-max , @bsekachev , could you please look at tests?

@nmanovic nmanovic changed the title Fix pagination in some endpoints [WIP] Fix pagination in some endpoints Jan 11, 2023
@zhiltsov-max zhiltsov-max changed the title [WIP] Fix pagination in some endpoints Fix pagination in some endpoints Jan 11, 2023
dimension = serializers.CharField(max_length=2, source='segment.task.dimension')
labels = LabelSerializer(many=True, source='get_labels')
assignee = BasicUserSerializer(allow_null=True, read_only=True)
dimension = serializers.CharField(max_length=2, source='segment.task.dimension', read_only=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhiltsov-max , why do we need read_only=True here if below read_only_fields is specified?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, the fields marked with read_only=True are "required" in the generated schema otherwise, even though they are mentioned in Meta.read_only_fields. I suspect this is because they are overridden, note that the other fields have the ReadOnlyField type.

Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, let's wait tests.

@nmanovic nmanovic merged commit 58b0553 into develop Jan 19, 2023
@nmanovic nmanovic deleted the zm/improve-some-endpoints branch January 19, 2023 12:24
mikhail-treskin pushed a commit to retailnext/cvat that referenced this pull request Jul 1, 2023
- Added missing pagination or page parameters in `/projects/{id}/tasks`,
`/tasks/{id}/jobs`, `/jobs/{id}/issues`, `/jobs/{id}/commits`,
`/issues/{id}/comments`, `/organizations`
- Updated SDK, tests and UI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants