result_flow: refactor env parameters to request protos

BUG=chromium:1085958
TEST=./generate.sh

Change-Id: I0c43adb78519f27fb2362cd21366b9aa9768d36e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/infra/proto/+/2243903
Reviewed-by: Alex Zamorzaev <zamorzaev@chromium.org>
Commit-Queue: Xinan Lin <linxinan@chromium.org>
Tested-by: Xinan Lin <linxinan@chromium.org>
diff --git a/go/test_platform/result_flow/common.pb.go b/go/test_platform/result_flow/common.pb.go
index 558c69c..3c0da84 100644
--- a/go/test_platform/result_flow/common.pb.go
+++ b/go/test_platform/result_flow/common.pb.go
@@ -20,6 +20,46 @@
 // proto package needs to be updated.
 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
 
+// Values should be consistent with https://aip.dev/216
+type State int32
+
+const (
+	// Should not be used.
+	State_STATE_UNSPECIFIED State = 0
+	// Successfully executed the command.
+	State_SUCCEEDED State = 1
+	// Encountered failure during the run.
+	State_FAILED State = 2
+	// The command has hit the predefined deadline.
+	State_TIMED_OUT State = 3
+	// The command was aborted externally.
+	State_ABORTED State = 4
+)
+
+var State_name = map[int32]string{
+	0: "STATE_UNSPECIFIED",
+	1: "SUCCEEDED",
+	2: "FAILED",
+	3: "TIMED_OUT",
+	4: "ABORTED",
+}
+
+var State_value = map[string]int32{
+	"STATE_UNSPECIFIED": 0,
+	"SUCCEEDED":         1,
+	"FAILED":            2,
+	"TIMED_OUT":         3,
+	"ABORTED":           4,
+}
+
+func (x State) String() string {
+	return proto.EnumName(State_name, int32(x))
+}
+
+func (State) EnumDescriptor() ([]byte, []int) {
+	return fileDescriptor_8230a50564e8bbac, []int{0}
+}
+
 // PubSubConfig contains the config to interact with Pub/Sub.
 type PubSubConfig struct {
 	Project              string   `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
@@ -300,62 +340,13 @@
 	return nil
 }
 
-// Environment defines the configuration parameters common to
-//  the result_flow's subcommands.
-type Environment struct {
-	Source               *Source  `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"`
-	Target               *Target  `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"`
-	XXX_NoUnkeyedLiteral struct{} `json:"-"`
-	XXX_unrecognized     []byte   `json:"-"`
-	XXX_sizecache        int32    `json:"-"`
-}
-
-func (m *Environment) Reset()         { *m = Environment{} }
-func (m *Environment) String() string { return proto.CompactTextString(m) }
-func (*Environment) ProtoMessage()    {}
-func (*Environment) Descriptor() ([]byte, []int) {
-	return fileDescriptor_8230a50564e8bbac, []int{5}
-}
-
-func (m *Environment) XXX_Unmarshal(b []byte) error {
-	return xxx_messageInfo_Environment.Unmarshal(m, b)
-}
-func (m *Environment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_Environment.Marshal(b, m, deterministic)
-}
-func (m *Environment) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Environment.Merge(m, src)
-}
-func (m *Environment) XXX_Size() int {
-	return xxx_messageInfo_Environment.Size(m)
-}
-func (m *Environment) XXX_DiscardUnknown() {
-	xxx_messageInfo_Environment.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Environment proto.InternalMessageInfo
-
-func (m *Environment) GetSource() *Source {
-	if m != nil {
-		return m.Source
-	}
-	return nil
-}
-
-func (m *Environment) GetTarget() *Target {
-	if m != nil {
-		return m.Target
-	}
-	return nil
-}
-
 func init() {
+	proto.RegisterEnum("test_platform.result_flow.State", State_name, State_value)
 	proto.RegisterType((*PubSubConfig)(nil), "test_platform.result_flow.PubSubConfig")
 	proto.RegisterType((*BuildbucketConfig)(nil), "test_platform.result_flow.BuildbucketConfig")
 	proto.RegisterType((*BigqueryConfig)(nil), "test_platform.result_flow.BigqueryConfig")
 	proto.RegisterType((*Source)(nil), "test_platform.result_flow.Source")
 	proto.RegisterType((*Target)(nil), "test_platform.result_flow.Target")
-	proto.RegisterType((*Environment)(nil), "test_platform.result_flow.Environment")
 }
 
 func init() {
@@ -363,32 +354,35 @@
 }
 
 var fileDescriptor_8230a50564e8bbac = []byte{
-	// 432 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x4d, 0x6b, 0xdc, 0x30,
-	0x10, 0xc5, 0xde, 0xc4, 0x21, 0xb3, 0xa1, 0x50, 0x11, 0x82, 0x7b, 0xdb, 0xfa, 0xd0, 0xa6, 0x50,
-	0x6c, 0x48, 0x7b, 0x29, 0x14, 0x0a, 0xbb, 0xe4, 0x58, 0x28, 0x4a, 0x4f, 0xb9, 0x2c, 0x92, 0x57,
-	0x76, 0xd4, 0x5a, 0x1a, 0xaf, 0x3e, 0xd2, 0xf4, 0xdc, 0x3f, 0xd1, 0x5b, 0xff, 0x6a, 0xb1, 0x2c,
-	0x97, 0x5d, 0x4a, 0x36, 0x37, 0x3d, 0xcd, 0xbc, 0x37, 0x4f, 0x4f, 0x0c, 0xbc, 0x72, 0xc2, 0xba,
-	0x75, 0xdf, 0x31, 0xd7, 0xa0, 0x51, 0x95, 0x11, 0xd6, 0x77, 0x6e, 0xdd, 0x74, 0xf8, 0xa3, 0xaa,
-	0x51, 0x29, 0xd4, 0x65, 0x6f, 0xd0, 0x21, 0x79, 0xb1, 0xd7, 0x57, 0xee, 0xf4, 0x15, 0xbf, 0x13,
-	0x38, 0xfb, 0xe2, 0xf9, 0x8d, 0xe7, 0x2b, 0xd4, 0x8d, 0x6c, 0x49, 0x0e, 0x27, 0xbd, 0xc1, 0x6f,
-	0xa2, 0x76, 0x79, 0xb2, 0x48, 0x2e, 0x4f, 0xe9, 0x04, 0xc9, 0x39, 0x1c, 0x3b, 0xec, 0x65, 0x9d,
-	0xa7, 0xe1, 0x7e, 0x04, 0xa4, 0x80, 0x33, 0xeb, 0xb9, 0xad, 0x8d, 0xec, 0x9d, 0x44, 0x9d, 0xcf,
-	0x42, 0x71, 0xef, 0x8e, 0xbc, 0x87, 0x0b, 0xc5, 0x1e, 0xd6, 0x46, 0xd4, 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, 0x7e,
-	0xad, 0xef, 0xa5, 0x41, 0xad, 0x84, 0x1e, 0xa4, 0x32, 0x1b, 0x5e, 0x1d, 0xe5, 0x5e, 0x1e, 0x90,
-	0x1b, 0xe3, 0xa1, 0x91, 0x30, 0x50, 0x5d, 0xf0, 0x13, 0x5f, 0x7a, 0x88, 0x3a, 0x1a, 0xa7, 0x91,
-	0xb0, 0xbc, 0xbe, 0x5d, 0xb5, 0x58, 0xd6, 0x77, 0x06, 0x95, 0xf4, 0xaa, 0x44, 0xd3, 0x56, 0x13,
-	0x40, 0x5b, 0x49, 0xdd, 0x18, 0x56, 0x85, 0xed, 0xa8, 0x5a, 0xac, 0x1e, 0xdd, 0x23, 0x9e, 0x85,
-	0x9e, 0x77, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x82, 0xff, 0x66, 0x89, 0x6b, 0x03, 0x00, 0x00,
+	// 470 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0x4f, 0x6f, 0xd3, 0x40,
+	0x10, 0xc5, 0xb1, 0xd3, 0x38, 0xca, 0xa4, 0xa0, 0x74, 0x55, 0x2a, 0x73, 0x8b, 0x7c, 0x80, 0x82,
+	0x90, 0x2d, 0x15, 0x2e, 0x48, 0x48, 0x28, 0xb1, 0xb7, 0x52, 0x24, 0x4a, 0x2b, 0xdb, 0xb9, 0xf4,
+	0x62, 0xed, 0x3a, 0x1b, 0x77, 0xc1, 0xce, 0x3a, 0xfb, 0x07, 0xca, 0x37, 0xe1, 0xc6, 0x57, 0x45,
+	0x71, 0x6c, 0x94, 0x08, 0xb5, 0xdc, 0xfc, 0xdb, 0x99, 0x37, 0xf3, 0xf4, 0xd6, 0x0b, 0x2f, 0x35,
+	0x53, 0x3a, 0xab, 0x4b, 0xa2, 0x57, 0x42, 0x56, 0x81, 0x64, 0xca, 0x94, 0x3a, 0x5b, 0x95, 0xe2,
+	0x47,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, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x9d,
+	0x8c, 0x96, 0x3c, 0x03, 0x00, 0x00,
 }
diff --git a/go/test_platform/result_flow/ctp.pb.go b/go/test_platform/result_flow/ctp.pb.go
index 6917933..551c9e8 100644
--- a/go/test_platform/result_flow/ctp.pb.go
+++ b/go/test_platform/result_flow/ctp.pb.go
@@ -21,56 +21,16 @@
 // proto package needs to be updated.
 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
 
-// Values should be consistent with https://aip.dev/216
-type CTPResponse_State int32
-
-const (
-	// Should not be used.
-	CTPResponse_STATE_UNSPECIFIED CTPResponse_State = 0
-	// Successfully pulled the CTP build IDs from Pub/Sub.
-	CTPResponse_SUCCEEDED CTPResponse_State = 1
-	// Failed to pull the CTP build IDs.
-	CTPResponse_FAILED CTPResponse_State = 2
-	// CTP command has hit the predefined timeout.
-	CTPResponse_TIMED_OUT CTPResponse_State = 3
-	// CTP command was aborted externally.
-	CTPResponse_ABORTED CTPResponse_State = 4
-)
-
-var CTPResponse_State_name = map[int32]string{
-	0: "STATE_UNSPECIFIED",
-	1: "SUCCEEDED",
-	2: "FAILED",
-	3: "TIMED_OUT",
-	4: "ABORTED",
-}
-
-var CTPResponse_State_value = map[string]int32{
-	"STATE_UNSPECIFIED": 0,
-	"SUCCEEDED":         1,
-	"FAILED":            2,
-	"TIMED_OUT":         3,
-	"ABORTED":           4,
-}
-
-func (x CTPResponse_State) String() string {
-	return proto.EnumName(CTPResponse_State_name, int32(x))
-}
-
-func (CTPResponse_State) EnumDescriptor() ([]byte, []int) {
-	return fileDescriptor_0cd3889564661eb4, []int{1, 0}
-}
-
 // CTPRequest defines the input of `result_flow ctp`.
 type CTPRequest struct {
-	// How long the client could subscribe to the Pub/Sub.
-	// It should stop the subscription before the overall
-	// deadline.
-	SubscriptionDeadline *timestamp.Timestamp `protobuf:"bytes,1,opt,name=subscription_deadline,json=subscriptionDeadline,proto3" json:"subscription_deadline,omitempty"`
+	// The source config for fetching a CTP build.
+	Ctp *Source `protobuf:"bytes,1,opt,name=ctp,proto3" json:"ctp,omitempty"`
+	// The target to upload the result flow output.
+	TestPlanRun *Target `protobuf:"bytes,2,opt,name=test_plan_run,json=testPlanRun,proto3" json:"test_plan_run,omitempty"`
 	// Hard deadline for execution.
 	//
 	// CTP command should abort beyond this deadline.
-	Deadline             *timestamp.Timestamp `protobuf:"bytes,2,opt,name=deadline,proto3" json:"deadline,omitempty"`
+	Deadline             *timestamp.Timestamp `protobuf:"bytes,3,opt,name=deadline,proto3" json:"deadline,omitempty"`
 	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
 	XXX_unrecognized     []byte               `json:"-"`
 	XXX_sizecache        int32                `json:"-"`
@@ -101,9 +61,16 @@
 
 var xxx_messageInfo_CTPRequest proto.InternalMessageInfo
 
-func (m *CTPRequest) GetSubscriptionDeadline() *timestamp.Timestamp {
+func (m *CTPRequest) GetCtp() *Source {
 	if m != nil {
-		return m.SubscriptionDeadline
+		return m.Ctp
+	}
+	return nil
+}
+
+func (m *CTPRequest) GetTestPlanRun() *Target {
+	if m != nil {
+		return m.TestPlanRun
 	}
 	return nil
 }
@@ -120,10 +87,10 @@
 	// `result_flow ctp` exits with exit code 0 unless there is an
 	// infrastructure failure. When the exit code is 0, `state` indicates the
 	// best known state of the ctp command execution (see comments on State enum).
-	State                CTPResponse_State `protobuf:"varint,1,opt,name=state,proto3,enum=test_platform.result_flow.CTPResponse_State" json:"state,omitempty"`
-	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
-	XXX_unrecognized     []byte            `json:"-"`
-	XXX_sizecache        int32             `json:"-"`
+	State                State    `protobuf:"varint,1,opt,name=state,proto3,enum=test_platform.result_flow.State" json:"state,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
 }
 
 func (m *CTPResponse) Reset()         { *m = CTPResponse{} }
@@ -151,15 +118,14 @@
 
 var xxx_messageInfo_CTPResponse proto.InternalMessageInfo
 
-func (m *CTPResponse) GetState() CTPResponse_State {
+func (m *CTPResponse) GetState() State {
 	if m != nil {
 		return m.State
 	}
-	return CTPResponse_STATE_UNSPECIFIED
+	return State_STATE_UNSPECIFIED
 }
 
 func init() {
-	proto.RegisterEnum("test_platform.result_flow.CTPResponse_State", CTPResponse_State_name, CTPResponse_State_value)
 	proto.RegisterType((*CTPRequest)(nil), "test_platform.result_flow.CTPRequest")
 	proto.RegisterType((*CTPResponse)(nil), "test_platform.result_flow.CTPResponse")
 }
@@ -169,25 +135,22 @@
 }
 
 var fileDescriptor_0cd3889564661eb4 = []byte{
-	// 319 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0x41, 0x4b, 0xf3, 0x30,
-	0x18, 0x80, 0xbf, 0xee, 0x73, 0x53, 0x33, 0x94, 0x1a, 0x1c, 0xe8, 0x2e, 0xca, 0xbc, 0x78, 0x90,
-	0x04, 0x26, 0x78, 0xdf, 0x9a, 0x0c, 0x0a, 0xea, 0x46, 0x9b, 0x5e, 0xbc, 0x94, 0x6e, 0x4b, 0x6b,
-	0xa1, 0xed, 0x5b, 0x93, 0x14, 0x7f, 0x89, 0xff, 0xc1, 0x9f, 0x29, 0x6b, 0xb7, 0x51, 0x0f, 0xc3,
-	0xe3, 0x4b, 0x9e, 0xe7, 0xe1, 0x4d, 0x82, 0xee, 0x8c, 0xd4, 0x26, 0x2c, 0xb3, 0xc8, 0xc4, 0xa0,
-	0x72, 0xaa, 0xa4, 0xae, 0x32, 0x13, 0xc6, 0x19, 0x7c, 0xd2, 0x95, 0x29, 0x49, 0xa9, 0xc0, 0x00,
-	0xbe, 0xfe, 0x05, 0x91, 0x16, 0x34, 0xbc, 0x49, 0x00, 0x92, 0x4c, 0xd2, 0x1a, 0x5c, 0x56, 0x31,
-	0x35, 0x69, 0x2e, 0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cd, 0xfb, 0xd3, 0x04, 0xe8, 0xc1, 0xff, 0x5c, 0xf6, 0x6a,
-	0xe6, 0xf1, 0x27, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x02, 0x27, 0x77, 0xf3, 0x01, 0x00, 0x00,
+	// 271 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0xd0, 0xc1, 0x4a, 0xf4, 0x30,
+	0x10, 0x07, 0x70, 0xfa, 0x2d, 0x9f, 0x48, 0x8a, 0x1e, 0x7a, 0xaa, 0xbd, 0xb8, 0xae, 0x20, 0x9e,
+	0x12, 0xd8, 0x85, 0x7d, 0x00, 0x97, 0xde, 0x97, 0xd8, 0x93, 0x97, 0x92, 0xed, 0x4e, 0x63, 0x21,
+	0xc9, 0xd4, 0x64, 0x82, 0xaf, 0xe7, 0xa3, 0x49, 0x5b, 0x2b, 0x7a, 0xd8, 0xf5, 0x18, 0xf8, 0xcd,
+	0xe4, 0xff, 0x1f, 0x76, 0x4f, 0x10, 0xa8, 0xee, 0x8d, 0xa2, 0x16, 0xbd, 0x15, 0x1e, 0x42, 0x34,
+	0x54, 0xb7, 0x06, 0xdf, 0x45, 0x43, 0x3d, 0xef, 0x3d, 0x12, 0x66, 0x37, 0xbf, 0x10, 0xff, 0x81,
+	0x8a, 0x87, 0x33, 0xf3, 0x68, 0x2d, 0xba, 0x69, 0x45, 0x71, 0xab, 0x11, 0xb5, 0x01, 0x31, 0xbe,
+	0x0e, 0xb1, 0x15, 0xd4, 0x59, 0x08, 0xa4, 0xec, 0xd7, 0x1f, 0xab, 0x8f, 0x84, 0xb1, 0x5d, 0xb5,
+	0x97, 0xf0, 0x16, 0x21, 0x50, 0xb6, 0x61, 0x8b, 0x86, 0xfa, 0x3c, 0x59, 0x26, 0x8f, 0xe9, 0xfa,
+	0x8e, 0x9f, 0x0c, 0xc0, 0x9f, 0x31, 0xfa, 0x06, 0xe4, 0xa0, 0xb3, 0x92, 0x5d, 0xcd, 0xd0, 0xd5,
+	0x3e, 0xba, 0xfc, 0xdf, 0x9f, 0xe3, 0x95, 0xf2, 0x1a, 0x48, 0xa6, 0x83, 0xd8, 0x1b, 0xe5, 0x64,
+	0x74, 0xd9, 0x96, 0x5d, 0x1e, 0x41, 0x1d, 0x4d, 0xe7, 0x20, 0x5f, 0x8c, 0x1b, 0x0a, 0x3e, 0xc5,
+	0xe7, 0x73, 0x7c, 0x5e, 0xcd, 0xf1, 0xe5, 0xb7, 0x5d, 0x95, 0x2c, 0x1d, 0x1b, 0x84, 0x1e, 0x5d,
+	0x80, 0x6c, 0xcb, 0xfe, 0x07, 0x52, 0x04, 0x63, 0x89, 0xeb, 0xf5, 0xf2, 0x5c, 0x89, 0xc1, 0xc9,
+	0x89, 0x3f, 0x95, 0x2f, 0x3b, 0x8d, 0xbc, 0x79, 0xf5, 0x68, 0xbb, 0x68, 0x39, 0x7a, 0x2d, 0xe6,
+	0x07, 0x06, 0xd1, 0xb9, 0xd6, 0xab, 0xe9, 0x8c, 0x42, 0xa3, 0x38, 0x79, 0xfe, 0xc3, 0xc5, 0x68,
+	0x36, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4f, 0x80, 0xc8, 0x8e, 0xe2, 0x01, 0x00, 0x00,
 }
diff --git a/go/test_platform/result_flow/publish.pb.go b/go/test_platform/result_flow/publish.pb.go
index 2ef05f4..d821b68 100644
--- a/go/test_platform/result_flow/publish.pb.go
+++ b/go/test_platform/result_flow/publish.pb.go
@@ -21,54 +21,18 @@
 // proto package needs to be updated.
 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
 
-// Values should be consistent with https://aip.dev/216
-type PublishResponse_State int32
-
-const (
-	// Should not be used.
-	PublishResponse_STATE_UNSPECIFIED PublishResponse_State = 0
-	// Successfully published the build ID to Pub/Sub.
-	PublishResponse_SUCCEEDED PublishResponse_State = 1
-	// Failed to publish the build ID.
-	PublishResponse_FAILED PublishResponse_State = 2
-	// Publish has hit the predefined timeout.
-	PublishResponse_TIMED_OUT PublishResponse_State = 3
-	// The publish command was aborted externally.
-	PublishResponse_ABORTED PublishResponse_State = 4
-)
-
-var PublishResponse_State_name = map[int32]string{
-	0: "STATE_UNSPECIFIED",
-	1: "SUCCEEDED",
-	2: "FAILED",
-	3: "TIMED_OUT",
-	4: "ABORTED",
-}
-
-var PublishResponse_State_value = map[string]int32{
-	"STATE_UNSPECIFIED": 0,
-	"SUCCEEDED":         1,
-	"FAILED":            2,
-	"TIMED_OUT":         3,
-	"ABORTED":           4,
-}
-
-func (x PublishResponse_State) String() string {
-	return proto.EnumName(PublishResponse_State_name, int32(x))
-}
-
-func (PublishResponse_State) EnumDescriptor() ([]byte, []int) {
-	return fileDescriptor_c45128fac736122f, []int{1, 0}
-}
-
 // PublishRequest defines the input of `result_flow publish`.
 type PublishRequest struct {
 	BuildId       int64 `protobuf:"varint,1,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"`
 	ParentBuildId int64 `protobuf:"varint,2,opt,name=parent_build_id,json=parentBuildId,proto3" json:"parent_build_id,omitempty"`
+	// PubSub endpoint to publish a CTP build.
+	Ctp *PubSubConfig `protobuf:"bytes,3,opt,name=ctp,proto3" json:"ctp,omitempty"`
+	// PubSub endpoint to publish a test runner build.
+	TestRunner *PubSubConfig `protobuf:"bytes,4,opt,name=test_runner,json=testRunner,proto3" json:"test_runner,omitempty"`
 	// Hard deadline for execution.
 	//
 	// Publish command should abort beyond this deadline.
-	Deadline             *timestamp.Timestamp `protobuf:"bytes,3,opt,name=deadline,proto3" json:"deadline,omitempty"`
+	Deadline             *timestamp.Timestamp `protobuf:"bytes,5,opt,name=deadline,proto3" json:"deadline,omitempty"`
 	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
 	XXX_unrecognized     []byte               `json:"-"`
 	XXX_sizecache        int32                `json:"-"`
@@ -113,6 +77,20 @@
 	return 0
 }
 
+func (m *PublishRequest) GetCtp() *PubSubConfig {
+	if m != nil {
+		return m.Ctp
+	}
+	return nil
+}
+
+func (m *PublishRequest) GetTestRunner() *PubSubConfig {
+	if m != nil {
+		return m.TestRunner
+	}
+	return nil
+}
+
 func (m *PublishRequest) GetDeadline() *timestamp.Timestamp {
 	if m != nil {
 		return m.Deadline
@@ -125,10 +103,10 @@
 	// `result_flow publish` exits with exit code 0 unless there is an
 	// infrastructure failure. When the exit code is 0, `state` indicates the
 	// best known state of the publish execution (see comments on State enum).
-	State                PublishResponse_State `protobuf:"varint,1,opt,name=state,proto3,enum=test_platform.result_flow.PublishResponse_State" json:"state,omitempty"`
-	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
-	XXX_unrecognized     []byte                `json:"-"`
-	XXX_sizecache        int32                 `json:"-"`
+	State                State    `protobuf:"varint,1,opt,name=state,proto3,enum=test_platform.result_flow.State" json:"state,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
 }
 
 func (m *PublishResponse) Reset()         { *m = PublishResponse{} }
@@ -156,15 +134,14 @@
 
 var xxx_messageInfo_PublishResponse proto.InternalMessageInfo
 
-func (m *PublishResponse) GetState() PublishResponse_State {
+func (m *PublishResponse) GetState() State {
 	if m != nil {
 		return m.State
 	}
-	return PublishResponse_STATE_UNSPECIFIED
+	return State_STATE_UNSPECIFIED
 }
 
 func init() {
-	proto.RegisterEnum("test_platform.result_flow.PublishResponse_State", PublishResponse_State_name, PublishResponse_State_value)
 	proto.RegisterType((*PublishRequest)(nil), "test_platform.result_flow.PublishRequest")
 	proto.RegisterType((*PublishResponse)(nil), "test_platform.result_flow.PublishResponse")
 }
@@ -174,27 +151,25 @@
 }
 
 var fileDescriptor_c45128fac736122f = []byte{
-	// 340 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xcb, 0x6e, 0xe2, 0x30,
-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xcf, 0xec, 0xe2, 0xdd, 0x00, 0xe3, 0xb3, 0x8d, 0x2a, 0x45, 0xa1, 0x28,
-	0xdc, 0x82, 0x8e, 0xd2, 0x91, 0xa6, 0xb5, 0xcb, 0x68, 0x75, 0x83, 0x2e, 0xfe, 0x16, 0xfd, 0xa8,
-	0x22, 0xef, 0xd8, 0x73, 0x9b, 0xfa, 0x22, 0x00, 0x9d, 0x3a, 0xc3, 0x7f, 0xe0, 0xaf, 0xe7, 0xaf,
-	0x7d, 0x12, 0x06, 0x8f, 0xde, 0x9e, 0x58, 0xce, 0xd6, 0x21, 0xb6, 0xf9, 0x0b, 0x0e, 0xc1, 0x1f,
-	0x2f, 0xb0, 0x2c, 0x42, 0x6c, 0x62, 0x9b, 0x06, 0x04, 0xa0, 0xbb, 0x5d, 0x3b, 0xf7, 0xc4, 0x36,
-	0x5b, 0xc7, 0x2b, 0xdf, 0x79, 0x20, 0x76, 0xb8, 0x0b, 0x7c, 0xb3, 0x0d, 0x07, 0xa0, 0xb7, 0xde,
-	0xec, 0x5c, 0x9f, 0xd8, 0xe6, 0xef, 0x0d, 0x79, 0xb2, 0x32, 0x81, 0x9e, 0x0f, 0x52, 0xe4, 0xac,
-	0xca, 0x91, 0x90, 0x19, 0x3e, 0x05, 0xa1, 0x30, 0x2b, 0x52, 0x19, 0x35, 0xd3, 0xc7, 0x99, 0xc0,
-	0x17, 0x37, 0x1a, 0x77, 0x6b, 0xe6, 0xf6, 0x23, 0x00, 0x00, 0xff, 0xff, 0xf4, 0x90, 0xa2, 0xd2,
-	0xf5, 0x01, 0x00, 0x00,
+	// 312 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd1, 0x41, 0x6b, 0xc2, 0x30,
+	0x14, 0x07, 0x70, 0xd4, 0xb9, 0x49, 0x64, 0x0a, 0x3d, 0x55, 0x2f, 0x13, 0x0f, 0xea, 0x29, 0x01,
+	0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e, 0x0b, 0xab, 0xc9, 0x8a, 0xf4, 0x2a, 0x5e, 0x54, 0x52, 0x68,
+	0x9e, 0x76, 0x43, 0xcc, 0x98, 0xc6, 0x3a, 0xe8, 0xb9, 0x0e, 0xfa, 0x7a, 0xae, 0x23, 0xbb, 0xd8,
+	0xe9, 0x96, 0x0c, 0x2f, 0x8d, 0x38, 0x03, 0xda, 0xf1, 0x64, 0x45, 0xba, 0x0e, 0x0b, 0xe4, 0xa1,
+	0x8f, 0xc1, 0x72, 0xf2, 0xc7, 0xe7, 0xec, 0x4f, 0x2e, 0x8b, 0x7c, 0xfd, 0xfc, 0xb6, 0x69, 0x80,
+	0x1e, 0x8e, 0x16, 0x94, 0xf0, 0x8a, 0x82, 0x6d, 0xd8, 0x79, 0x00, 0xc7, 0x84, 0xae, 0x6d, 0x11,
+	0x4f, 0xc3, 0x1a, 0x60, 0x57, 0x4f, 0x5a, 0xde, 0x06, 0xf3, 0xf8, 0x15, 0x00, 0x00, 0xff, 0xff,
+	0x81, 0x9b, 0xd3, 0x0a, 0x3a, 0x02, 0x00, 0x00,
 }
diff --git a/src/test_platform/result_flow/common.proto b/src/test_platform/result_flow/common.proto
index bab85dc..2f3d10c 100644
--- a/src/test_platform/result_flow/common.proto
+++ b/src/test_platform/result_flow/common.proto
@@ -43,9 +43,16 @@
 	BigqueryConfig bq = 1;
 }
 
-// Environment defines the configuration parameters common to
-//  the result_flow's subcommands.
-message Environment {
-    Source source = 1;
-    Target target = 2;
+// Values should be consistent with https://aip.dev/216
+enum State {
+  // Should not be used.
+  STATE_UNSPECIFIED = 0;
+  // Successfully executed the command.
+  SUCCEEDED = 1;
+  // Encountered failure during the run.
+  FAILED = 2;
+  // The command has hit the predefined deadline.
+  TIMED_OUT = 3;
+  // The command was aborted externally.
+  ABORTED = 4;
 }
\ No newline at end of file
diff --git a/src/test_platform/result_flow/ctp.proto b/src/test_platform/result_flow/ctp.proto
index e7a3fc8..7117fed 100644
--- a/src/test_platform/result_flow/ctp.proto
+++ b/src/test_platform/result_flow/ctp.proto
@@ -8,36 +8,23 @@
 
 option go_package = "go.chromium.org/chromiumos/infra/proto/go/test_platform/result_flow";
 
+import "test_platform/result_flow/common.proto";
 import "google/protobuf/timestamp.proto";
 
 // CTPRequest defines the input of `result_flow ctp`.
 message CTPRequest {
-  // How long the client could subscribe to the Pub/Sub.
-  // It should stop the subscription before the overall
-  // deadline.
-  google.protobuf.Timestamp subscription_deadline = 1;
+  // The source config for fetching a CTP build.
+  Source ctp = 1;
+  // The target to upload the result flow output.
+  Target test_plan_run = 2;
   // Hard deadline for execution.
   //
   // CTP command should abort beyond this deadline.
-  google.protobuf.Timestamp deadline = 2;
+  google.protobuf.Timestamp deadline = 3;
 }
 
 // CTPResponse defines the output of `result_flow ctp`.
 message CTPResponse {
-  // Values should be consistent with https://aip.dev/216
-  enum State {
-    // Should not be used.
-    STATE_UNSPECIFIED = 0;
-    // Successfully pulled the CTP build IDs from Pub/Sub.
-    SUCCEEDED = 1;
-    // Failed to pull the CTP build IDs.
-    FAILED = 2;
-    // CTP command has hit the predefined timeout.
-    TIMED_OUT = 3;
-    // CTP command was aborted externally.
-    ABORTED = 4;
-  }
-
   // `result_flow ctp` exits with exit code 0 unless there is an
   // infrastructure failure. When the exit code is 0, `state` indicates the
   // best known state of the ctp command execution (see comments on State enum).
diff --git a/src/test_platform/result_flow/publish.proto b/src/test_platform/result_flow/publish.proto
index 41f0c92..c50aa15 100644
--- a/src/test_platform/result_flow/publish.proto
+++ b/src/test_platform/result_flow/publish.proto
@@ -8,34 +8,25 @@
 
 option go_package = "go.chromium.org/chromiumos/infra/proto/go/test_platform/result_flow";
 
+import "test_platform/result_flow/common.proto";
 import "google/protobuf/timestamp.proto";
 
 // PublishRequest defines the input of `result_flow publish`.
 message PublishRequest {
     int64 build_id = 1;
     int64 parent_build_id = 2;
+    // PubSub endpoint to publish a CTP build.
+    PubSubConfig ctp = 3;
+    // PubSub endpoint to publish a test runner build.
+    PubSubConfig test_runner = 4;
     // Hard deadline for execution.
     //
     // Publish command should abort beyond this deadline.
-    google.protobuf.Timestamp deadline = 3;
+    google.protobuf.Timestamp deadline = 5;
 }
 
 // PublishRequest defines the output of `result_flow publish`.
 message PublishResponse {
-    // Values should be consistent with https://aip.dev/216
-    enum State {
-      // Should not be used.
-      STATE_UNSPECIFIED = 0;
-      // Successfully published the build ID to Pub/Sub.
-      SUCCEEDED = 1;
-      // Failed to publish the build ID.
-      FAILED = 2;
-      // Publish has hit the predefined timeout.
-      TIMED_OUT = 3;
-      // The publish command was aborted externally.
-      ABORTED = 4;
-    }
-
     // `result_flow publish` exits with exit code 0 unless there is an
     // infrastructure failure. When the exit code is 0, `state` indicates the
     // best known state of the publish execution (see comments on State enum).