Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Commit cad6ae4

Browse files
committed
chore: Update proto file and add copy script
1 parent 04b816b commit cad6ae4

2 files changed

Lines changed: 29 additions & 7 deletions

File tree

copy-proto.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -eu
3+
4+
# Copies proto files from the main repo, assumed to be ../contract-case
5+
6+
cp ../contract-case/packages/case-connector/proto/contract_case_stream.proto src/main/proto

src/main/proto/contract_case_stream.proto

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ message ContractCaseConfig {
3232
TriggerFunctionHandle trigger_and_test = 14;
3333

3434
google.protobuf.StringValue base_url_under_test =
35-
15; // Long term, this will be moved
35+
15; // Long term, this will be moved
3636
}
3737

3838
// Indicates a successful response with no payload
@@ -237,47 +237,63 @@ message ResultResponse {
237237
message DefinitionRequest {
238238
google.protobuf.StringValue id = 1;
239239
oneof kind {
240-
// From user calls
240+
// Host language wants to begin a definition
241241
BeginDefinitionRequest begin_definition = 2;
242+
// Host language wants to run an example that returns success
242243
RunExampleRequest run_example = 3;
244+
// Host language wants to run an example that returns a failure
243245
RunRejectingExampleRequest run_rejecting_example = 4;
246+
// Host language wants to strip the matchers from a defintion
244247
StripMatchersRequest strip_matchers = 5;
248+
// Host langauge has finished the definition
245249
EndDefinitionRequest end_definition = 6;
246-
// Answering server driven RPC calls
250+
// Core returns a response to a host call
247251
ResultResponse result_response = 7;
248252
}
249253
}
250254

251255
message BeginVerificationRequest {
256+
// The configuration for this verification
252257
ContractCaseConfig config = 1;
258+
// Version strings of all ContractCase components for maintainer logs
253259
repeated google.protobuf.StringValue caller_versions = 4;
254260
}
255261

256262
message AvailableContractDefinitions {
257263
}
258264

259265
message RunVerification {
266+
// Any configuration overrides for this verification
260267
ContractCaseConfig config = 1;
261268
}
262269

263270
message StartTestEvent {
271+
// The name of this test (human readable)
264272
google.protobuf.StringValue test_name = 1;
273+
// An ID for a callback to the test invoker when the core is ready
265274
google.protobuf.StringValue invoker_id = 2;
266275
}
267276

268277
message InvokeTest {
278+
// Callback ID from the host language in a start test event
279+
// Used by the core to invoke a specific test
269280
google.protobuf.StringValue invoker_id = 1;
270281
}
271282

272283
message VerificationRequest {
273284
google.protobuf.StringValue id = 1;
274285
oneof kind {
275-
// From user calls
286+
// Host language wants to start a verification session
287+
// Used to do initial setup by the core - must be called before
288+
// run_verification
276289
BeginVerificationRequest begin_verification = 2;
290+
// Host language wants to know what contracts are available
277291
AvailableContractDefinitions available_contract_definitions = 3;
292+
// Host language wants to run a verification
278293
RunVerification run_verification = 4;
279-
// Answering server driven RPC calls
294+
// Core is responding to a host call
280295
ResultResponse result_response = 5;
296+
// Core wants to invoke a specific test
281297
InvokeTest invoke_test = 9;
282298
}
283299
}
@@ -306,8 +322,8 @@ message ContractResponse {
306322

307323
service ContractCase {
308324
rpc ContractDefinition(stream DefinitionRequest)
309-
returns (stream ContractResponse) {}
325+
returns (stream ContractResponse) {}
310326

311327
rpc ContractVerification(stream VerificationRequest)
312-
returns (stream ContractResponse) {}
328+
returns (stream ContractResponse) {}
313329
}

0 commit comments

Comments
 (0)