[registry] Add field no_replacement_metric

This will be used to document when a metric will not be migrated to
Cobalt 1.1

Later I will add a validation to ensure that projects with replacement
metrics can't add new Cobalt 1.0 metrics without also adding a new
replacement metric.

Change-Id: Ic69c8b586d88b4c21290f82bb5b5237451504c69
Reviewed-on: https://fuchsia-review.googlesource.com/c/cobalt/+/474154
Reviewed-by: Jared Weinstein <jaredweinstein@google.com>
Commit-Queue: Zach Bush <zmbush@google.com>
diff --git a/src/bin/config_parser/src/config_validator/metric_definitions.go b/src/bin/config_parser/src/config_validator/metric_definitions.go
index 3b17d1b..a837ee5 100644
--- a/src/bin/config_parser/src/config_validator/metric_definitions.go
+++ b/src/bin/config_parser/src/config_validator/metric_definitions.go
@@ -8,11 +8,12 @@
 	"config"
 	"config_parser"
 	"fmt"
-	"github.com/golang/protobuf/proto"
 	"net/mail"
 	"regexp"
 	"strings"
 	"time"
+
+	"github.com/golang/protobuf/proto"
 )
 
 // This file contains logic to validate lists of MetricDefinition protos.
@@ -125,6 +126,10 @@
 		return nil
 	}
 
+	if m.NoReplacementMetric != "" {
+		return fmt.Errorf("replacement_metric_id and no_replacement_metric cannot be set at the same time")
+	}
+
 	replacement, ok := mapping[m.ReplacementMetricId]
 	if !ok {
 		return fmt.Errorf("replacement_metric_id must refer to an extant metric (metric %v doesn't exist)", m.ReplacementMetricId)
diff --git a/src/registry/metric_definition.proto b/src/registry/metric_definition.proto
index fef337a..5e6e78b 100644
--- a/src/registry/metric_definition.proto
+++ b/src/registry/metric_definition.proto
@@ -30,7 +30,7 @@
 //
 // A MetricDefinition is used to define a Metric.
 //
-// Next ID: 24
+// Next ID: 25
 message MetricDefinition {
   reserved 6, 7, 9;
   reserved "event_codes", "max_event_code", "parts";
@@ -58,6 +58,8 @@
   // events that are logged to this metric will be mirrored to replacement_metric. This field should
   // be set only on 1.0 metrics, and include the metric_id of the replacement 1.1 metric.
   uint32 replacement_metric_id = 23;
+  // This field should be used to document why a metric is not being migrated to Cobalt 1.1.
+  string no_replacement_metric = 24 [(cobalt_options).hide_on_client = true];
 
   // A Metric has one of the following types.
   // Next ID: 12