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
Simplify configuration #149
Conversation
Interesting - acceptance test failures. |
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.
Test failures on running the integration tests. Looks like something happened with asset conversion?
The test failures are from updating the version of pulumi/pulumi being pointed to. This includes an update to programgen. I'll have an updated test suite soon. |
This means: - Retrieve a type as secret when it is secret in the config - Mark a type secret when it is marked as secret in configuration
permissions="r", | ||
canonicalized_resource=pulumi.Output.all(sa.name, container.name).apply(lambda saName, containerName: f"/blob/{sa_name}/{container_name}"), | ||
canonicalized_resource=f"/blob/{sa_name1}/{container_name}", |
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.
This variable name isn't declared/assigned to, looks like a regression.
Funnily enough, the diff highlights that this didn't work before, either. It just also doesn't work after.
pkg/pulumiyaml/run.go
Outdated
ConfigString configType = "String" | ||
ConfigNumber configType = "Number" | ||
ConfigListNumber configType = "List<Number>" | ||
ConfigListString configType = "List<String>" |
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.
I'm wondering if we should do this validation at all. If we evaluate config as an expression and not a string to be parsed, it can be anything, string, number, bool, array, object.
func (ctx *evalContext) registerConfig(intm configNode) (interface{}, bool) { | ||
k, c := intm.Key.Value, intm.Value | ||
|
||
// If we implement global type checking, the type of configuration variables | ||
// can be inferred and this requirement relaxed. |
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.
Ah
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 good to me. Can you create an issue to track the nested interpolate expression in pulumi/pulumi.
The blocker for inferring configuration
types in toto is the lack of global type checking and tracking types, yeah?
Issue created: pulumi/pulumi#9445 I see two problems that lead to a non-ideal configuration experience. Both related to typing. Config values must be typed, so we know what
configuration:
persons:
type:
Map:
key: String
value:
Object:
name: String
age: Number We could then infer that I hope that (2) can be implemented as an extension of our hierarchical config work. |
Implement the simplified configuration as described in #143 with the following caveat:
To ensure we call the right
config.Try*
function, type information needs to be available for config values.Type information can be derived from the default value, if available, but if no default value is supplied then the
type
field is required.If/When we add program level type checking, we can relax the required for
type
to be supplied.Fixes #143
Depends on pulumi/pulumi#9407.
pulumi.ToSecret
on config items marked secret.Secret
option