Skip to content

Commit 6d93396

Browse files
committed
catalog-protos: remove the old proto definitions
This commit removes the now unused proto definitions and cleans up the crate dependencies.
1 parent b4a522b commit 6d93396

19 files changed

+3
-13956
lines changed

Cargo.lock

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/buf.yaml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,6 @@ breaking:
1515
use:
1616
- WIRE
1717
ignore:
18-
# reason: does currently not require backward-compatibility
19-
- catalog-protos/protos/objects.proto
20-
# reason: does currently not require backward-compatibility
21-
- catalog-protos/protos/objects_v67.proto
22-
# reason: does currently not require backward-compatibility
23-
- catalog-protos/protos/objects_v68.proto
24-
# reason: does currently not require backward-compatibility
25-
- catalog-protos/protos/objects_v69.proto
26-
# reason: does currently not require backward-compatibility
27-
- catalog-protos/protos/objects_v70.proto
28-
# reason: does currently not require backward-compatibility
29-
- catalog-protos/protos/objects_v71.proto
30-
# reason: does currently not require backward-compatibility
31-
- catalog-protos/protos/objects_v72.proto
32-
# reason: does currently not require backward-compatibility
33-
- catalog-protos/protos/objects_v73.proto
34-
# reason: does currently not require backward-compatibility
35-
- catalog-protos/protos/objects_v74.proto
36-
# reason: does currently not require backward-compatibility
37-
- catalog-protos/protos/objects_v75.proto
38-
# reason: does currently not require backward-compatibility
39-
- catalog-protos/protos/objects_v76.proto
40-
# reason: does currently not require backward-compatibility
41-
- catalog-protos/protos/objects_v77.proto
42-
# reason: does currently not require backward-compatibility
43-
- catalog-protos/protos/objects_v78.proto
4418
# reason: Ignore because plans are currently not persisted.
4519
- expr/src/scalar.proto
4620
# reason: we very carefully evolve these protobuf definitions

src/catalog-protos/Cargo.toml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,18 @@ mz-repr = { path = "../repr" }
1717
mz-sql = { path = "../sql" }
1818
mz-storage-types = { path = "../storage-types" }
1919
num_enum = "0.7.4"
20-
paste = "1.0.11"
2120
proptest = { version = "1.9.0", default-features = false, features = ["std"] }
22-
proptest-derive = { version = "0.7.0", features = ["boxed_union"] }
23-
prost = "0.13.5"
21+
proptest-derive = "0.7.0"
2422
serde = { version = "1.0.219", features = ["derive"] }
2523
workspace-hack = { version = "0.0.0", path = "../workspace-hack", optional = true }
2624

2725
[dev-dependencies]
28-
mz-build-tools = { path = "../build-tools", default-features = false }
2926
mz-ore = { path = "../ore", features = ["test"] }
30-
mz-proto = { path = "../proto" }
31-
proptest = { version = "1.9.0", default-features = false, features = ["std"] }
3227
similar-asserts = "1.7"
3328

3429
[build-dependencies]
3530
anyhow = "1.0.100"
3631
md-5 = "0.10.6"
37-
mz-build-tools = { path = "../build-tools", default-features = false, features = ["protobuf-src"] }
38-
prost-build = "0.13.5"
3932
serde = { version = "1.0.219", features = ["derive"] }
4033
serde_json = "1.0.145"
4134

src/catalog-protos/build.rs

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/catalog-protos/protos/hashes.json

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)