Skip to content

Commit

Permalink
Move protos to sdk-core-protos (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
cole-h authored Nov 20, 2023
1 parent 2da4d2f commit 2878bab
Show file tree
Hide file tree
Showing 71 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ equivalent.

## Proto files

This repo uses a subtree for upstream protobuf files. The path `protos/api_upstream` is a
This repo uses a subtree for upstream protobuf files. The path `sdk-core-protos/protos/api_upstream` is a
subtree. To update it, use:

`git pull --squash -s subtree ssh://[email protected]/temporalio/api.git master --allow-unrelated-histories`
Expand All @@ -100,9 +100,9 @@ subdirectory of that repo, we just copy the files with read-tree:
# add sdk-java as a remote if you have not already
git remote add -f -t master --no-tags testsrv-protos [email protected]:temporalio/sdk-java.git
# delete existing protos
git rm -rf protos/testsrv_upstream
git rm -rf sdk-core-protos/protos/testsrv_upstream
# pull from upstream & commit
git read-tree --prefix protos/testsrv_upstream -u testsrv-protos/master:temporal-test-server/src/main/proto
git read-tree --prefix sdk-core-protos/protos/testsrv_upstream -u testsrv-protos/master:temporal-test-server/src/main/proto
git commit
```

Expand Down
8 changes: 4 additions & 4 deletions client/src/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1070,27 +1070,27 @@ mod tests {
fn verify_all_workflow_service_methods_implemented() {
// This is less work than trying to hook into the codegen process
let proto_def =
include_str!("../../protos/api_upstream/temporal/api/workflowservice/v1/service.proto");
include_str!("../../sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto");
verify_methods(proto_def, ALL_IMPLEMENTED_WORKFLOW_SERVICE_RPCS);
}

#[test]
fn verify_all_operator_service_methods_implemented() {
let proto_def =
include_str!("../../protos/api_upstream/temporal/api/operatorservice/v1/service.proto");
include_str!("../../sdk-core-protos/protos/api_upstream/temporal/api/operatorservice/v1/service.proto");
verify_methods(proto_def, ALL_IMPLEMENTED_OPERATOR_SERVICE_RPCS);
}

#[test]
fn verify_all_test_service_methods_implemented() {
let proto_def =
include_str!("../../protos/testsrv_upstream/temporal/api/testservice/v1/service.proto");
include_str!("../../sdk-core-protos/protos/testsrv_upstream/temporal/api/testservice/v1/service.proto");
verify_methods(proto_def, ALL_IMPLEMENTED_TEST_SERVICE_RPCS);
}

#[test]
fn verify_all_health_service_methods_implemented() {
let proto_def = include_str!("../../protos/grpc/health/v1/health.proto");
let proto_def = include_str!("../../sdk-core-protos/protos/grpc/health/v1/health.proto");
verify_methods(proto_def, ALL_IMPLEMENTED_HEALTH_SERVICE_RPCS);
}
}
20 changes: 10 additions & 10 deletions sdk-core-protos/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ static ALWAYS_SERDE: &str = "#[cfg_attr(not(feature = \"serde_serialize\"), \
derive(::serde::Serialize, ::serde::Deserialize))]";

fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("cargo:rerun-if-changed=../protos");
println!("cargo:rerun-if-changed=./protos");
let out = PathBuf::from(env::var("OUT_DIR").unwrap());
let descriptor_file = out.join("descriptors.bin");
tonic_build::configure()
Expand Down Expand Up @@ -115,17 +115,17 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.file_descriptor_set_path(#[allow(clippy::needless_borrow)] &descriptor_file)
.compile(
&[
"../protos/local/temporal/sdk/core/core_interface.proto",
"../protos/api_upstream/temporal/api/workflowservice/v1/service.proto",
"../protos/api_upstream/temporal/api/operatorservice/v1/service.proto",
"../protos/testsrv_upstream/temporal/api/testservice/v1/service.proto",
"../protos/grpc/health/v1/health.proto",
"./protos/local/temporal/sdk/core/core_interface.proto",
"./protos/api_upstream/temporal/api/workflowservice/v1/service.proto",
"./protos/api_upstream/temporal/api/operatorservice/v1/service.proto",
"./protos/testsrv_upstream/temporal/api/testservice/v1/service.proto",
"./protos/grpc/health/v1/health.proto",
],
&[
"../protos/api_upstream",
"../protos/local",
"../protos/testsrv_upstream",
"../protos/grpc",
"./protos/api_upstream",
"./protos/local",
"./protos/testsrv_upstream",
"./protos/grpc",
],
)?;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 2878bab

Please sign in to comment.