@@ -112,86 +112,6 @@ fn main() -> anyhow::Result<()> {
112112 write ! ( & mut file, "\n " ) . context ( "writing newline" ) ?;
113113 }
114114
115- // Generate protos!
116- let paths: Vec < _ > = to_persist
117- . iter ( )
118- . map ( |entry| format ! ( "protos/{}" , entry. name) )
119- . collect ( ) ;
120-
121- const ATTR : & str = "#[derive(Eq, PartialOrd, Ord, ::serde::Serialize, ::serde::Deserialize)]" ;
122- const ARBITRARY_ATTR : & str = "#[derive(::proptest_derive::Arbitrary)]" ;
123-
124- // 'as' is okay here because we're using it to define the type of the empty slice, which is
125- // necessary since the method takes the slice as a generic arg.
126- #[ allow( clippy:: as_conversions) ]
127- // DO NOT change how JSON serialization works for these objects. The catalog relies on the JSON
128- // serialization of these objects remaining stable for a specific objects_vX version. If you
129- // want to change the JSON serialization format then follow these steps:
130- //
131- // 1. Create a new version of the `objects.proto` file.
132- // 2. Update the path of .proto files given to this compile block so that it is only the
133- // previous .proto files.
134- // 3. Add a new `prost_build::Config::new()...compile_protos(...)` block that only compiles
135- // the new and all future .proto files with the changed JSON serialization.
136- //
137- // Once we delete all the `.proto` that use the old JSON serialization, then we can delete
138- // the compile block for them as well.
139- prost_build:: Config :: new ( )
140- . protoc_executable ( mz_build_tools:: protoc ( ) )
141- . btree_map ( [ "." ] )
142- . bytes ( [ "." ] )
143- . message_attribute ( "." , ATTR )
144- // Note(parkmycar): This is annoying, but we need to manually specify each oneof so we can
145- // get them to implement Eq, PartialEq, and Ord. If you define a new oneof you should add
146- // it here.
147- . enum_attribute ( "CatalogItem.value" , ATTR )
148- . enum_attribute ( "ClusterConfig.variant" , ATTR )
149- . enum_attribute ( "GlobalId.value" , ATTR )
150- . enum_attribute ( "CatalogItemId.value" , ATTR )
151- . enum_attribute ( "ClusterId.value" , ATTR )
152- . enum_attribute ( "DatabaseId.value" , ATTR )
153- . enum_attribute ( "SchemaId.value" , ATTR )
154- . enum_attribute ( "ReplicaId.value" , ATTR )
155- . enum_attribute ( "RoleId.value" , ATTR )
156- . enum_attribute ( "NetworkPolicyId.value" , ATTR )
157- . enum_attribute ( "NetworkPolicyRule.action" , ATTR )
158- . enum_attribute ( "NetworkPolicyRule.direction" , ATTR )
159- . enum_attribute ( "ReplicaConfig.location" , ATTR )
160- . enum_attribute ( "AuditLogEventV1.details" , ATTR )
161- . enum_attribute ( "AuditLogKey.event" , ATTR )
162- . enum_attribute ( "StorageUsageKey.usage" , ATTR )
163- . enum_attribute ( "ResolvedDatabaseSpecifier.value" , ATTR )
164- . enum_attribute ( "CommentKey.object" , ATTR )
165- . enum_attribute ( "CommentKey.sub_component" , ATTR )
166- . enum_attribute ( "ResolvedDatabaseSpecifier.spec" , ATTR )
167- . enum_attribute ( "SchemaSpecifier.spec" , ATTR )
168- . enum_attribute ( "RoleVars.Entry.val" , ATTR )
169- . enum_attribute ( "StateUpdateKind.kind" , ATTR )
170- . enum_attribute ( "ClusterScheduleOptionValue.value" , ATTR )
171- . enum_attribute ( "ClusterSchedule.value" , ATTR )
172- . enum_attribute ( "CreateOrDropClusterReplicaReasonV1.reason" , ATTR )
173- . enum_attribute ( "RefreshDecisionWithReasonV1.decision" , ATTR )
174- . enum_attribute ( "RefreshDecisionWithReasonV2.decision" , ATTR )
175- // Serialize/deserialize the top-level enum in the persist-backed
176- // catalog as "internally tagged"[^1] to set up persist pushdown
177- // statistics for success.
178- //
179- // [^1]: https://serde.rs/enum-representations.html#internally-tagged
180- . enum_attribute ( "StateUpdateKind.kind" , "#[serde(tag = \" kind\" )]" )
181- // We derive Arbitrary for all protobuf types for wire compatibility testing.
182- . message_attribute ( "." , ARBITRARY_ATTR )
183- . enum_attribute ( "." , ARBITRARY_ATTR )
184- . compile_protos (
185- & paths,
186- & [ /*
187- This is purposefully empty, and we should never
188- add any includes because we don't want to allow
189- our protos to have dependencies. This allows us
190- to ensure our snapshots can't silently change.
191- */
192- ] as & [ & str ] ,
193- ) ?;
194-
195115 Ok ( ( ) )
196116}
197117
0 commit comments