Skip to content

Commit

Permalink
Merge pull request #35 from OpenVoiceOS/release-0.0.7a1
Browse files Browse the repository at this point in the history
Release 0.0.7a1
  • Loading branch information
JarbasAl authored Nov 5, 2024
2 parents f9c539a + 5e2a00b commit 52f7cf4
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
uses: neongeckocom/.github/.github/workflows/python_build_tests.yml@master
with:
test_pipaudit: true
pipaudit_ignored: "GHSA-r9hx-vwmv-q579 PYSEC-2022-43012 GHSA-j8r2-6x86-q33q"
pipaudit_ignored: "GHSA-r9hx-vwmv-q579 PYSEC-2022-43012 GHSA-j8r2-6x86-q33q GHSA-9wx4-h78v-vm56"
8 changes: 4 additions & 4 deletions .github/workflows/install_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
strategy:
max-parallel: 2
matrix:
python-version: [ 3.7, 3.8, 3.9, "3.10" ]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Build Tools
Expand All @@ -31,4 +31,4 @@ jobs:
python setup.py bdist_wheel
- name: Install package
run: |
pip install .[all]
pip install .[all]
45 changes: 23 additions & 22 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,42 @@ on:
branches:
- dev
paths-ignore:
- 'ovos_messagebus/version.py'
- 'examples/**'
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'CHANGELOG.md'
- 'MANIFEST.in'
- 'readme.md'
- 'scripts/**'
- "ovos_messagebus/version.py"
- "examples/**"
- ".github/**"
- ".gitignore"
- "LICENSE"
- "CHANGELOG.md"
- "MANIFEST.in"
- "readme.md"
- "scripts/**"
push:
branches:
- master
paths-ignore:
- 'ovos_messagebus/version.py'
- 'requirements/**'
- 'examples/**'
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'CHANGELOG.md'
- 'MANIFEST.in'
- 'readme.md'
- 'scripts/**'
- "ovos_messagebus/version.py"
- "requirements/**"
- "examples/**"
- ".github/**"
- ".gitignore"
- "LICENSE"
- "CHANGELOG.md"
- "MANIFEST.in"
- "readme.md"
- "scripts/**"
workflow_dispatch:

jobs:
unit_tests:
strategy:
max-parallel: 2
matrix:
python-version: [ 3.7, 3.8, 3.9]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install System Dependencies
Expand All @@ -50,6 +50,7 @@ jobs:
- name: Install core repo
run: |
pip install .
# TODO: Implement unit tests
# - name: Install test dependencies
# run: |
Expand Down
17 changes: 6 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
# Changelog

## [0.0.6a1](https://github.com/OpenVoiceOS/ovos-messagebus/tree/0.0.6a1) (2024-09-11)
## [0.0.7a1](https://github.com/OpenVoiceOS/ovos-messagebus/tree/0.0.7a1) (2024-11-05)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-messagebus/compare/V...0.0.6a1)
[Full Changelog](https://github.com/OpenVoiceOS/ovos-messagebus/compare/0.0.6...0.0.7a1)

**Merged pull requests:**

- fix:readme\_full\_path [\#32](https://github.com/OpenVoiceOS/ovos-messagebus/pull/32) ([JarbasAl](https://github.com/JarbasAl))
- chore:semver\_versioning [\#31](https://github.com/OpenVoiceOS/ovos-messagebus/pull/31) ([JarbasAl](https://github.com/JarbasAl))
- chore:semver\_automations [\#30](https://github.com/OpenVoiceOS/ovos-messagebus/pull/30) ([JarbasAl](https://github.com/JarbasAl))

## [V](https://github.com/OpenVoiceOS/ovos-messagebus/tree/V) (2024-03-10)
**Closed issues:**

[Full Changelog](https://github.com/OpenVoiceOS/ovos-messagebus/compare/V0.0.4...V)
- Add configuration option for filtered logs [\#24](https://github.com/OpenVoiceOS/ovos-messagebus/issues/24)

**Merged pull requests:**

- chore\(docs\): add a long description to PyPi [\#28](https://github.com/OpenVoiceOS/ovos-messagebus/pull/28) ([mikejgray](https://github.com/mikejgray))
- fix: allow latest bus client version [\#34](https://github.com/OpenVoiceOS/ovos-messagebus/pull/34) ([JarbasAl](https://github.com/JarbasAl))
- feat\(performance\): configurable filter [\#29](https://github.com/OpenVoiceOS/ovos-messagebus/pull/29) ([mikejgray](https://github.com/mikejgray))



Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ messagebus service, the nervous system of OpenVoiceOS
## Alternative implementations

- [OVOS Bus Server](https://github.com/OpenVoiceOS/ovos-bus-server/) - Alternative C++ messagebus server implementation using WebSocket++

- [OVOS Rust Messagebus](https://github.com/OscillateLabsLLC/ovos-rust-messagebus) - Alternative Rust messagebus server implementation

# Configuration

Expand All @@ -21,8 +21,12 @@ under mycroft.conf
"ssl": false,
// in mycroft-core all skills share a bus, this allows malicious skills
// to manipulate it and affect other skills, this option ensures each skill
// gets it's own websocket connection
"shared_connection": true
// gets its own websocket connection
"shared_connection": true,
// filter out messages of certain types from the bus logs
"filter": false,
// which messages to filter if filter is enabled
"filter_logs": ["gui.status.request", "gui.page.upload"]
}
}
```
```
52 changes: 33 additions & 19 deletions ovos_messagebus/event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,45 @@ def __init__(self, application, request, **kwargs):
def on(self, event_name, handler):
self.emitter.on(event_name, handler)

@property
def filter(self) -> bool:
return Configuration().get("websocket", {}).get("filter", False)

@property
def filter_logs(self) -> list:
return Configuration().get("websocket", {}).get("filter_logs", ["gui.status.request", "gui.page.upload"])

@property
def max_message_size(self) -> int:
return Configuration().get("websocket", {}).get("max_msg_size", 10) * 1024 * 1024

def on_message(self, message):
if not self.filter:
try:
self.emitter.emit(message)
except Exception as e:
LOG.exception(e)
traceback.print_exc(file=sys.stdout)
pass
else:
try:
deserialized_message = Message.deserialize(message)
except Exception:
return

if deserialized_message.msg_type not in self.filter_logs:
LOG.debug(deserialized_message.msg_type +
f' source: {deserialized_message.context.get("source", [])}' +
f' destination: {deserialized_message.context.get("destination", [])}\n'
f'SESSION: {SessionManager.get(deserialized_message).serialize()}')

try:
deserialized_message = Message.deserialize(message)
except Exception:
return

filter_ogs = ["gui.status.request", "gui.page.upload"]
if deserialized_message.msg_type not in filter_ogs:
LOG.debug(deserialized_message.msg_type +
f' source: {deserialized_message.context.get("source", [])}' +
f' destination: {deserialized_message.context.get("destination", [])}\n'
f'SESSION: {SessionManager.get(deserialized_message).serialize()}')

try:
self.emitter.emit(deserialized_message.msg_type,
deserialized_message)
except Exception as e:
LOG.exception(e)
traceback.print_exc(file=sys.stdout)
pass
try:
self.emitter.emit(deserialized_message.msg_type,
deserialized_message)
except Exception as e:
LOG.exception(e)
traceback.print_exc(file=sys.stdout)
pass

for client in client_connections:
client.write_message(message)
Expand Down
4 changes: 2 additions & 2 deletions ovos_messagebus/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# START_VERSION_BLOCK
VERSION_MAJOR = 0
VERSION_MINOR = 0
VERSION_BUILD = 6
VERSION_ALPHA = 0
VERSION_BUILD = 7
VERSION_ALPHA = 1
# END_VERSION_BLOCK
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tornado~=6.0, >=6.0.3
ovos_bus_client>=0.0.7,<1.0.0
ovos_bus_client>=0.0.7,<2.0.0
ovos-utils>=0.0.37,<1.0.0
ovos-config>=0.0.12,<1.0.0

0 comments on commit 52f7cf4

Please sign in to comment.