aboutsummaryrefslogtreecommitdiff
path: root/cmd/release_config/release_config_lib/release_config.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/release_config/release_config_lib/release_config.go')
-rw-r--r--cmd/release_config/release_config_lib/release_config.go18
1 files changed, 15 insertions, 3 deletions
diff --git a/cmd/release_config/release_config_lib/release_config.go b/cmd/release_config/release_config_lib/release_config.go
index 873f2fc28..7f792cc8a 100644
--- a/cmd/release_config/release_config_lib/release_config.go
+++ b/cmd/release_config/release_config_lib/release_config.go
@@ -141,6 +141,11 @@ func (config *ReleaseConfig) InheritConfig(iConfig *ReleaseConfig) error {
if fa.Redacted {
myFa.Redact()
}
+ switch *myFa.FlagDeclaration.Workflow {
+ case rc_proto.Workflow_MANUAL_NO_INHERIT:
+ // Flag values for this flag are not inherited.
+ continue
+ }
if name == "RELEASE_ACONFIG_VALUE_SETS" {
// If there is a value assigned, add the trace.
if len(fa.Value.GetStringValue()) > 0 {
@@ -203,7 +208,7 @@ func (config *ReleaseConfig) GenerateReleaseConfig(configs *ReleaseConfigs) erro
// TODO: there are some configs that rely on vgsbr being
// present on branches where it isn't. Once the broken configs
// are fixed, we can be more strict. In the meantime, they
- // will wind up inheriting `trunk_stable` instead of the
+ // will wind up inheriting `trunk_staging` instead of the
// non-existent (alias) that they reference today. Once fixed,
// this becomes:
// iConfig, err := configs.GetReleaseConfigStrict(inherit)
@@ -299,6 +304,13 @@ func (config *ReleaseConfig) GenerateReleaseConfig(configs *ReleaseConfigs) erro
// The "root" release config can only contain workflow: MANUAL flags.
return fmt.Errorf("Setting value for non-MANUAL flag %s is not allowed in %s", name, value.path)
}
+ switch *fa.FlagDeclaration.Workflow {
+ case rc_proto.Workflow_MANUAL_BUILD_VARIANT:
+ // Non-BUILD_VARIANT release configs cannot set MANUAL_BUILD_VARIANT flags.
+ if config.ReleaseConfigType != rc_proto.ReleaseConfigType_BUILD_VARIANT {
+ return fmt.Errorf("Setting value for BUILD_VARIANT flag %s is not allowed in %s", name, value.path)
+ }
+ }
if err := fa.UpdateValue(*value); err != nil {
return err
}
@@ -508,7 +520,7 @@ func (config *ReleaseConfig) WriteMakefile(outFile, targetRelease string, config
return os.WriteFile(outFile, []byte(data), 0644)
}
-func (config *ReleaseConfig) WritePartitionBuildFlags(outDir string) error {
+func (config *ReleaseConfig) WritePartitionBuildFlags(product string, outDir string) error {
var err error
for partition, flags := range config.PartitionBuildFlags {
slices.SortFunc(flags.Flags, func(a, b *rc_proto.FlagArtifact) int {
@@ -516,7 +528,7 @@ func (config *ReleaseConfig) WritePartitionBuildFlags(outDir string) error {
})
// The json file name must not be modified as this is read from
// build_flags_json module
- if err = WriteMessage(filepath.Join(outDir, fmt.Sprintf("build_flags_%s.json", partition)), flags); err != nil {
+ if err = WriteMessage(filepath.Join(outDir, fmt.Sprintf("build_flags_%s-%s.json", product, partition)), flags); err != nil {
return err
}
}