diff --git a/api/stovepipe/proto/stovepipe.proto b/api/stovepipe/proto/stovepipe.proto index 59d6319e..b403ab65 100644 --- a/api/stovepipe/proto/stovepipe.proto +++ b/api/stovepipe/proto/stovepipe.proto @@ -126,7 +126,9 @@ message ProjectValidation { // Stable consumer-defined project identifier. string project = 1; // Breakage degree on [0.0, 1.0]. Zero is green; absence means no result is recorded yet. - optional double breakage_degree = 2; + oneof result { + double breakage_degree = 2; + } } // GetProjectStatusByURIResponse contains the selected validation's current projection. @@ -144,7 +146,9 @@ message GetProjectStatusByURIResponse { // Unix millisecond timestamp of the newest durable lifecycle or result record. int64 updated_at_ms = 10; // Whole-repository breakage degree. Absent until the result is durable. - optional double repository_breakage_degree = 6; + oneof repository_result { + double repository_breakage_degree = 6; + } // True after the implementation has durably finished producing relevant project results. bool project_results_complete = 7; // Recorded results for requested projects. diff --git a/api/stovepipe/protopb/stovepipe.pb.go b/api/stovepipe/protopb/stovepipe.pb.go index e0753690..da2a7b42 100644 --- a/api/stovepipe/protopb/stovepipe.pb.go +++ b/api/stovepipe/protopb/stovepipe.pb.go @@ -709,9 +709,13 @@ type ProjectValidation struct { // Stable consumer-defined project identifier. Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` // Breakage degree on [0.0, 1.0]. Zero is green; absence means no result is recorded yet. - BreakageDegree *float64 `protobuf:"fixed64,2,opt,name=breakage_degree,json=breakageDegree,proto3,oneof" json:"breakage_degree,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // + // Types that are valid to be assigned to Result: + // + // *ProjectValidation_BreakageDegree + Result isProjectValidation_Result `protobuf_oneof:"result"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ProjectValidation) Reset() { @@ -751,13 +755,32 @@ func (x *ProjectValidation) GetProject() string { return "" } +func (x *ProjectValidation) GetResult() isProjectValidation_Result { + if x != nil { + return x.Result + } + return nil +} + func (x *ProjectValidation) GetBreakageDegree() float64 { - if x != nil && x.BreakageDegree != nil { - return *x.BreakageDegree + if x != nil { + if x, ok := x.Result.(*ProjectValidation_BreakageDegree); ok { + return x.BreakageDegree + } } return 0 } +type isProjectValidation_Result interface { + isProjectValidation_Result() +} + +type ProjectValidation_BreakageDegree struct { + BreakageDegree float64 `protobuf:"fixed64,2,opt,name=breakage_degree,json=breakageDegree,proto3,oneof"` +} + +func (*ProjectValidation_BreakageDegree) isProjectValidation_Result() {} + // GetProjectStatusByURIResponse contains the selected validation's current projection. type GetProjectStatusByURIResponse struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -774,7 +797,11 @@ type GetProjectStatusByURIResponse struct { // Unix millisecond timestamp of the newest durable lifecycle or result record. UpdatedAtMs int64 `protobuf:"varint,10,opt,name=updated_at_ms,json=updatedAtMs,proto3" json:"updated_at_ms,omitempty"` // Whole-repository breakage degree. Absent until the result is durable. - RepositoryBreakageDegree *float64 `protobuf:"fixed64,6,opt,name=repository_breakage_degree,json=repositoryBreakageDegree,proto3,oneof" json:"repository_breakage_degree,omitempty"` + // + // Types that are valid to be assigned to RepositoryResult: + // + // *GetProjectStatusByURIResponse_RepositoryBreakageDegree + RepositoryResult isGetProjectStatusByURIResponse_RepositoryResult `protobuf_oneof:"repository_result"` // True after the implementation has durably finished producing relevant project results. ProjectResultsComplete bool `protobuf:"varint,7,opt,name=project_results_complete,json=projectResultsComplete,proto3" json:"project_results_complete,omitempty"` // Recorded results for requested projects. @@ -857,9 +884,18 @@ func (x *GetProjectStatusByURIResponse) GetUpdatedAtMs() int64 { return 0 } +func (x *GetProjectStatusByURIResponse) GetRepositoryResult() isGetProjectStatusByURIResponse_RepositoryResult { + if x != nil { + return x.RepositoryResult + } + return nil +} + func (x *GetProjectStatusByURIResponse) GetRepositoryBreakageDegree() float64 { - if x != nil && x.RepositoryBreakageDegree != nil { - return *x.RepositoryBreakageDegree + if x != nil { + if x, ok := x.RepositoryResult.(*GetProjectStatusByURIResponse_RepositoryBreakageDegree); ok { + return x.RepositoryBreakageDegree + } } return 0 } @@ -885,6 +921,17 @@ func (x *GetProjectStatusByURIResponse) GetNextPageToken() string { return "" } +type isGetProjectStatusByURIResponse_RepositoryResult interface { + isGetProjectStatusByURIResponse_RepositoryResult() +} + +type GetProjectStatusByURIResponse_RepositoryBreakageDegree struct { + RepositoryBreakageDegree float64 `protobuf:"fixed64,6,opt,name=repository_breakage_degree,json=repositoryBreakageDegree,proto3,oneof"` +} + +func (*GetProjectStatusByURIResponse_RepositoryBreakageDegree) isGetProjectStatusByURIResponse_RepositoryResult() { +} + var File_stovepipe_proto protoreflect.FileDescriptor const file_stovepipe_proto_rawDesc = "" + @@ -931,11 +978,11 @@ const file_stovepipe_proto_rawDesc = "" + "\bprojects\x18\x03 \x03(\tR\bprojects\x12\x1b\n" + "\tpage_size\x18\x04 \x01(\x05R\bpageSize\x12\x1d\n" + "\n" + - "page_token\x18\x05 \x01(\tR\tpageToken\"o\n" + + "page_token\x18\x05 \x01(\tR\tpageToken\"b\n" + "\x11ProjectValidation\x12\x18\n" + - "\aproject\x18\x01 \x01(\tR\aproject\x12,\n" + - "\x0fbreakage_degree\x18\x02 \x01(\x01H\x00R\x0ebreakageDegree\x88\x01\x01B\x12\n" + - "\x10_breakage_degree\"\xe6\x03\n" + + "\aproject\x18\x01 \x01(\tR\aproject\x12)\n" + + "\x0fbreakage_degree\x18\x02 \x01(\x01H\x00R\x0ebreakageDegreeB\b\n" + + "\x06result\"\xd9\x03\n" + "\x1dGetProjectStatusByURIResponse\x12\x1d\n" + "\n" + "request_id\x18\x01 \x01(\tR\trequestId\x12\x14\n" + @@ -945,12 +992,12 @@ const file_stovepipe_proto_rawDesc = "" + "\bbase_uri\x18\x04 \x01(\tR\abaseUri\x12#\n" + "\rrequest_state\x18\x05 \x01(\tR\frequestState\x12\"\n" + "\rupdated_at_ms\x18\n" + - " \x01(\x03R\vupdatedAtMs\x12A\n" + - "\x1arepository_breakage_degree\x18\x06 \x01(\x01H\x00R\x18repositoryBreakageDegree\x88\x01\x01\x128\n" + + " \x01(\x03R\vupdatedAtMs\x12>\n" + + "\x1arepository_breakage_degree\x18\x06 \x01(\x01H\x00R\x18repositoryBreakageDegree\x128\n" + "\x18project_results_complete\x18\a \x01(\bR\x16projectResultsComplete\x12I\n" + "\bprojects\x18\b \x03(\v2-.uber.submitqueue.stovepipe.ProjectValidationR\bprojects\x12&\n" + - "\x0fnext_page_token\x18\t \x01(\tR\rnextPageTokenB\x1d\n" + - "\x1b_repository_breakage_degree2\x81\x05\n" + + "\x0fnext_page_token\x18\t \x01(\tR\rnextPageTokenB\x13\n" + + "\x11repository_result2\x81\x05\n" + "\tStovepipe\x12[\n" + "\x04Ping\x12'.uber.submitqueue.stovepipe.PingRequest\x1a(.uber.submitqueue.stovepipe.PingResponse\"\x00\x12a\n" + "\x06Ingest\x12).uber.submitqueue.stovepipe.IngestRequest\x1a*.uber.submitqueue.stovepipe.IngestResponse\"\x00\x12\x8e\x01\n" + @@ -1018,8 +1065,12 @@ func file_stovepipe_proto_init() { (*HistoryEvent_RequestState)(nil), (*HistoryEvent_Event)(nil), } - file_stovepipe_proto_msgTypes[11].OneofWrappers = []any{} - file_stovepipe_proto_msgTypes[12].OneofWrappers = []any{} + file_stovepipe_proto_msgTypes[11].OneofWrappers = []any{ + (*ProjectValidation_BreakageDegree)(nil), + } + file_stovepipe_proto_msgTypes[12].OneofWrappers = []any{ + (*GetProjectStatusByURIResponse_RepositoryBreakageDegree)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/api/stovepipe/protopb/stovepipe.pb.yarpc.go b/api/stovepipe/protopb/stovepipe.pb.yarpc.go index 351649b4..6ee99fee 100644 --- a/api/stovepipe/protopb/stovepipe.pb.yarpc.go +++ b/api/stovepipe/protopb/stovepipe.pb.yarpc.go @@ -426,62 +426,61 @@ var ( var yarpcFileDescriptorClosurefabdb6b3c0b09022 = [][]byte{ // stovepipe.proto []byte{ - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0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, 0x4d, 0x5c, 0xab, 0x12, 0x7f, 0x59, 0xf0, 0xf1, 0xd6, + 0x5d, 0x44, 0x9e, 0xd6, 0xe5, 0xa9, 0x7b, 0x92, 0x7a, 0x5f, 0xdf, 0x22, 0xb2, 0x6a, 0xe8, 0x6f, + 0x0b, 0x8e, 0xb7, 0x6f, 0x2e, 0xf2, 0xbe, 0x79, 0x97, 0x1b, 0xa8, 0xf7, 0xcd, 0x6d, 0x42, 0x37, + 0x41, 0x7a, 0x77, 0x9c, 0xaf, 0x05, 0x69, 0xe7, 0x4e, 0xbc, 0x16, 0xa4, 0xdd, 0xbb, 0xc3, 0x6b, + 0x8c, 0x11, 0x1e, 0x44, 0x2c, 0xa9, 0xc9, 0x30, 0xee, 0x56, 0x14, 0x9d, 0xc9, 0x9f, 0xab, 0x99, + 0xf5, 0xeb, 0x97, 0x0b, 0x2a, 0xce, 0x8b, 0xf9, 0x30, 0x62, 0xc9, 0x48, 0x06, 0x8e, 0x56, 0x02, + 0x47, 0x61, 0x46, 0x47, 0x55, 0xf0, 0x48, 0xfd, 0x8f, 0x65, 0xf3, 0x79, 0x4b, 0x7d, 0x7c, 0xf5, + 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x73, 0xcf, 0xe5, 0xeb, 0xab, 0x09, 0x00, 0x00, }, } diff --git a/service/stovepipe/server/mapper/project_status.go b/service/stovepipe/server/mapper/project_status.go index d7aac92c..705841dc 100644 --- a/service/stovepipe/server/mapper/project_status.go +++ b/service/stovepipe/server/mapper/project_status.go @@ -44,14 +44,18 @@ func GetProjectStatusByURIResultToProto(result entity.GetProjectStatusByURIResul NextPageToken: result.NextPageToken, } if result.HasRepositoryValidationFact { - response.RepositoryBreakageDegree = &result.RepositoryValidationFact.Degree + response.RepositoryResult = &pb.GetProjectStatusByURIResponse_RepositoryBreakageDegree{ + RepositoryBreakageDegree: result.RepositoryValidationFact.Degree, + } } response.Projects = make([]*pb.ProjectValidation, 0, len(result.ProjectValidationFacts)) for _, fact := range result.ProjectValidationFacts { degree := fact.Degree response.Projects = append(response.Projects, &pb.ProjectValidation{ - Project: fact.Project, - BreakageDegree: °ree, + Project: fact.Project, + Result: &pb.ProjectValidation_BreakageDegree{ + BreakageDegree: degree, + }, }) } return response diff --git a/service/stovepipe/server/mapper/project_status_test.go b/service/stovepipe/server/mapper/project_status_test.go index 7df2f03f..6cb46467 100644 --- a/service/stovepipe/server/mapper/project_status_test.go +++ b/service/stovepipe/server/mapper/project_status_test.go @@ -40,12 +40,32 @@ func TestProjectStatusRequestAndResponseMapping(t *testing.T) { }) assert.Equal(t, "request/1", response.GetRequestId()) assert.Equal(t, "succeeded", response.GetRequestState()) - assert.Equal(t, °ree, response.RepositoryBreakageDegree) + assert.Equal(t, degree, response.GetRepositoryBreakageDegree()) + assert.IsType(t, &pb.GetProjectStatusByURIResponse_RepositoryBreakageDegree{}, response.GetRepositoryResult()) assert.False(t, response.GetProjectResultsComplete()) if !assert.Len(t, response.GetProjects(), 1) { return } assert.Equal(t, "project-a", response.GetProjects()[0].GetProject()) assert.Equal(t, entity.DegreeBroken, response.GetProjects()[0].GetBreakageDegree()) + assert.IsType(t, &pb.ProjectValidation_BreakageDegree{}, response.GetProjects()[0].GetResult()) assert.Equal(t, "next-token", response.GetNextPageToken()) } + +func TestProjectStatusMappingPreservesExplicitGreenResults(t *testing.T) { + response := GetProjectStatusByURIResultToProto(entity.GetProjectStatusByURIResult{ + HasRepositoryValidationFact: true, + RepositoryValidationFact: entity.ValidationFact{ + Degree: entity.DegreeGreen, + }, + ProjectValidationFacts: []entity.ValidationFact{{ + Project: "project-a", + Degree: entity.DegreeGreen, + }}, + }) + + assert.IsType(t, &pb.GetProjectStatusByURIResponse_RepositoryBreakageDegree{}, response.GetRepositoryResult()) + if assert.Len(t, response.GetProjects(), 1) { + assert.IsType(t, &pb.ProjectValidation_BreakageDegree{}, response.GetProjects()[0].GetResult()) + } +}