-
Notifications
You must be signed in to change notification settings - Fork 56
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
Introduce PaginationResult
type to return errors in WithPagination methods
#1755
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
skarimo
added
the
changelog/Added
Added features results into a minor version bump
label
Nov 15, 2022
skarimo
force-pushed
the
sherz/pagination-errors
branch
from
November 15, 2022 19:45
50c2c00
to
a4c54f4
Compare
therve
reviewed
Nov 15, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! 2 small things:
- Remove the error from the signature. I think it's useless
- Update the examples to check for error in the item and print the Item.
I'm wondering how we can document that breaking change. Can you update the PR description as a first step so that we have something to link? Thanks!
skarimo
changed the title
Return errors in pagination
Introduce Nov 17, 2022
PaginationResult
type to return pagination errors in WithPagination methods
skarimo
changed the title
Introduce
Introduce Nov 17, 2022
PaginationResult
type to return pagination errors in WithPagination methodsPaginationResult
type to return errors in WithPagination methods
therve
approved these changes
Nov 18, 2022
github-actions bot
pushed a commit
that referenced
this pull request
Nov 18, 2022
…methods (#1755) * return error in pagination channel * user generics and named attr * pre-commit fixes * bump ci go version * code review suggestions * pre-commit fixes * fix test Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> Co-authored-by: Thomas Hervé <thomas.herve@datadoghq.com> 57f5c91
kodiakhq bot
referenced
this pull request
in cloudquery/cloudquery
Jan 1, 2023
…to v2.6.1 (#6185) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/DataDog/datadog-api-client-go/v2](https://togithub.com/DataDog/datadog-api-client-go) | require | minor | `v2.5.0` -> `v2.6.1` | --- ### Release Notes <details> <summary>DataDog/datadog-api-client-go</summary> ### [`v2.6.1`](https://togithub.com/DataDog/datadog-api-client-go/releases/tag/v2.6.1) [Compare Source](https://togithub.com/DataDog/datadog-api-client-go/compare/v2.6.0...v2.6.1) <!-- Release notes generated using configuration in .github/release.yml at v2.6.1 --> #### What's Changed ##### Fixed - Remove incorrect required fields from CloudConfigurationComplianceRuleOptions by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1801](https://togithub.com/DataDog/datadog-api-client-go/pull/1801) **Full Changelog**: DataDog/datadog-api-client-go@v2.6.0...v2.6.1 ### [`v2.6.0`](https://togithub.com/DataDog/datadog-api-client-go/releases/tag/v2.6.0) [Compare Source](https://togithub.com/DataDog/datadog-api-client-go/compare/v2.5.0...v2.6.0) <!-- Release notes generated using configuration in .github/release.yml at v2.6.0 --> #### What's Changed ##### Fixed - Fix service catalog schema change by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1749](https://togithub.com/DataDog/datadog-api-client-go/pull/1749) - Add missing response fields to MTD usage attribution endpoint by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1776](https://togithub.com/DataDog/datadog-api-client-go/pull/1776) - Fix missing field in Synthetics tests authentication configuration by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1782](https://togithub.com/DataDog/datadog-api-client-go/pull/1782) - Mark `hosts` response version fields as nullable by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1778](https://togithub.com/DataDog/datadog-api-client-go/pull/1778) ##### Added - Add fields for CSPM GCP usage by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1756](https://togithub.com/DataDog/datadog-api-client-go/pull/1756) - Introduce `PaginationResult` type to return errors in WithPagination methods by [@​skarimo](https://togithub.com/skarimo) in [https://github.com/DataDog/datadog-api-client-go/pull/1755](https://togithub.com/DataDog/datadog-api-client-go/pull/1755) - Add offset and limit parameter to SLO correction API by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1759](https://togithub.com/DataDog/datadog-api-client-go/pull/1759) - Add documentation for Logs Pipelines ReferenceTableLogsLookupProcessor by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1758](https://togithub.com/DataDog/datadog-api-client-go/pull/1758) - Adding new field for the usage metering infra hosts by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1761](https://togithub.com/DataDog/datadog-api-client-go/pull/1761) - Add `include_percentiles` field in Logs Custom Metrics by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1740](https://togithub.com/DataDog/datadog-api-client-go/pull/1740) - Add OAuth support for Synthetics tests by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1764](https://togithub.com/DataDog/datadog-api-client-go/pull/1764) - Add new billable summary fields by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1774](https://togithub.com/DataDog/datadog-api-client-go/pull/1774) - RUM Applications Management API add client_token by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1765](https://togithub.com/DataDog/datadog-api-client-go/pull/1765) - Support GRPC unary calls in Synthetics by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1772](https://togithub.com/DataDog/datadog-api-client-go/pull/1772) - Add style object to dashboard widget formulas by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1787](https://togithub.com/DataDog/datadog-api-client-go/pull/1787) - Add enable_samples monitor option by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1789](https://togithub.com/DataDog/datadog-api-client-go/pull/1789) - Update security_monitoring endpoints for cloud_configuration rules by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1790](https://togithub.com/DataDog/datadog-api-client-go/pull/1790) - Add support for sensitive data scanner APIs by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1784](https://togithub.com/DataDog/datadog-api-client-go/pull/1784) - Add synthetics_parallel_testing to Usage Metering API by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1792](https://togithub.com/DataDog/datadog-api-client-go/pull/1792) - Synthetics add pagination params to get all tests endpoint by [@​api-clients-generation-pipeline](https://togithub.com/api-clients-generation-pipeline) in [https://github.com/DataDog/datadog-api-client-go/pull/1793](https://togithub.com/DataDog/datadog-api-client-go/pull/1793) **Full Changelog**: DataDog/datadog-api-client-go@v2.5.0...v2.6.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 3am on the first day of the month" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC40Mi4wIiwidXBkYXRlZEluVmVyIjoiMzQuNDIuMCJ9-->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
changelog/Added
Added features results into a minor version bump
documentation
Documentation related changes
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new type
PaginationResult[T any]
for results returned by WithPagination methods.This change was introduced to ensure we forward any errors raised by the goroutine via the channel. Additionally the function signature for WithPagination methods have been changed as well. See below for an example: