-
Notifications
You must be signed in to change notification settings - Fork 51
feat: list actions for a given resource #791
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #791 +/- ##
==========================================
- Coverage 80.01% 79.42% -0.60%
==========================================
Files 60 60
Lines 4494 4553 +59
==========================================
+ Hits 3596 3616 +20
- Misses 596 634 +38
- Partials 302 303 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
lukasmetzner
left a comment
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 good to me 👍 You can ignore the comment
|
Is there maybe a way to ensure that resources implement the |
We can have a check that the resource implements the interface. Tests would be the best way to check this. |
af24d1f to
c1e2083
Compare
c1e2083 to
c29ea99
Compare
c29ea99 to
06abfbb
Compare
|
I think the benefits of adding a generic type parameter to We should still highlight this in the release notes. The usage of the private interface as a constraint for the type parameter should be evaluated in the CLI. |
ef5060a to
5f14cb0
Compare
|
Just tried this branch in the CLI project, and no change are required to make this work. |
dbc621e to
8d29ed5
Compare
- Adds `client.<resource_client>.Action.ListFor(ctx, id, opts)` method to list actions for a resource identified with the given id. - Adds `client.<resource_client>.Action.AllFor(ctx, id, opts)` method to list all actions for a resource identified with the given id.
8d29ed5 to
b09f1ea
Compare
<!-- section-start changelog --> ### `ResourceActionClient` now has a generic type parameter The [`ResourceActionClient`](https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud#ResourceActionClient) struct now has a generic type parameter. The type parameter is used to describe the API resource of the Actions client. The [`IResourceActionClient`](https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud#IResourceActionClient) interface that is generated from the [`ResourceActionClient`](https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud#ResourceActionClient) struct, is also affected by this change. This API was never intended to be used directly and we did not find any usage of it in public code. So while potentially breaking, the benefits of this change out weighted the risks of doing it. ### Features - retry request on API `timeout` error (#797) - list actions for a given resource (#791) <!-- section-end changelog --> --- <details> <summary><h4>PR by <a href="https://github.com/apricote/releaser-pleaser">releaser-pleaser</a> 🤖</h4></summary> If you want to modify the proposed release, add you overrides here. You can learn more about the options in the docs. ## Release Notes ### Prefix / Start This will be added to the start of the release notes. ~~~~rp-prefix ### `ResourceActionClient` now has a generic type parameter The [`ResourceActionClient`](https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud#ResourceActionClient) struct now has a generic type parameter. The type parameter is used to describe the API resource of the Actions client. The [`IResourceActionClient`](https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud#IResourceActionClient) interface that is generated from the [`ResourceActionClient`](https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud#ResourceActionClient) struct, is also affected by this change. This API was never intended to be used directly and we did not find any usage of it in public code. So while potentially breaking, the benefits of this change out weighted the risks of doing it. ~~~~ ### Suffix / End This will be added to the end of the release notes. ~~~~rp-suffix ~~~~ </details> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…4.0 (hetznercloud/fleeting-plugin-hetzner!330) This MR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [github.com/hetznercloud/hcloud-go/v2](https://github.com/hetznercloud/hcloud-go) | `v2.33.0` → `v2.34.0` |  |  | --- ### Release Notes <details> <summary>hetznercloud/hcloud-go (github.com/hetznercloud/hcloud-go/v2)</summary> ### [`v2.34.0`](https://github.com/hetznercloud/hcloud-go/blob/HEAD/CHANGELOG.md#v2340) [Compare Source](hetznercloud/hcloud-go@v2.33.0...v2.34.0) ##### `ResourceActionClient` now has a generic type parameter The [`ResourceActionClient`](https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud#ResourceActionClient) struct now has a generic type parameter. The type parameter is used to describe the API resource of the Actions client. The [`IResourceActionClient`](https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud#IResourceActionClient) interface that is generated from the [`ResourceActionClient`](https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud#ResourceActionClient) struct, is also affected by this change. This API was never intended to be used directly and we did not find any usage of it in public code. So while potentially breaking, the benefits of this change out weighted the risks of doing it. ##### Features - retry request on API `timeout` error ([#​797](hetznercloud/hcloud-go#797)) - list actions for a given resource ([#​791](hetznercloud/hcloud-go#791)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi43NC4zIiwidXBkYXRlZEluVmVyIjoiNDIuNzQuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
client.<resource_client>.Action.ListFor(ctx, resource, opts)method to list actions for a resource.client.<resource_client>.Action.AllFor(ctx, resource, opts)method to list all actions for a resource.ResourceActionClientnow has a generic type parameterThe
ResourceActionClientstruct now has a generic type parameter. The type parameter is used to describe the API resource of the Actions client.The
IResourceActionClientinterface that is generated from theResourceActionClientstruct, is also affected by this change.The API was never intended to be used directly and we did not find any usage of it in public code. So while potentially breaking, the benefits of this change out weighted the risks of doing it.