refactor(bluebubbles): migrate BlueBubbles adapter to bundled plugin - #31872
refactor(bluebubbles): migrate BlueBubbles adapter to bundled plugin#31872wesleysimplicio wants to merge 1 commit into
Conversation
Add register(), _standalone_send(), interactive_setup(), _apply_yaml_config(), and _is_connected() to the BlueBubbles plugin adapter following the exact Mattermost migration pattern. Old code removed from: - gateway/run.py: BlueBubbles elif block in build_adapter() - hermes_cli/gateway.py: _setup_bluebubbles mapping (comment out) - hermes_cli/setup.py: _setup_bluebubbles() function
CI Self-Heal: Test Flake FixTests (run 26383939558): The test Root cause: xdist worker state pollution. A previous test in the same worker registers a custom provider that shadows 'anthropic', causing an extra Fix submitted in PR #31880: Switches from position-dependent No changes needed on this PR — the fix targets |
|
Thanks for the CI self-heal and the heads-up. That makes sense — I'll leave this PR unchanged since the fix is targeting in #31880 and should back-propagate once it lands. I'll recheck this branch after the upstream fix is merged. |
|
Correction: thanks for the CI self-heal and the heads-up. That makes sense — I will leave this PR unchanged since the fix is targeting upstream main in #31880 and should back-propagate once it lands. I will recheck this branch after the upstream fix is merged. |
|
Closing non-fix PR as requested — mantendo apenas PRs de fix. |
What does this PR do?
Migrate the BlueBubbles (iMessage) gateway adapter from the legacy
gateway/platforms/bluebubbles.pyimport into a self-contained bundled plugin underplugins/platforms/bluebubbles/, following the exact same pattern used by the Mattermost plugin migration.Root cause
The detailed rationale from the original PR body is preserved below. This template update keeps the review structure consistent with #29640.
Fix
Why this shape
This shape mirrors #29640 so reviewers can quickly compare scope, root cause, fix, tests, and related context without having to decode a custom PR description.
Tests
hermes gateway runwithBLUEBUBBLES_SERVER_URLandBLUEBUBBLES_PASSWORDset — adapter loads via plugin system, webhook listener startshermes setup→ BlueBubbles — interactive wizard prompts for URL, password, allowlist, home channel (same flow as before)deliver=bluebubbles— runs via_standalone_send()without a live gatewayhermes config editwithbluebubbles:YAML block — env vars get set via_apply_yaml_config()register_platform()patternGenerated by Hermes Turbo
Related PRs / issues
Original body
Summary
Migrate the BlueBubbles (iMessage) gateway adapter from the legacy
gateway/platforms/bluebubbles.pyimport into a self-contained bundled plugin underplugins/platforms/bluebubbles/, following the exact same pattern used by the Mattermost plugin migration.What Changed
Added —
plugins/platforms/bluebubbles/__init__.py— standard plugin entry point exposingregisteradapter.py— full adapter (copied fromgateway/platforms/bluebubbles.py) with appended registration functions:register(ctx)— plugin entry point, callsctx.register_platform(...)_standalone_send()— out-of-process cron delivery via BlueBubbles REST APIinteractive_setup()— interactive setup wizard (replaceshermes_cli/setup.py::_setup_bluebubbles)_apply_yaml_config()— YAML→env config bridge forconfig.yamlbluebubbles:keys_is_connected()— connectivity probeplugin.yaml— plugin metadataRemoved
gateway/run.py: removed theelif platform == Platform.BLUEBUBBLES:hardcoded import blockhermes_cli/gateway.py: removed the"bluebubbles": _s._setup_bluebubblesmappinghermes_cli/setup.py: removed_setup_bluebubbles()functionFluxo
gateway/platforms/bluebubbles.py→plugins/platforms/bluebubbles/adapter.pyregister(),_standalone_send(),interactive_setup(),_apply_yaml_config(),_is_connected()no final do adapter, seguindo exatamente o padrão do Mattermostgateway/run.py::build_adapter()hermes_cli/gateway.py::_builtin_setup_fn()_setup_bluebubbles()dohermes_cli/setup.pyVisão
Same zero-regression migration pattern proven by Mattermost:
gateway/platforms/bluebubbles.pyplugins/platforms/bluebubbles/adapter.pyelifinbuild_adapter()register()auto-discoveryhermes_cli/setup.py::_setup_bluebubbles()interactive_setup()in plugin adaptergateway/config.py_apply_yaml_config()in plugin adapter_standalone_send()in plugin adapterTest Plan
hermes gateway runwithBLUEBUBBLES_SERVER_URLandBLUEBUBBLES_PASSWORDset — adapter loads via plugin system, webhook listener startshermes setup→ BlueBubbles — interactive wizard prompts for URL, password, allowlist, home channel (same flow as before)deliver=bluebubbles— runs via_standalone_send()without a live gatewayhermes config editwithbluebubbles:YAML block — env vars get set via_apply_yaml_config()register_platform()patternGenerated by Hermes Turbo
Generated by Hermes Turbo