Add an enum to `InvocationPolicy::SetValue` explicitly indicating how the flag should interact with user settings.
// limitations under the License.
syntax = "proto2";
+
package blaze.invocation_policy;
// option java_api_version = 2;
@@ -103,13 +104,40 @@ message SetValue {
// Whether to allow this policy to be overridden by user-specified values.
// When set, if the user specified a value for this flag, use the value
// from the user, otherwise use the value specified in this policy.
+ // This value is redundant to behavior -- please keep it in sync with it.
optional bool overridable = 2;
// If true, and if the flag named in the policy is a repeatable flag, then
// the values listed in flag_value do not replace all the user-set or default
// values of the flag, but instead append to them. If the flag is not
// repeatable, then this has no effect.
+ // This value is redundant to behavior -- please keep it in sync with it.
optional bool append = 3;
+
+ enum Behavior {
+ UNDEFINED = 0;
+ // Change the flag value but allow it to be overridden by explicit settings
+ // from command line/config expansion/rc files.
+ // Matching old flag values: append = false, overridable = true.
+ ALLOW_OVERRIDES = 1;
+ // Append a new value for a repeatable flag, leave old values and allow
+ // further overrides.
+ // Matching old flag values: append = true, overridable = false.
+ APPEND = 2;
+ // Set a final value of the flag. Any overrides provided by the user for
+ // this flag will be ignored.
+ // Matching old flag values: append = false, overridable = false.
+ FINAL_VALUE_IGNORE_OVERRIDES = 3;
+ }
+
+ // Defines how invocation policy should interact with user settings for the
+ // same flag.
+ // For the time being, it coexists with overridable and append with duplicate
+ // semantics.Please fill both of the values as we migrate to use behavior
+ // only.
+ // TODO(b/186167747): Deprecate and remove append and overridable flag in
+ // favor of this one.
+ optional Behavior behavior = 4;
}
message UseDefault {
