-
Notifications
You must be signed in to change notification settings - Fork 462
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
Support callback, custom config key and publishing for parameters. #5586
Conversation
Any thoughts on supporting a |
Thanks once again for the contribution @davidebbo |
@mitchdenny per discussion with @davidfowl, we decided not to tackle async at this time, though this could be a future thing (it does look hard!). Note that per #4429 (comment) and discord chat, we'll be making some design changes for publishing the value, so I'll be evolving the PR. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
"inputs": { | ||
"value": { | ||
"type": "string", | ||
"default": { |
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.
@mitchdenny This is new schema for parameters to specify a default value. We should update the schema and file an issue on azd to implement this.
@vhvb1989 Thoughts on implementing this idea of no prompting for parameters with defaults? Or being able to suppress them somehow?
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.
@vhvb1989 Thoughts on implementing this idea of no prompting for parameters with defaults? Or being able to suppress them somehow?
If it's a 'default', there needs to be a way to override them. Maybe there are two modes (e.g. controlled by switches):
- Use all manifest defaults without prompting
- Prompt, but prefill the field with the manifest default
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.
FYI, azd suports a generate
field in default
, like
Azd uses the gereate config to produce the value instead of prompt. If you need a static default value, we could add a rule to the generate config to just use the provided value
When we added support for this, we considered a case where azd could ask forlk if they wanted to auto-generate the value (based on the rules) or enter a value manually. This is supported by azd already (just not mapped to any configuration from the Aspire Manifest).
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.
To me, it feels a little strange to have this in generate
(because there is no generation), which is why I went with an alternative value
property, e.g.
"inputs": {
"value": {
"type": "string",
"default": {
"value": "DefaultValue"
}
}
}
Either way, whoever owns the aspire manifest schema should decide where to put that. If we want it under generate
that's easy to do.
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 agree that generate is strange. I like the above proposal of having a "default" section.
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.
Yep
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.
Ok, I pushed the schema change. I also added test coverage for "generate", as it was missing. @mitchdenny PTAL
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.
@mitchdenny Also, how does the schema make its way from this repo to https://github.com/dotnet/dotnet/blob/main/src/aspire/src/Schema/aspire-8.0.json? Automatic or we need to push it?
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.
Manually I think
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.
Yeah all manual.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Filed Azure/azure-dev#4359 |
@davidebbo @davidfowl @mitchdenny is it safe to asume that a "param-with-value": {
"type": "parameter.v0",
"value": "{param-with-value.inputs.value}",
"inputs": {
"value": {
"type": "string",
"secret": true,
"default":{
"value": "default value for param"
}
}
}
}, See the I am working on making But I am wondering if the AppHost is even allowing this or not? (maybe is blocked in AppHost so I don't even need to worry)? |
@vhvb1989 we do not block it today, but I agree that we should. So I think we should allow: var foo = builder.AddParameter("foo", value: "somesecret", secret: true); as this only uses the value at runtime, but not: var foo = builder.AddParameter("foo", value: "somesecret", publishValueAsDefault: true, secret: true); which results in having the secret in the manifest. @davidfowl @mitchdenny do you agree? If so, I can make a follow-up change to prevent this. e.g. an error like |
I sent #5891 to make this change. |
@vhvb1989 This is now blocked in AppHost, so you should not encounter this unless people mess with their manifest by hand, |
Description
See #4429 for details.
Fixes #4429
Checklist
<remarks />
and<code />
elements on your triple slash comments?Microsoft Reviewers: Open in CodeFlow