-
Notifications
You must be signed in to change notification settings - Fork 175
Parse flag defaults from a file in assemble_cvd. #1766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jemoreira
reviewed
Nov 5, 2025
jemoreira
reviewed
Nov 5, 2025
1cd7f46 to
3e2884a
Compare
jemoreira
approved these changes
Nov 7, 2025
Databean
reviewed
Nov 7, 2025
f3e15c9 to
fcef75c
Compare
7a73755 to
034de33
Compare
Databean
approved these changes
Nov 12, 2025
New features and the code paths enabling them are often gated behind flags; initially, the defaults have these code paths disabled, i.e., the flags are off by default. That default value is statically defined in the flag's definition, and in order to change them to ramp up exposure to the new feature, we need to modify the flags before they are parsed. Here, we do this as follows. We introduce a key-equals-value file, where the keys are the flag names and the values are the new default value for the flag. If the file exists, then it is read and the defaults changed according to the key-value pairs in the file; otherwise, the statically defined defaults are used. This enables deployment of new features by deploying a new defaults file rather than by deploying the entire package, and lets new functionality be disabled by modifying or removing the defaults file, rather than rolling back the entire software package.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New features and the code paths enabling them are often gated behind flags; initially, the defaults have these code paths disabled, i.e., the flags are off by default. That default value is statically defined in the flag's definition, and in order to change them to ramp up exposure to the new feature, we need to modify the flags before they are parsed.
Here, we do this as follows. We introduce a key-equals-value file, where the keys are the flag names and the values are the new default value for the flag. If the file exists, then it is read and the defaults changed according to the key-value pairs in the file; otherwise, the statically defined defaults are used.
This enables deployment of new features by deploying a new defaults file rather than by deploying the entire package, and lets new functionality be disabled by modifying or removing the defaults file, rather than rolling back the entire software package.