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

Update sink statistics API with pagination and filtering #2261

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hosekpeter
Copy link
Contributor

Jira: XXXXX

Changes:

  • Refactored sink statistics API to use a new request type.
  • Introduced pagination and filtering options in the API.

@hosekpeter hosekpeter force-pushed the petr-hosek-PSGO-1010 branch 2 times, most recently from b1420f2 to 8b41510 Compare February 28, 2025 11:25
@hosekpeter hosekpeter requested a review from Copilot February 28, 2025 14:32

Choose a reason for hiding this comment

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

PR Overview

This PR updates the sink statistics API to support pagination and filtering by refactoring the request payload and decoder as well as updating the related API design and types. Key changes include:

  • Enhancing the decoder to parse new query parameters ("afterId" and "limit") and propagate them to the payload.
  • Updating the API design by replacing the GetSinkRequest payload with a new StatisticSinkRequest that includes pagination and filtering options.
  • Extending the response and payload types to include pagination information and a not-imported-file filter.

Reviewed Changes

File Description
internal/pkg/service/stream/api/gen/http/stream/server/encode_decode.go Updated decoder to handle pagination query parameters and enhanced error aggregation
api/stream/design.go Modified API design to use the new payload (StatisticSinkRequest) and include new parameters
internal/pkg/service/stream/api/gen/http/stream/server/types.go Updated response and payload types to include pagination and filtering elements
internal/pkg/service/stream/api/gen/stream/service.go Added pagination fields and filtering related to not imported files in the service payload

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

api/stream/design.go:1148

  • [nitpick] Consider renaming 'StatisticSinkRequest' to 'SinkStatisticsRequest' to better align with the naming conventions used elsewhere in the API.
var StatisticSinkRequest = Type("StatisticSinkRequest", func() {

internal/pkg/service/stream/api/gen/http/stream/server/types.go:3339

  • [nitpick] The assignment of NotImportedFiles is performed in two separate conditionals; consider consolidating this logic into a single conditional assignment to improve readability.
if body.NotImportedFiles != nil {
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.

1 participant