Skip to content

feat: Use websockets if stomp config not present - #1646

Open
tpoliaw wants to merge 7 commits into
mainfrom
scripting-ws
Open

feat: Use websockets if stomp config not present#1646
tpoliaw wants to merge 7 commits into
mainfrom
scripting-ws

Conversation

@tpoliaw

@tpoliaw tpoliaw commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Update the client's run_task method to use stomp if the configuration is present
and fall back to the new websocket connection if not.

Allows the scripting interface (bc.plans.count(...)) to run without
configuration using websockets.

The CLI also defaults to websockets if no configuration is present. To force
stomp monitoring, a new --stomp flag is added to be paired with the --ws flag.

The previous run_task method on BlueapiClient has been renamed to run_stomp and
run_task will delegate to the correct method depending on the configuration
available. This should not be a breaking change as there is no change in
behaviour if configuration is present.

@tpoliaw
tpoliaw requested a review from a team as a code owner August 27, 2026 16:37
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.36%. Comparing base (2599a97) to head (0c5bbe1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1646      +/-   ##
==========================================
+ Coverage   96.34%   96.36%   +0.01%     
==========================================
  Files          46       46              
  Lines        3666     3683      +17     
==========================================
+ Hits         3532     3549      +17     
  Misses        134      134              

☔ View full report in Codecov by Harness.
📢 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.

@tpoliaw tpoliaw changed the title Merge run_task handling feat: Use websockets if stomp config not present Sep 2, 2026
@tpoliaw tpoliaw linked an issue Sep 2, 2026 that may be closed by this pull request
return cls(rest)

@classmethod
def for_host(cls, host: str | None = None) -> Self:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure what this should be called. for_host doesn't make sense when called as for_host() to use the default.

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.

Support websocket connection in scripting interface

1 participant