Skip to content

Conversation

@Marenz
Copy link
Contributor

@Marenz Marenz commented Jun 12, 2025

  • Pass through timeout arguments for the client
  • Harden potentially flakey test
  • Update release notes

Copilot AI review requested due to automatic review settings June 12, 2025 18:26
@Marenz Marenz requested a review from a team as a code owner June 12, 2025 18:26
@github-actions github-actions bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:dispatcher Affects the high-level dispatcher interface labels Jun 12, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables configurable timeouts for the dispatch client, strengthens a flaky test by adding a missing parameter, and updates release notes to reflect the new options.

  • Pass call_timeout and stream_timeout through to DispatchApiClient
  • Add recurrence parameter in the dispatch schedule test
  • Document new timeout parameters in release notes

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/test_frequenz_dispatch.py Added recurrence=RecurrenceRule() argument in test_dispatch_schedule
src/frequenz/dispatch/_dispatcher.py Extended __init__ to accept call_timeout and stream_timeout and pass them to the client
RELEASE_NOTES.md Added entries for the call_timeout and stream_timeout parameters
Comments suppressed due to low confidence (2)

tests/test_frequenz_dispatch.py:361

  • The new recurrence parameter is passed in the test, but there are no assertions verifying its effect; consider adding assertions to cover recurrence behavior in dispatch scheduling.
recurrence=RecurrenceRule(),

src/frequenz/dispatch/_dispatcher.py:201

  • [nitpick] Consider refactoring the constructor to group related parameters (e.g., timeouts) into a config or options object instead of disabling the lint rule on too many arguments.
# pylint: disable-next=too-many-arguments

RELEASE_NOTES.md Outdated
## New Features

<!-- Here goes the main new features and examples or instructions on how to use them -->
* The dispatcher offers two new parameters to control the clients call and stream timeout:
Copy link

Copilot AI Jun 12, 2025

Choose a reason for hiding this comment

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

Missing apostrophe in "clients call"; it should read "client's call" to indicate possessive form.

Suggested change
* The dispatcher offers two new parameters to control the clients call and stream timeout:
* The dispatcher offers two new parameters to control the client's call and stream timeout:

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@llucax llucax left a comment

Choose a reason for hiding this comment

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

What copilot said, other than that, LGTM.

def __init__(
self,
*,
microgrid_id: int,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nothing to do with this PR but I wonder if there is a reason why you need to pass the microgrid_id when creating the client. For edge clients this makes sense, but for cloud clients? You need to create one client per microgrid? This feels weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

.. this is an edge client?!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And, well. We need to know the id we want dispatches for, that's why we need the microgrid id.

Marenz added 3 commits June 16, 2025 09:53
..by making sure it a dispatch expected to end will never repeat.

Signed-off-by: Mathias L. Baumann <[email protected]>
Signed-off-by: Mathias L. Baumann <[email protected]>
@github-actions github-actions bot added the part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) label Jun 16, 2025
@Marenz Marenz requested a review from llucax June 16, 2025 09:25
@Marenz Marenz enabled auto-merge June 16, 2025 09:25
@Marenz Marenz disabled auto-merge June 16, 2025 09:48
@Marenz Marenz merged commit 6e1f346 into frequenz-floss:v0.x.x Jun 16, 2025
5 checks passed
@Marenz Marenz deleted the beeeeetter branch June 16, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:dispatcher Affects the high-level dispatcher interface part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:tooling Affects the development tooling (CI, deployment, dependency management, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants