Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add AdvancedReport #1996

Open
wants to merge 52 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
0ee9cb7
substantial changes
kungfucraig Dec 15, 2024
ad75508
build update
kungfucraig Dec 15, 2024
98d6886
Api lint
kungfucraig Dec 16, 2024
e372bc4
format + made reporting media types plural
kungfucraig Dec 16, 2024
b79c9c5
remove advacned report
kungfucraig Dec 16, 2024
888f56c
updated from review
kungfucraig Dec 17, 2024
310bd97
added impression qualification server, lint errors, review comments
kungfucraig Dec 18, 2024
18ec175
revert formatting
kungfucraig Dec 18, 2024
cd1f57e
revert formatting
kungfucraig Dec 18, 2024
634421e
update from advanced report work
kungfucraig Jan 2, 2025
5e774d0
remove new build tagets
kungfucraig Jan 2, 2025
3f20aef
more from my review
kungfucraig Jan 2, 2025
209afe2
updated from review
kungfucraig Jan 3, 2025
83262be
page update
kungfucraig Jan 3, 2025
8adfb97
updates
kungfucraig Jan 3, 2025
b7e0bb1
remove stray text
kungfucraig Jan 3, 2025
eb03c30
updated tags
kungfucraig Jan 7, 2025
dd98768
Moved event filter into its own file and used it to define IQF.
kungfucraig Jan 7, 2025
98c041a
update page
kungfucraig Jan 8, 2025
8a89e04
updated page significantly
kungfucraig Jan 8, 2025
816cbed
Update documentation and update ReportingUnit and its Summary
kungfucraig Jan 9, 2025
773bfce
updated documentation
kungfucraig Jan 9, 2025
c062bab
Corrected order of build tagets
kungfucraig Jan 9, 2025
62e9554
updated copyright to be when files were first published
kungfucraig Jan 13, 2025
210c548
lint
kungfucraig Jan 13, 2025
3385747
updated from discussion with Origin - campaign group name, grouping d…
kungfucraig Jan 14, 2025
d1ad539
updates from review
kungfucraig Jan 16, 2025
0a04e6f
feat: Add protos for MC API Phase II.
kungfucraig Jan 8, 2025
dc72d67
Addressed TODOs
kungfucraig Jan 9, 2025
0b54e39
update documentation and EG summary
kungfucraig Jan 9, 2025
fa704e7
some lint + review comments
kungfucraig Jan 13, 2025
90bb3e3
lint and format
kungfucraig Jan 14, 2025
5a3a609
updated comment
kungfucraig Jan 14, 2025
771c2f5
builds after rebase
kungfucraig Jan 17, 2025
23d80fe
lint + typo
kungfucraig Jan 17, 2025
09e32b6
lint + typo
kungfucraig Jan 17, 2025
a530c01
substantial changes
kungfucraig Dec 15, 2024
b443a78
build update
kungfucraig Dec 15, 2024
382e327
Api lint
kungfucraig Dec 16, 2024
2d4e9c7
format + made reporting media types plural
kungfucraig Dec 16, 2024
3ff8dbe
updated from review
kungfucraig Dec 17, 2024
927b741
added impression qualification server, lint errors, review comments
kungfucraig Dec 18, 2024
2e18bff
update from advanced report work
kungfucraig Jan 2, 2025
7e3e3ec
more from my review
kungfucraig Jan 2, 2025
650e4e7
updated tags
kungfucraig Jan 7, 2025
040a95d
Moved event filter into its own file and used it to define IQF.
kungfucraig Jan 7, 2025
0688b16
update page
kungfucraig Jan 8, 2025
832f606
Update documentation and update ReportingUnit and its Summary
kungfucraig Jan 9, 2025
017647c
updated documentation
kungfucraig Jan 9, 2025
a8737b1
updated copyright to be when files were first published
kungfucraig Jan 13, 2025
8be88d7
phase III
kungfucraig Jan 8, 2025
79aa781
rebased
kungfucraig Jan 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 115 additions & 5 deletions src/main/proto/wfa/measurement/reporting/v2alpha/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,33 @@ IMPORT_PREFIX = "/src/main/proto"

# Resources and shared message types.

proto_library(
name = "advanced_report_proto",
srcs = ["advanced_report.proto"],
strip_import_prefix = IMPORT_PREFIX,
deps = [
":media_type_proto",
":metric_frequency_spec_proto",
":reporting_interval_proto",
":reporting_impression_qualification_filter_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
"@com_google_googleapis//google/type:dayofweek_proto",
"@com_google_protobuf//:timestamp_proto",
],
)

kt_jvm_proto_library(
name = "advanced_report_kt_jvm_proto",
deps = [":advanced_report_proto"],
)

proto_library(
name = "basic_report_proto",
srcs = ["basic_report.proto"],
strip_import_prefix = IMPORT_PREFIX,
deps = [
":media_type_proto",
":page_proto",
":reporting_impression_qualification_filter_proto",
":reporting_interval_proto",
Expand Down Expand Up @@ -229,6 +251,11 @@ kt_jvm_proto_library(
deps = [":report_schedule_iteration_proto"],
)

kt_jvm_proto_library(
name = "reporting_impression_qualification_filter_kt_jvm_proto",
deps = [":reporting_impression_qualification_filter_proto"],
)

proto_library(
name = "reporting_impression_qualification_filter_proto",
srcs = ["reporting_impression_qualification_filter.proto"],
Expand All @@ -240,11 +267,6 @@ proto_library(
],
)

kt_jvm_proto_library(
name = "reporting_impression_qualification_filter_kt_jvm_proto",
deps = [":reporting_impression_qualification_filter_proto"],
)

proto_library(
name = "reporting_interval_proto",
srcs = ["reporting_interval.proto"],
Expand All @@ -266,6 +288,7 @@ proto_library(
srcs = ["reporting_unit.proto"],
strip_import_prefix = IMPORT_PREFIX,
deps = [
":media_type_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
],
Expand Down Expand Up @@ -301,6 +324,25 @@ proto_library(
],
)

proto_library(
name = "operation_proto",
srcs = ["operation.proto"],
strip_import_prefix = IMPORT_PREFIX,
deps = [
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
"@com_google_googleapis//google/type:date_proto",
"@com_google_googleapis//google/type:datetime_proto",
"@com_google_googleapis//google/type:dayofweek_proto",
"@com_google_protobuf//:timestamp_proto",
],
)

kt_jvm_proto_library(
name = "operation_kt_jvm_proto",
deps = [":operation_proto"],
)

proto_library(
name = "page_proto",
srcs = ["page.proto"],
Expand All @@ -324,6 +366,22 @@ kt_jvm_proto_library(
deps = [":page_proto"],
)

proto_library(
name = "page_template_proto",
srcs = ["page_template.proto"],
strip_import_prefix = IMPORT_PREFIX,
deps = [
":page_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
],
)

kt_jvm_proto_library(
name = "page_template_kt_jvm_proto",
deps = [":page_template_proto"],
)

proto_library(
name = "page_token_proto",
srcs = ["page_token.proto"],
Expand All @@ -338,6 +396,30 @@ kt_jvm_proto_library(
)

# Services.
proto_library(
name = "advanced_reports_service_proto",
srcs = ["advanced_reports_service.proto"],
strip_import_prefix = IMPORT_PREFIX,
deps = [
":advanced_report_proto",
":operation_proto",
":page_proto",
":reporting_interval_proto",
":reporting_unit_proto",
"@com_google_googleapis//google/api:annotations_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_protobuf//:field_mask_proto",
"@com_google_protobuf//:timestamp_proto",
],
)

kt_jvm_grpc_proto_library(
name = "advanced_reports_service_kt_jvm_grpc_proto",
deps = [":advanced_reports_service_proto"],
)

proto_library(
name = "basic_reports_service_proto",
srcs = ["basic_reports_service.proto"],
Expand All @@ -347,7 +429,9 @@ proto_library(
"@com_google_googleapis//google/api:annotations_proto",
"@com_google_googleapis//google/api:client_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:field_info_proto",
"@com_google_googleapis//google/api:resource_proto",
"@com_google_googleapis//google/longrunning:operations_proto",
"@com_google_protobuf//:timestamp_proto",
],
)
Expand Down Expand Up @@ -432,6 +516,32 @@ kt_jvm_grpc_proto_library(
deps = [":metric_calculation_specs_service_proto"],
)

kt_jvm_grpc_proto_library(
name = "operations_service_kt_jvm_grpc_proto",
deps = ["@com_google_googleapis//google/longrunning:operations_proto",],
)

proto_library(
name = "page_templates_service_proto",
srcs = ["page_templates_service.proto"],
strip_import_prefix = IMPORT_PREFIX,
deps = [
":page_proto",
":page_template_proto",
":reporting_unit_proto",
"@com_google_googleapis//google/api:annotations_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_protobuf//:timestamp_proto",
],
)

kt_jvm_grpc_proto_library(
name = "page_templates_service_kt_jvm_grpc_proto",
deps = [":page_templates_service_proto"],
)

proto_library(
name = "reports_service_proto",
srcs = ["reports_service.proto"],
Expand Down
164 changes: 164 additions & 0 deletions src/main/proto/wfa/measurement/reporting/v2alpha/advanced_report.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
// Copyright 2024 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.

syntax = "proto3";

package wfa.measurement.reporting.v2alpha;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";
import "wfa/measurement/reporting/v2alpha/media_type.proto";
import "wfa/measurement/reporting/v2alpha/metric_frequency_spec.proto";
import "wfa/measurement/reporting/v2alpha/reporting_impression_qualification_filter.proto";
import "wfa/measurement/reporting/v2alpha/reporting_interval.proto";

option java_package = "org.wfanet.measurement.reporting.v2alpha";
option java_multiple_files = true;
option java_outer_classname = "AdvancedReportProto";

// Resource representing a AdvancedReport.
//
// When an AdvancedReport is created a suite of metrics is precomputed.
// Once complete these are made available via the Query method.
message AdvancedReport {
option (google.api.resource) = {
type: "reporting.halo-cmm.org/AdvancedReport"
pattern: "measurementConsumers/{measurement_consumer}/advancedReports/{advanced_report}"
singular: "advancedReport"
plural: "advancedReports"
};

// Resource name.
string name = 1 [(google.api.field_behavior) = IDENTIFIER];

// Human readable title of the report.
string title = 2 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = OPTIONAL
];

// The set of Reporting Sets for which the Advanced Report is
// created.
//
// The Reporting Sets must be either primitive or be a union of Reporting Sets
// that are either primitive or unions of other Reporting Sets. Filters may
// not be specified.
//
// Upon creation of the Advanced Report, any metric for any subset of these
// may be queried.
repeated string reporting_sets = 3 [
(google.api.resource_reference) = {
type: "reporting.halo-cmm.org/ReportingSet"
},
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = REQUIRED
];

// The interval that the Report spans
//
// The report_end is extended for live reports as new data
// becomes available.
ReportingInterval reporting_interval = 4
[(google.api.field_behavior) = REQUIRED];

// Specifies how to calculate precomputed report metrics
//
// This spec places limits on how the report can be queried after
// it is created. For example if the metric_frequency_specs only
// includes `total` then no metrics are computed for any subinterval of
// the report.
message CalculationSpec {
// The set of Media Types to report on. If empty report on all
// MediaTypes.
repeated MediaType media_types = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = UNORDERED_LIST
];

// The set of impression qualification filters to be applied.
//
// Defaults are appended as the Measurement Policy requires.
repeated ReportingImpressionQualificationFilter
impression_qualification_filters = 2 [
(google.api.field_behavior) = OPTIONAL,
(google.api.field_behavior) = IMMUTABLE
];

// The metric subintervals to include in the report
repeated MetricFrequencySpec metric_frequency_specs = 3
[(google.api.field_behavior) = IMMUTABLE];

// The maximum freuency to include in the report
int32 max_frequency = 4 [(google.api.field_behavior) = IMMUTABLE];
}
// Specifies how to precompute report metrics.
CalculationSpec calculation_spec = 5;

// Specifies whether and how the system tracks live campaigns.
//
// When live campaign tracking is enabled the system monitors the report's
// underlying Event Groups and appends new data as it becomes available.
message LiveCampaignTrackingSpec {
// Specifies whether and how to export data when new data arrives.
message ExportSpec {
// The PageTemplate to use for exporting results
//
// When instantiating the template, The ReportingUnit is taken to be
// the reporting_sets of the AdvancedReport.
string page_template = 1 [
(google.api.resource_reference) = {
type: "reporting.halo-cmm.org/PageTemplate"
},
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = REQUIRED
];

// If true, the exported data set will include data from the
// report's reporting_interval.start_time to the present. If
// false only new data is exported.
bool include_history = 2 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = OPTIONAL
];
}
// ExportSpec
ExportSpec export_spec = 1 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = OPTIONAL
];
}
// Specifies that live campaign tracking is enabled and options for
// how to handle newly arriving data.
//
// When enabled, metrics are appended as they become available,
// and if an export spec is present they are automatically exported as well.
LiveCampaignTrackingSpec live_campaign_tracking_spec = 6 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = OPTIONAL
];

// The time when the resource was created.
google.protobuf.Timestamp create_time = 7 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = OUTPUT_ONLY
];

// The time when the resource was last updated.
google.protobuf.Timestamp update_time = 8 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = OUTPUT_ONLY
];
}
Loading