Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to use API v2 Protocol Buffer Messages #613

Open
15 of 21 tasks
brentru opened this issue Aug 5, 2024 · 0 comments
Open
15 of 21 tasks

Refactor to use API v2 Protocol Buffer Messages #613

brentru opened this issue Aug 5, 2024 · 0 comments
Assignees
Labels
Milestone

Comments

@brentru
Copy link
Member

brentru commented Aug 5, 2024

Replace existing protocol buffer message decoding and encoding implementations with an implementation compatible with api-v2 throughout the library. Also, update the function signatures and logic for encoding/decoding as needed.

The list of tasks below is subject to change during this process.

Documentation Tasks
I need to mentally untangle the codebase and map it out before I'm ready to refactor.

  • Document the location of each pb_encode/pb_decode call, what it specifically does, and where it is located.
  • Identify which PBs from api-v2 are not presenting any breaking changes
  • Identify which PBs from api-v2 will present breaking changes
  • Organize components with breaking changes from least impact to greatest
  • Identify which components we won't be touching or changing - things that don't have anything to do with the PBs.

Non-breaking, refactor Tasks

Refactor for "Top-Level Decoding" Logic
The new API switches us from listening to a unique mqtt topic per component to two "high-level mqtt topics" and a top-level pb message

  • Refactor registration process to use new check-in API #619
  • Replace old decoding logic with a new, top-level decoder. Similar to the "router" we used in WipperSnapper Python
  • Test w/protomq that the new top-level decoder properly sends messages to each of the component types
    • May require WITL (Wokwi in the Loop) testing to ensure each component type is successfully decoded

Refactor for "Top Level Encoding" Logic
Similar task to above, but in reverse for encoding

  • Replace old encoding logic with a new, top-level encoder.
  • Test w/protomq that the new top-level encoder properly sends messages to the broker
    • May require WITL (Wokwi in the Loop) testing to ensure each component type is successfully encoded

Update each component
Each component's decoder/encoder will need to be refactored to match the new top-level encoding/decoding logic, new MQTT topics, and refactored PB message structs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant