* Install buf with go install This reduces the impact of using buf on our dependency closure, which was significant. It also avoids potential issues with building buf given our own internal dependency constraints. This has caused issues (including crashes!) in the past. See https://github.com/cockroachdb/cockroach/issues/67216#issuecomment-874176186 for more discussion on using tool dependencies generally, and https://github.com/bufbuild/buf/issues/52 for an example of where this sort of thing caused an issue for a user. * Upgrade buf version We should migrate to v1 sooner rather than later, as it has some breaking changes from v0. * Change buf lint/breaking commands These commands were moved up one level for v1 * Migrate to buf.yaml to v1 * Remove unused imports These were uncovered by using "buf lint". * Use buf v1.3.1 * Depend on googleapis and grpc-gateway via BSR * Switch to buf for proto generation * Remove third party dependency * Remove unused tools and scripts * Move local protos up one level * Temporarily don't fail on breaking changes * Generate CI config * Fix generation of controller.json * Replace use of deprecated flag * Remove unused import, regenerate files * Remove temporary skipping over breaking check
51 lines
2.4 KiB
Protocol Buffer
51 lines
2.4 KiB
Protocol Buffer
syntax = "proto3";
|
|
package controller.custom_options.v1;
|
|
|
|
option go_package = "github.com/hashicorp/boundary/sdk/pbs/controller/protooptions;protooptions";
|
|
|
|
import "controller/custom_options/v1/options.proto";
|
|
|
|
message TestBase {
|
|
string first_field = 1 [(mask_mapping) = {this: "first_field" that: "OtherFirstField"}];
|
|
string StrangeFormatField = 2 [(mask_mapping) = {this: "strangly_formatted_field" that: "other_second_field"}];
|
|
string field_with_different_json_name = 3 [json_name="json_name", (mask_mapping) = {this: "field3" that:"other_field_3"}];
|
|
string extra_field = 4;
|
|
}
|
|
|
|
message TestBaseSplit1 {
|
|
string first_field = 1 [(mask_mapping) = {this: "first_field" that: "OtherFirstField"}];
|
|
string field_with_different_json_name = 2 [json_name="json_name", (mask_mapping) = {this: "field3" that:"other_field_3"}];
|
|
string extra_field = 3;
|
|
|
|
}
|
|
|
|
message TestBaseSplit2 {
|
|
string split_field1 = 1 [(mask_mapping) = {this: "strangly_formatted_field" that: "other_second_field"}];
|
|
}
|
|
|
|
message TestProperlyNamedFields {
|
|
string other_first_field = 1 [(mask_mapping) = {this: "OtherFirstField" that:"first_field"}];
|
|
string other_second_field = 2 [(mask_mapping) = {this: "other_second_field" that:"strangly_formatted_field"}];
|
|
string other_third_field = 3 [json_name="other_third_field", (mask_mapping) = {this: "other_field_3" that: "field3"}];
|
|
string another_extra_field = 4;
|
|
}
|
|
|
|
message TestNameDoesntMap {
|
|
string first_doesnt_map = 1 [(mask_mapping) = {this: "first_doesnt_map" that: "first_field"}];
|
|
string second_doesnt_map = 2 [(mask_mapping) = {this: "second_doesnt_map" that:"StrangeFormatField"}];
|
|
string third_doesnt_map = 3 [(mask_mapping) = {this: "third_doesnt_map" that:"field_with_different_json_name"}];
|
|
string another_extra_field = 4;
|
|
}
|
|
|
|
message TestNotEnoughFields {
|
|
string other_first_field = 1 [(mask_mapping) = {this: "OtherFirstField" that:"first_field"}];
|
|
string other_second_field = 2 [(mask_mapping) = {this: "other_second_field" that:"strangly_formatted_field"}];
|
|
}
|
|
|
|
message TestManyToOneMappings {
|
|
string other_first_field = 1 [(mask_mapping) = {this: "OtherFirstField" that:"first_field"}];
|
|
string other_second_field = 2 [(mask_mapping) = {this: "other_second_field" that:"strangly_formatted_field"}];
|
|
string other_third_field = 3 [(mask_mapping) = {this: "other_field_3" that: "field3"}];
|
|
// this field maps to the first_field like 'other_first_field'
|
|
string extra_field = 4 [(mask_mapping) = {this: "ExtraField" that:"first_field"}];
|
|
} |