Skip to content

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.

@codecov
Copy link

codecov bot commented Jun 20, 2025

Codecov Report

❌ 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).
⚠️ Report is 43 commits behind head on main.

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

If an action failed, we raise ActionFailedException and won't run into the ActionTimeoutException or ActionGroupException. So timeout only happens when everything is still running, hence why we do not handle it here.

Copy link
Member Author

Choose a reason for hiding this comment

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

And to actually answer your question: if the users uses the wait_for_function, they might have to managed the errors themselves.

@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
@github-actions
Copy link

This PR has been marked as stale because it has not had recent activity. The bot will close the PR if no further action occurs.

@github-actions github-actions bot added the Stale label Oct 19, 2025
@jooola jooola added pinned and removed Stale labels Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants