From e9c91448dcd44f61c5c6f36e0d018d2beabdd6b9 Mon Sep 17 00:00:00 2001 From: Denys Kuzmenko Date: Fri, 25 Sep 2026 13:23:33 +0300 Subject: [PATCH] TEZ-4758: Add a buf configuration so Yetus bufcompat/buflint can run - Yetus runs buf at the repository root with no config, so every cross-file import ("imported file does not exist" for import "DAGApiRecords.proto") fails and bufcompat votes -1 on the base branch before a patch is even applied. TEZ-4548 was the last proto change and predates the check; TEZ-4757 is the first patch to hit it - One module per main proto directory, so tez-dag can import tez-api and tez-runtime-internals; the test fixture proto in tez-ext-service-tests is not a module, it has no compatibility contract - breaking: WIRE. The payloads are internal wire messages; FILE would reject a same-number int32 -> int64 widening that is wire-compatible - lint: MINIMAL minus PACKAGE_DEFINED. No Tez proto declares a package, and adding one renames every generated type and every message's fully-qualified name on the wire - Verified with buf 1.50.0, the version Yetus rel/0.15.1 ships: build and lint clean on master, breaking clean for TEZ-4757 against master --- buf.yaml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 buf.yaml diff --git a/buf.yaml b/buf.yaml new file mode 100644 index 0000000000..675d8ea679 --- /dev/null +++ b/buf.yaml @@ -0,0 +1,47 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +--- +# buf configuration for the Yetus bufcompat and buflint checks. +# Each main proto directory is a module so cross-module imports resolve +# (tez-dag imports tez-api and tez-runtime-internals). Test fixtures are +# not modules. +version: v2 +modules: + - path: tez-api/src/main/proto + - path: tez-dag/src/main/proto + - path: tez-mapreduce/src/main/proto + - path: tez-plugins/tez-protobuf-history-plugin/src/main/proto + - path: tez-runtime-internals/src/main/proto + - path: tez-runtime-library/src/main/proto +lint: + use: + - MINIMAL + except: + # No Tez proto declares a package. Every file sets java_package, so + # adding one would not move the Java classes, but it changes every + # message's fully-qualified protobuf name -- descriptors, Any type + # URLs, what the history plugin persists -- which is not a lint fix. + - PACKAGE_DEFINED +breaking: + # Tez protos are RPC (DAGClientAMProtocol), events and payloads between + # components of one Tez build, or bytes the history plugin persists. + # What must hold is wire compatibility, not generated-code source + # compatibility: FILE would reject int32 -> int64 on the same field + # number, which the wire accepts. + use: + - WIRE