Skip to content

feat: wait for actions using ActionsClient.wait_for #508

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jooola
Copy link
Member

@jooola jooola commented Jun 20, 2025

This function allows the users to wait for multiple actions in an efficient way. All actions are queried using a single call, which reduce the potential for running into rate limits.

Copy link

codecov bot commented Jun 20, 2025

Codecov Report

Attention: Patch coverage is 95.89041% with 3 lines in your changes missing coverage. Please review.

Project coverage is 93.48%. Comparing base (be61f7f) to head (6bf2b5d).

Files with missing lines Patch % Lines
hcloud/actions/client.py 92.30% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #508      +/-   ##
==========================================
+ Coverage   93.43%   93.48%   +0.04%     
==========================================
  Files          64       65       +1     
  Lines        3048     3115      +67     
==========================================
+ Hits         2848     2912      +64     
- Misses        200      203       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jooola jooola force-pushed the wait_for_actions branch from 6c0d4c7 to c3e6675 Compare June 20, 2025 13:20
@jooola jooola changed the title feat: wait for actions using ActionsClient.wait_for and ActionsClient.wait_for_func feat: wait for actions using ActionsClient.{wait_for,wait_for_function} Jun 20, 2025
@jooola jooola changed the title feat: wait for actions using ActionsClient.{wait_for,wait_for_function} feat: wait for actions using ActionsClient.wait_for Jun 20, 2025
@jooola jooola requested a review from apricote June 20, 2025 13:22
@jooola jooola force-pushed the wait_for_actions branch 2 times, most recently from 34685b8 to 4639148 Compare June 23, 2025 13:15
Comment on lines 209 to 211
raise ActionGroupException(
[ActionTimeoutException(action=action) for action in running]
)
Copy link
Member

Choose a reason for hiding this comment

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

This hides/ignores any errors for actions that already completed. Should they be included in the Exception or should users that want this behavior pass their own handle_update callable and track these action errors themselves?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not entirely sure about this one.

I doubt there is a use case for having the actions that succeeded, we are more focused on the actions that timeout.

I think usage will tell, so I'll start using this in the ansible collection and see how this works out.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I was not clear enough. Besides the actions that time out, maybe the user is also interested in the actions that errored, to show a full picture of the issues.

@jooola jooola force-pushed the wait_for_actions branch 2 times, most recently from 8064421 to 0a0046a Compare June 26, 2025 13:16
jooola added 4 commits July 18, 2025 09:58
This function allows the users to wait for multiple actions in an efficient way. All actions are queried using a single call, which reduce the potential for running into rate limits.
@jooola jooola force-pushed the wait_for_actions branch from 057bfc2 to 6bf2b5d Compare July 18, 2025 08:18
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.

2 participants