feat: emit "parsed" cloud events for OCS TSCH messages#44
Draft
andrewdolce wants to merge 5 commits into
Draft
Conversation
- add needed deps to Trike for timestamp handling - ignore other ocs message types for now
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
Asana Ticket: Modify Trike to produce new parsed messages
This is a draft, but I would love to get feedback / a sanity check before I go further.
Changes:
Adds the
ocsdirectory, which contains modules for parsing the comma-delimited OCS format into Elixir structs representing the different message types. This was lifted directly from RTR, with a few modifications to remove things we likely wouldn't want Trike doing (like mapping lat/long to a list of location IDs.) The motivation in keeping it mostly unchanged from RTR is that I imagine potentially someday we might want a shared module with these struct definitions.Adds the
cloud_eventsdirectory, with modules for formatting the OCS types into JSON to match the proposed schema here. I built this in a way to try to support future cases where we might need to emit multiple versions of a given event, for backward compatibility.Modifies
cloud_events.exto emit both the original raw messages and the new parsed messages.I realize that splitting the OCS parsing and CloudEvent formatting into two layers might seem over-engineered, and there is maybe a lot of boilerplate, so definitely open to feedback on these points. Again, my reasons for doing it this way are to (1) potential for code reuse with RTR and (2) allowing for multiple versions of each cloud event.
Still TODO:
Reviewer Checklist