orbitalci / orbital

Orbital is a self-hosted CI system for solo/small consulting dev teams. Written in Rust.
GNU General Public License v3.0
29 stars 2 forks source link

storage package: Add layer of abstraction between database and protobufs #209

Closed tjtelan closed 4 years ago

tjtelan commented 5 years ago

Our serialization models are too complicated.

We use protobufs and json interchangeably, and we pass protobuf types as parameters to functions and to the database. It is making it difficult to make changes to protos without cascading failures.

The overall goal is for the protobuf imports to only be in the model code. Nothing else should touch the protos.

As a starting point, anything that touches the storage package needs to stop using raw generated pb code. Instead, we can use native types for performing anything with logic, and whenever we need to make gRPC calls, we can convert to the protobuf representations, and on the receiving end, convert back to native types.