Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# See the OWNERS docs at https://go.k8s.io/owners
approvers:
- sig-approvers
23 changes: 23 additions & 0 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Sort the member alphabetically.
aliases:
sig-approvers: # default approvers for the repo on rest folders.
- cfzjywxk
- lance6716
- overvenus
- you06
- YuJuncen
sig-approvers-pb: # default approvers for `proto` folder
- kevin-xialiu
- yudongusa
- zhangjinpeng1987
sig-approvers-pb-autoid: [bb7133, tiancaiamao]
sig-approvers-pb-br: [BornChanger]
sig-approvers-pb-cdc: [flowbehappy]
sig-approvers-pb-coprocessor: [cfzjywxk]
sig-approvers-pb-deadlock: [MyonKeminta, cfzjywxk]
sig-approvers-pb-debug: [cfzjywxk]
sig-approvers-pb-raftstore: [tonyxuqqi, overvenus]
sig-approvers-pb-tikv: [tonyxuqqi]
sig-approvers-pb-error: [cfzjywxk]
sig-approvers-pb-kvrpc: [cfzjywxk]
sig-approvers-pb-trace: [you06]
19 changes: 18 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,27 @@
// limitations under the License.

use protobuf_build::Builder;
use std::fs;

fn main() {
let proto_dir = "proto";
let mut proto_files = Vec::new();

// Walk the proto directory and collect all .proto files.
for entry in fs::read_dir(proto_dir).unwrap() {
let entry = entry.unwrap();
let path = entry.path();
if path.is_file() {
if let Some(ext) = path.extension() {
if ext == "proto" {
proto_files.push(path.to_string_lossy().into_owned());
}
}
}
}

Builder::new()
.search_dir_for_protos("proto")
.files(&proto_files)
.append_to_black_list("eraftpb")
.generate()
}
76 changes: 76 additions & 0 deletions proto/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# See the OWNERS docs at https://go.k8s.io/owners
options:
no_parent_owners: true
filters:
"^autoid\\.proto$":
approvers: [sig-approvers-pb-autoid]
"^brpb\\.proto$":
approvers: [sig-approvers-pb-br]
"^cdcpb\\.proto$":
approvers: [sig-approvers-pb-cdc]
"^coprocessor\\.proto$":
approvers: [sig-approvers-pb-coprocessor]
"^deadlock\\.proto$":
approvers: [sig-approvers-pb-deadlock]
"^debugpb\\.proto$":
approvers: [sig-approvers-pb-debug]
"^disk_usage\\.proto$":
approvers: [sig-approvers-pb-raftstore]
"^errorpb\\.proto$":
approvers: [sig-approvers-pb-error]
"^encryptionpb\\.proto$":
approvers: [sig-approvers-pb-raftstore]
"^import_kvpb\\.proto$":
approvers: [sig-approvers-pb-br]
"^import_sstpb\\.proto$":
approvers: [sig-approvers-pb-br]
"^kvrpcpb\\.proto$":
approvers: [sig-approvers-kvrpc]
"^logbackuppb\\.proto$":
approvers: [sig-approvers-pb-br]
"^metapb\\.proto$":
approvers: [sig-approvers-pb-raftstore]
"^raft_cmdpb\\.proto$":
approvers: [sig-approvers-pb-raftstore]
"^raft_serverpb\\.proto$":
approvers: [sig-approvers-pb-raftstore]
"^recoverdatapb\\.proto$":
approvers: [sig-approvers-pb-br]
"^resource_manager\\.proto$":
approvers: [sig-approvers-pb-raftstore]
"^tikvpb\\.proto$":
approvers: [sig-approvers-pb-tikv, sig-approvers-pb-kvprc]
"^tracepb\\.proto$":
approvers: [sig-approvers-pb-trace]

### If the special file need to be controlled by a SIG, please uncomment it and fill the approvers.
# "^configpb\\.proto$":
# approvers: []
# "^diagnosticspb\\.proto$":
# approvers: []
# "^disaggregated\\.proto$":
# approvers: []
# "^enginepb\\.proto$":
# approvers: []
# "^gcpb\\.proto$":
# approvers: []
# "^keyspacepb\\.proto$":
# approvers: []
# "^meta_storagepb\\.proto$":
# approvers: []
# "^mpp\\.proto$":
# approvers: []
# "^pdpb\\.proto$":
# approvers: []
# "^replication_modepb\\.proto$":
# approvers: []
# "^resource_usage_agent\\.proto$":
# approvers: []
# "^schedulingpb\\.proto$":
# approvers: []
# "^tsopb\\.proto$":
# approvers: []

# For rest files.
".*":
approvers: [sig-approvers-pb]
13 changes: 9 additions & 4 deletions scripts/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@ check-protos-compatible() {
export PATH=$GOPATH/bin:$PATH

if [ ! -f "$GOPATH/bin/protolock" ]; then
GO111MODULE=off go install github.com/nilslice/protolock/cmd/[email protected]
go install github.com/nilslice/protolock/cmd/[email protected]
fi
which protolock || {
echo "not found protolock in PATH."
ls -l "$GOPATH/bin/protolock"
exit 1
}

if protolock status -lockdir=scripts -protoroot=proto; then
protolock commit -lockdir=scripts -protoroot=proto
if protolock status -lockdir=scripts -protoroot=proto --ignore=OWNERS; then
protolock commit -lockdir=scripts -protoroot=proto --ignore=OWNERS
else
echo "Meet break compatibility problem, please check the code."
# In order not to block local branch development, when meet break compatibility will force to update `proto.lock`.
protolock commit --force -lockdir=scripts -protoroot=proto
protolock commit --force -lockdir=scripts -protoroot=proto --ignore=OWNERS
fi
# git report error like "fatal: detected dubious ownership in repository at" when reading the host's git folder
git config --global --add safe.directory $(pwd)
Expand Down