Skip to content

feat: emit "parsed" cloud events for OCS TSCH messages#44

Draft
andrewdolce wants to merge 5 commits into
mainfrom
asd-ocs-parsed-messages
Draft

feat: emit "parsed" cloud events for OCS TSCH messages#44
andrewdolce wants to merge 5 commits into
mainfrom
asd-ocs-parsed-messages

Conversation

@andrewdolce

@andrewdolce andrewdolce commented Jun 12, 2025

Copy link
Copy Markdown

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 ocs directory, 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_events directory, 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.ex to 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:

  • Unit tests for the new message types
  • Add TMOV messages (this just pulls in TSCH for now)
  • (Likely) move parsing into its own supervised process and publish to separate kinesis stream

Reviewer Checklist

  • Any new or changed functions have typespecs
  • Tests were added for any new functionality (don't just rely on Lcov)
  • Meets ticket's acceptance criteria

@andrewdolce andrewdolce requested review from a team and rudiejd and removed request for a team June 13, 2025 17:31
@andrewdolce andrewdolce marked this pull request as draft June 13, 2025 17:32
@andrewdolce andrewdolce removed the request for review from rudiejd August 7, 2025 12:53
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.

1 participant