-
Notifications
You must be signed in to change notification settings - Fork 76
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
feat(extension): Block on missing required config #2187
feat(extension): Block on missing required config #2187
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this section to the reference pages! I have some feedback on the wording that I only added to the Django page but applies to all of the pages.
The biggest change I'm suggesting: I removed the non-optional
syntax because it's not used from a coding perspective, meaning that a user wouldn't add non-optional
anywhere in the YAML file. Please correct me if I'm mistaken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! The note at the end is rendering strangely in the RTD build, otherwise I left two nitpicks on the Django doc that apply to all the pages :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved on the code side. Deferring to @medubelko and @erinecon on docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestions apply to all affected docs. Thanks!
This PR is related to 12 Factor Block on missing required config PR
Rationale
Some applications require certain config options to run and would crash if these options are not provided. To prevent this, we need to add an optional field to the config options and block the charm if a config option marked as non-optional has not been provided with a message that explains which config options are missing.
To stay backward compatible the default value for the optional field will be true.
Since it doesn’t make sense for config options that are non-optional to have a default value, charmcraft will look for this condition at pack time and error out.
Extension Changes
Adds a check for non-optional options with default values and throws
ExtensionError
when found.Adds documentation about the non-optional options.
Reviewers:
@jdkandersson
@javierdelapuente
@erinecon