Skip to content

Conversation

@jooola
Copy link
Member

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

codecovbot 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 linesPatch %Lines
hcloud/actions/client.py92.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.

@jooolajooola changed the title feat: wait for actions using ActionsClient.wait_for and ActionsClient.wait_for_funcfeat: wait for actions using ActionsClient.{wait_for,wait_for_function}Jun 20, 2025
@jooolajooola changed the title feat: wait for actions using ActionsClient.{wait_for,wait_for_function}feat: wait for actions using ActionsClient.wait_forJun 20, 2025
@jooolajooola requested a review from apricoteJune 20, 2025 13:22
@jooolajooolaforce-pushed the wait_for_actions branch 2 times, most recently from 34685b8 to 4639148CompareJune 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
MemberAuthor

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
MemberAuthor

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
MemberAuthor

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.

@jooolajooolaforce-pushed the wait_for_actions branch 2 times, most recently from 8064421 to 0a0046aCompareJune 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.
@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.

Sign up for freeto 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

@jooola@apricote