Skip to content

Commit

Permalink
Replace TimeInterval with google.type.Interval.
Browse files Browse the repository at this point in the history
This should be a binary-compatible change.
  • Loading branch information
SanjayVas committed Jun 30, 2023
1 parent cf09cf3 commit f569c09
Show file tree
Hide file tree
Showing 12 changed files with 96 additions and 90 deletions.
30 changes: 5 additions & 25 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,38 +1,18 @@
workspace(name = "wfa_measurement_proto")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
load("//build:repositories.bzl", "wfa_measurement_proto_repositories")

http_archive(
name = "rules_proto",
sha256 = "d8992e6eeec276d49f1d4e63cfa05bbed6d4a26cfe6ca63c972827a0d141ea3b",
strip_prefix = "rules_proto-cfdc2fa31879c0aebe31ce7702b1a9c8a4be02d2",
urls = ["https://github.com/bazelbuild/rules_proto/archive/cfdc2fa31879c0aebe31ce7702b1a9c8a4be02d2.tar.gz"],
)
wfa_measurement_proto_repositories()

load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
load("//build:deps.bzl", "wfa_measurement_proto_deps")

rules_proto_dependencies()
wfa_measurement_proto_deps()

rules_proto_toolchains()
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

http_file(
name = "plantuml",
downloaded_file_path = "plantuml.jar",
sha256 = "3a659c3d87ea5ebac7aadb645233176c51d0290777ebc28285dd2a35dc947752",
urls = ["https://github.com/plantuml/plantuml/releases/download/v1.2023.4/plantuml-1.2023.4.jar"],
)

http_archive(
name = "com_google_googleapis",
sha256 = "65b3c3c4040ba3fc767c4b49714b839fe21dbe8467451892403ba90432bb5851",
strip_prefix = "googleapis-a1af63efb82f54428ab35ea76869d9cd57ca52b8",
urls = ["https://github.com/googleapis/googleapis/archive/a1af63efb82f54428ab35ea76869d9cd57ca52b8.tar.gz"],
)

# Google APIs imports. Required to build googleapis.
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")

switched_rules_by_language(
name = "com_google_googleapis_imports",
java = True,
)
Empty file added build/BUILD.bazel
Empty file.
33 changes: 33 additions & 0 deletions build/deps.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2023 The Cross-Media Measurement Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Transitive dependencies for this workspace."""

load(
"@rules_proto//proto:repositories.bzl",
"rules_proto_dependencies",
"rules_proto_toolchains",
)
load(
"@com_google_googleapis//:repository_rules.bzl",
"switched_rules_by_language",
)

def wfa_measurement_proto_deps():
rules_proto_dependencies()
rules_proto_toolchains()

switched_rules_by_language(
name = "com_google_googleapis_imports",
)
37 changes: 37 additions & 0 deletions build/repositories.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2023 The Cross-Media Measurement Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Direct repository dependencies for this workspace."""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

def wfa_measurement_proto_repositories():
maybe(
http_archive,
name = "rules_proto",
sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
strip_prefix = "rules_proto-5.3.0-21.7",
urls = [
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
],
)

maybe(
http_archive,
name = "com_google_googleapis",
sha256 = "70cdef593fbfe340d558ca10c6858b5c0410a54576381c422dc3b9158a12ba03",
strip_prefix = "googleapis-18becb1d1426feb7399db144d7beeb3284f1ccb0",
urls = ["https://github.com/googleapis/googleapis/archive/18becb1d1426feb7399db144d7beeb3284f1ccb0.tar.gz"],
)
20 changes: 5 additions & 15 deletions src/main/proto/wfa/measurement/api/v2alpha/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ proto_library(
srcs = ["requisition_spec.proto"],
strip_import_prefix = IMPORT_PREFIX,
deps = [
"//src/main/proto/wfa/measurement/api/v2alpha:time_interval_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
"@com_google_googleapis//google/type:interval_proto",
],
)

Expand Down Expand Up @@ -259,9 +259,9 @@ proto_library(
srcs = ["model_rollout.proto"],
strip_import_prefix = IMPORT_PREFIX,
deps = [
"//src/main/proto/wfa/measurement/api/v2alpha:time_interval_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
"@com_google_googleapis//google/type:interval_proto",
"@com_google_protobuf//:timestamp_proto",
],
)
Expand All @@ -272,10 +272,10 @@ proto_library(
strip_import_prefix = IMPORT_PREFIX,
deps = [
":model_rollout_proto",
"//src/main/proto/wfa/measurement/api/v2alpha:time_interval_proto",
"@com_google_googleapis//google/api:client_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
"@com_google_googleapis//google/type:interval_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:timestamp_proto",
],
Expand Down Expand Up @@ -333,9 +333,9 @@ proto_library(
srcs = ["model_outage.proto"],
strip_import_prefix = IMPORT_PREFIX,
deps = [
"//src/main/proto/wfa/measurement/api/v2alpha:time_interval_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
"@com_google_googleapis//google/type:interval_proto",
"@com_google_protobuf//:timestamp_proto",
],
)
Expand All @@ -346,10 +346,10 @@ proto_library(
strip_import_prefix = IMPORT_PREFIX,
deps = [
":model_outage_proto",
"//src/main/proto/wfa/measurement/api/v2alpha:time_interval_proto",
"@com_google_googleapis//google/api:client_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
"@com_google_googleapis//google/type:interval_proto",
],
)

Expand Down Expand Up @@ -573,13 +573,3 @@ proto_library(
"@com_google_googleapis//google/api:resource_proto",
],
)

proto_library(
name = "time_interval_proto",
srcs = ["time_interval.proto"],
strip_import_prefix = IMPORT_PREFIX,
deps = [
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_protobuf//:timestamp_proto",
],
)
10 changes: 5 additions & 5 deletions src/main/proto/wfa/measurement/api/v2alpha/model_outage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package wfa.measurement.api.v2alpha;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";
import "wfa/measurement/api/v2alpha/time_interval.proto";
import "google/type/interval.proto";

option java_package = "org.wfanet.measurement.api.v2alpha";
option java_multiple_files = true;
Expand All @@ -37,11 +37,11 @@ message ModelOutage {
// Resource name.
string name = 1;

// TimeInterval in which the parent `ModelLine` cannot be used to generate
// sketches. If a report spans across one or more `ModelOutage`s, the whole
// report must be generated using the parent `ModelLine`'s
// google.type.Interval in which the parent `ModelLine` cannot be used to
// generate sketches. If a report spans across one or more `ModelOutage`s, the
// whole report must be generated using the parent `ModelLine`'s
// `holdback_model_line`.
TimeInterval outage_interval = 2 [
google.type.Interval outage_interval = 2 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package wfa.measurement.api.v2alpha;
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/type/interval.proto";
import "wfa/measurement/api/v2alpha/model_outage.proto";
import "wfa/measurement/api/v2alpha/time_interval.proto";

option java_package = "org.wfanet.measurement.api.v2alpha";
option java_multiple_files = true;
Expand Down Expand Up @@ -92,7 +92,7 @@ message ListModelOutagesRequest {
// Filter criteria for a `ListModelOutages` request.
message Filter {
// Matches against the `outage_interval` of the `ModelOutage`.
TimeInterval outage_interval_overlapping = 1;
google.type.Interval outage_interval_overlapping = 1;
}
// Filter criteria for this request.
// (-- api-linter: core::0132::request-field-types=disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package wfa.measurement.api.v2alpha;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";
import "wfa/measurement/api/v2alpha/time_interval.proto";
import "google/type/interval.proto";

option java_package = "org.wfanet.measurement.api.v2alpha";
option java_multiple_files = true;
Expand All @@ -44,7 +44,7 @@ message ModelRollout {
// Time interval over which the rollout must be deployed. 'start_time' must
// be sufficiently in the future to allow for EDPs to sync with the Kingdom.
// 'end_time' cannot precede 'start_time'.
TimeInterval gradual_rollout_period = 8
google.type.Interval gradual_rollout_period = 8
[(google.api.field_behavior) = IMMUTABLE];

// In case of a rollout instantly deployed, instant_rollout_time must be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "google/type/interval.proto";
import "wfa/measurement/api/v2alpha/model_rollout.proto";
import "wfa/measurement/api/v2alpha/time_interval.proto";

option java_package = "org.wfanet.measurement.api.v2alpha";
option java_multiple_files = true;
Expand Down Expand Up @@ -94,7 +94,7 @@ message ListModelRolloutsRequest {
message Filter {
// Only 'ModelRollout's having 'rollout_period' overlapping
// 'rollout_period_overlapping' are returned.
TimeInterval rollout_period_overlapping = 1;
google.type.Interval rollout_period_overlapping = 1;
}
// Filter criteria for this request.
// (-- api-linter: core::0132::request-field-types=disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ message Requisition {
// The specification/configuration for the `Requisition` is invalid.
//
// For example, `encrypted_requisition_spec` includes an invalid
// `TimeInterval` (with `end_time` before `start_time`) or some
// `google.type.Interval` (with `end_time` before `start_time`) or some
// configuration that the `DataProvider` does not support.
SPEC_INVALID = 2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package wfa.measurement.api.v2alpha;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "wfa/measurement/api/v2alpha/time_interval.proto";
import "google/type/interval.proto";

option java_package = "org.wfanet.measurement.api.v2alpha";
option java_multiple_files = true;
Expand All @@ -44,7 +44,9 @@ message RequisitionSpec {
// Value of an `EventGroupEntry`.
message Value {
// Time interval over which the event data should be collected.
TimeInterval collection_interval = 1
//
// Both `start_time` and `end_time` must be specified.
google.type.Interval collection_interval = 1
[(google.api.field_behavior) = REQUIRED];

// Filter to apply to events. If not specified then all events will be
Expand Down
36 changes: 0 additions & 36 deletions src/main/proto/wfa/measurement/api/v2alpha/time_interval.proto

This file was deleted.

0 comments on commit f569c09

Please sign in to comment.