[kitchen] Remove use of --operational-arguments-path entirely.

Depends on https://chromium-review.googlesource.com/1404679 being
deployed everywhere.

R=jchinlee@chromium.org, martiniss@chromium.org, tandrii@chromium.org

Bug: 909848
Change-Id: Iaaa6d8fc5ac40551082947e115b7ff30ccad9b76
Reviewed-on: https://chromium-review.googlesource.com/c/1404718
Reviewed-by: Jao-ke Chin-Lee <jchinlee@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Cr-Commit-Position: refs/heads/master@{#19944}
Cr-Mirrored-Commit: d8f38ca9494b5af249942631f9cee45927f6b4bc
diff --git a/go/src/infra/tools/kitchen/cook.go b/go/src/infra/tools/kitchen/cook.go
index c578ae2..7981a71 100644
--- a/go/src/infra/tools/kitchen/cook.go
+++ b/go/src/infra/tools/kitchen/cook.go
@@ -44,10 +44,6 @@
 	CommandRun: func() subcommands.CommandRun {
 		var c cookRun
 
-		// Initialize our AnnotationFlags operational argument.
-		c.engine.opArgs.AnnotationFlags = &recipe_engine.Arguments_AnnotationFlags{}
-		c.engine.opArgs.EngineFlags = &recipe_engine.Arguments_EngineFlags{}
-
 		c.CookFlags.Register(&c.Flags)
 
 		return &c
diff --git a/go/src/infra/tools/kitchen/cook_logdog.go b/go/src/infra/tools/kitchen/cook_logdog.go
index c8f76d7..0114b54 100644
--- a/go/src/infra/tools/kitchen/cook_logdog.go
+++ b/go/src/infra/tools/kitchen/cook_logdog.go
@@ -80,9 +80,6 @@
 	// configured to log debug-level or lower.
 	disableGRPCLogging(ctx)
 
-	// We need to dump initial properties so our annotation stream includes them.
-	eng.opArgs.AnnotationFlags.EmitInitialProperties = true
-
 	// Construct our global tags. We will prefer user-supplied tags to our
 	// generated ones.
 	globalTags := make(map[string]string, len(flags.GlobalTags)+1)
diff --git a/go/src/infra/tools/kitchen/cook_test.go b/go/src/infra/tools/kitchen/cook_test.go
index 468974d..5eca029 100644
--- a/go/src/infra/tools/kitchen/cook_test.go
+++ b/go/src/infra/tools/kitchen/cook_test.go
@@ -190,7 +190,6 @@
 				So(actualRecipeInput, ShouldResemble, recipeInput{
 					Args: []string{
 						filepath.Join(checkoutPath, "recipes.py"),
-						"--operational-args-path", filepath.Join(kitchenTempDir, "rr", "op_args.json"),
 						"run",
 						"--properties-file", filepath.Join(kitchenTempDir, "rr", "properties.json"),
 						"--workdir", workdirPath,
diff --git a/go/src/infra/tools/kitchen/recipe.go b/go/src/infra/tools/kitchen/recipe.go
index 830dd53..82871d9 100644
--- a/go/src/infra/tools/kitchen/recipe.go
+++ b/go/src/infra/tools/kitchen/recipe.go
@@ -14,10 +14,7 @@
 
 	"golang.org/x/net/context"
 
-	"infra/tools/kitchen/third_party/recipe_engine"
-
 	"go.chromium.org/luci/common/errors"
-	log "go.chromium.org/luci/common/logging"
 	"go.chromium.org/luci/common/system/environ"
 	"go.chromium.org/luci/common/system/exitcode"
 )
@@ -28,11 +25,10 @@
 	// interpreter if necessary.
 	cmdPrefix []string
 
-	recipeName           string                  // name of the recipe
-	properties           map[string]interface{}  // input properties
-	opArgs               recipe_engine.Arguments // operational arguments for the recipe engine
-	workDir              string                  // a directory where to run the recipe
-	outputResultJSONFile string                  // path to the result file
+	recipeName           string                 // name of the recipe
+	properties           map[string]interface{} // input properties
+	workDir              string                 // a directory where to run the recipe
+	outputResultJSONFile string                 // path to the result file
 }
 
 // commandRun prepares a command that runs a recipe.
@@ -50,18 +46,10 @@
 		return nil, errors.Annotate(err, "could not write properties file at %q", propertiesPath).Err()
 	}
 
-	// Write our operational arguments.
-	log.Debugf(ctx, "Using operational args: %s", eng.opArgs.String())
-	opArgsPath := filepath.Join(tdir, "op_args.json")
-	if err := encodeJSONToPath(opArgsPath, &eng.opArgs); err != nil {
-		return nil, errors.Annotate(err, "could not write arguments file at %q", opArgsPath).Err()
-	}
-
 	// Build our command (arguments first).
 	args := []string{}
 	args = append(args, eng.cmdPrefix...)
 	args = append(args,
-		"--operational-args-path", opArgsPath,
 		"run",
 		"--properties-file", propertiesPath,
 		"--workdir", eng.workDir,
diff --git a/go/src/infra/tools/kitchen/testdata/recipe_repo/recipes.py b/go/src/infra/tools/kitchen/testdata/recipe_repo/recipes.py
index 1b16db2..210b4d1 100755
--- a/go/src/infra/tools/kitchen/testdata/recipe_repo/recipes.py
+++ b/go/src/infra/tools/kitchen/testdata/recipe_repo/recipes.py
@@ -13,7 +13,6 @@
 
 def main():
   parser = argparse.ArgumentParser()
-  parser.add_argument('--operational-args-path')
 
   subparsers = parser.add_subparsers()
   fetch_cmd = subparsers.add_parser('fetch')
diff --git a/go/src/infra/tools/kitchen/third_party/recipe_engine/arguments.pb.go b/go/src/infra/tools/kitchen/third_party/recipe_engine/arguments.pb.go
deleted file mode 100644
index 9ae0ad2..0000000
--- a/go/src/infra/tools/kitchen/third_party/recipe_engine/arguments.pb.go
+++ /dev/null
@@ -1,185 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: infra/tools/kitchen/third_party/recipe_engine/arguments.proto
-
-package recipe_engine
-
-import (
-	fmt "fmt"
-	proto "github.com/golang/protobuf/proto"
-	math "math"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
-// Arguments is a protobuf that can be supplied to the recipe engine through its
-// "--operational-args-path" command-line parameter in JSONPB format.
-type Arguments struct {
-	// Annotation control flags.
-	AnnotationFlags      *Arguments_AnnotationFlags `protobuf:"bytes,2,opt,name=annotation_flags,json=annotationFlags,proto3" json:"annotation_flags,omitempty"`
-	EngineFlags          *Arguments_EngineFlags     `protobuf:"bytes,4,opt,name=engine_flags,json=engineFlags,proto3" json:"engine_flags,omitempty"`
-	XXX_NoUnkeyedLiteral struct{}                   `json:"-"`
-	XXX_unrecognized     []byte                     `json:"-"`
-	XXX_sizecache        int32                      `json:"-"`
-}
-
-func (m *Arguments) Reset()         { *m = Arguments{} }
-func (m *Arguments) String() string { return proto.CompactTextString(m) }
-func (*Arguments) ProtoMessage()    {}
-func (*Arguments) Descriptor() ([]byte, []int) {
-	return fileDescriptor_a37baee6372b8245, []int{0}
-}
-
-func (m *Arguments) XXX_Unmarshal(b []byte) error {
-	return xxx_messageInfo_Arguments.Unmarshal(m, b)
-}
-func (m *Arguments) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_Arguments.Marshal(b, m, deterministic)
-}
-func (m *Arguments) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Arguments.Merge(m, src)
-}
-func (m *Arguments) XXX_Size() int {
-	return xxx_messageInfo_Arguments.Size(m)
-}
-func (m *Arguments) XXX_DiscardUnknown() {
-	xxx_messageInfo_Arguments.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Arguments proto.InternalMessageInfo
-
-func (m *Arguments) GetAnnotationFlags() *Arguments_AnnotationFlags {
-	if m != nil {
-		return m.AnnotationFlags
-	}
-	return nil
-}
-
-func (m *Arguments) GetEngineFlags() *Arguments_EngineFlags {
-	if m != nil {
-		return m.EngineFlags
-	}
-	return nil
-}
-
-// Message containing the set of supported annotation control flags.
-type Arguments_AnnotationFlags struct {
-	// If true, emit CURRENT_TIMESTAMP annotations.
-	EmitTimestamp bool `protobuf:"varint,1,opt,name=emit_timestamp,json=emitTimestamp,proto3" json:"emit_timestamp,omitempty"`
-	// If true, emit all input properties as annotations at the beginning of
-	// recipe engine execution.
-	EmitInitialProperties bool     `protobuf:"varint,2,opt,name=emit_initial_properties,json=emitInitialProperties,proto3" json:"emit_initial_properties,omitempty"`
-	XXX_NoUnkeyedLiteral  struct{} `json:"-"`
-	XXX_unrecognized      []byte   `json:"-"`
-	XXX_sizecache         int32    `json:"-"`
-}
-
-func (m *Arguments_AnnotationFlags) Reset()         { *m = Arguments_AnnotationFlags{} }
-func (m *Arguments_AnnotationFlags) String() string { return proto.CompactTextString(m) }
-func (*Arguments_AnnotationFlags) ProtoMessage()    {}
-func (*Arguments_AnnotationFlags) Descriptor() ([]byte, []int) {
-	return fileDescriptor_a37baee6372b8245, []int{0, 0}
-}
-
-func (m *Arguments_AnnotationFlags) XXX_Unmarshal(b []byte) error {
-	return xxx_messageInfo_Arguments_AnnotationFlags.Unmarshal(m, b)
-}
-func (m *Arguments_AnnotationFlags) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_Arguments_AnnotationFlags.Marshal(b, m, deterministic)
-}
-func (m *Arguments_AnnotationFlags) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Arguments_AnnotationFlags.Merge(m, src)
-}
-func (m *Arguments_AnnotationFlags) XXX_Size() int {
-	return xxx_messageInfo_Arguments_AnnotationFlags.Size(m)
-}
-func (m *Arguments_AnnotationFlags) XXX_DiscardUnknown() {
-	xxx_messageInfo_Arguments_AnnotationFlags.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Arguments_AnnotationFlags proto.InternalMessageInfo
-
-func (m *Arguments_AnnotationFlags) GetEmitTimestamp() bool {
-	if m != nil {
-		return m.EmitTimestamp
-	}
-	return false
-}
-
-func (m *Arguments_AnnotationFlags) GetEmitInitialProperties() bool {
-	if m != nil {
-		return m.EmitInitialProperties
-	}
-	return false
-}
-
-// Any flags to pass to the recipe engine. Used to toggle on new behavior,
-// like sending logs through logdog.
-type Arguments_EngineFlags struct {
-	XXX_NoUnkeyedLiteral struct{} `json:"-"`
-	XXX_unrecognized     []byte   `json:"-"`
-	XXX_sizecache        int32    `json:"-"`
-}
-
-func (m *Arguments_EngineFlags) Reset()         { *m = Arguments_EngineFlags{} }
-func (m *Arguments_EngineFlags) String() string { return proto.CompactTextString(m) }
-func (*Arguments_EngineFlags) ProtoMessage()    {}
-func (*Arguments_EngineFlags) Descriptor() ([]byte, []int) {
-	return fileDescriptor_a37baee6372b8245, []int{0, 1}
-}
-
-func (m *Arguments_EngineFlags) XXX_Unmarshal(b []byte) error {
-	return xxx_messageInfo_Arguments_EngineFlags.Unmarshal(m, b)
-}
-func (m *Arguments_EngineFlags) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_Arguments_EngineFlags.Marshal(b, m, deterministic)
-}
-func (m *Arguments_EngineFlags) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Arguments_EngineFlags.Merge(m, src)
-}
-func (m *Arguments_EngineFlags) XXX_Size() int {
-	return xxx_messageInfo_Arguments_EngineFlags.Size(m)
-}
-func (m *Arguments_EngineFlags) XXX_DiscardUnknown() {
-	xxx_messageInfo_Arguments_EngineFlags.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Arguments_EngineFlags proto.InternalMessageInfo
-
-func init() {
-	proto.RegisterType((*Arguments)(nil), "recipe_engine.Arguments")
-	proto.RegisterType((*Arguments_AnnotationFlags)(nil), "recipe_engine.Arguments.AnnotationFlags")
-	proto.RegisterType((*Arguments_EngineFlags)(nil), "recipe_engine.Arguments.EngineFlags")
-}
-
-func init() {
-	proto.RegisterFile("infra/tools/kitchen/third_party/recipe_engine/arguments.proto", fileDescriptor_a37baee6372b8245)
-}
-
-var fileDescriptor_a37baee6372b8245 = []byte{
-	// 254 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xcf, 0x4b, 0xc3, 0x30,
-	0x14, 0xc7, 0x69, 0x19, 0x52, 0x53, 0xe7, 0x46, 0x44, 0x1c, 0x3b, 0x0d, 0x51, 0xe8, 0xa9, 0x01,
-	0x05, 0x6f, 0x1e, 0x76, 0x50, 0xd1, 0x93, 0x54, 0xef, 0x21, 0xce, 0xb7, 0xee, 0x61, 0xfb, 0x12,
-	0xd2, 0xe7, 0xc1, 0x7f, 0xcc, 0xbf, 0x4f, 0xda, 0xd8, 0x6a, 0x05, 0x2f, 0x81, 0x7c, 0x7f, 0x7c,
-	0x92, 0xf7, 0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0x4a, 0x9b, 0x83, 0x8f, 0x01, 0x00, 0x00,
-}
diff --git a/go/src/infra/tools/kitchen/third_party/recipe_engine/arguments.proto b/go/src/infra/tools/kitchen/third_party/recipe_engine/arguments.proto
deleted file mode 100644
index d492750..0000000
--- a/go/src/infra/tools/kitchen/third_party/recipe_engine/arguments.proto
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2016 The LUCI Authors. All rights reserved.
-// Use of this source code is governed under the Apache License, Version 2.0
-// that can be found in the LICENSE file.
-
-syntax = "proto3";
-
-package recipe_engine;
-
-// Arguments is a protobuf that can be supplied to the recipe engine through its
-// "--operational-args-path" command-line parameter in JSONPB format.
-message Arguments {
-  reserved 1;
-
-  // Message containing the set of supported annotation control flags.
-  message AnnotationFlags {
-    // If true, emit CURRENT_TIMESTAMP annotations.
-    bool emit_timestamp = 1;
-
-    // If true, emit all input properties as annotations at the beginning of
-    // recipe engine execution.
-    bool emit_initial_properties = 2;
-  }
-  // Annotation control flags.
-  AnnotationFlags annotation_flags = 2;
-
-  // Any flags to pass to the recipe engine. Used to toggle on new behavior,
-  // like sending logs through logdog.
-  message EngineFlags {
-    reserved 1;
-  }
-  EngineFlags engine_flags = 4;
-}