Skip to content

Commit

Permalink
chore: add prow OWNERS file (#1231)
Browse files Browse the repository at this point in the history
* chore: add prow OWNERS file
* chore: add default approvers for other folders
* ci: fix build.rs
* ci: fix check.sh
  • Loading branch information
wuhuizuo authored Apr 12, 2024
1 parent f87719b commit 732e02a
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 2 deletions.
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
26 changes: 26 additions & 0 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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, overvenus]
sig-approvers-pb-import: [BornChanger, D3Hunter, lance6716]
sig-approvers-pb-cdc: [flowbehappy, overvenus]
sig-approvers-pb-config: [overvenus]
sig-approvers-pb-coprocessor: [cfzjywxk]
sig-approvers-pb-deadlock: [MyonKeminta, cfzjywxk]
sig-approvers-pb-debug: [cfzjywxk]
sig-approvers-pb-pd: [niubell, rleungx]
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]
"^configpb\\.proto$":
approvers: [sig-approvers-pb-config]
"^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]
"^enginepb\\.proto$":
approvers: [sig-approvers-pb-raftstore]
"^import_kvpb\\.proto$":
approvers: [sig-approvers-pb-import]
"^import_sstpb\\.proto$":
approvers: [sig-approvers-pb-import]
"^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]
"^pdpb\\.proto$":
approvers: [sig-approvers-pb-pd]
"^keyspacepb\\.proto$":
approvers: [sig-approvers-pb-pd]
"^schedulingpb\\.proto$":
approvers: [sig-approvers-pb-pd]
"^tsopb\\.proto$":
approvers: [sig-approvers-pb-pd]
"^meta_storagepb\\.proto$":
approvers: [sig-approvers-pb-pd]

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

# For rest files.
".*":
approvers: [sig-approvers-pb]
2 changes: 1 addition & 1 deletion scripts/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ 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] || exit 1
fi

if protolock status -lockdir=scripts -protoroot=proto; then
Expand Down

0 comments on commit 732e02a

Please sign in to comment.