-
Notifications
You must be signed in to change notification settings - Fork 53
[SEMVER-MAJOR] condition support to module params #350
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
Conversation
changes includes - removing global config - module config’s parameter to support condition - module config’s parameter to support custom typed prompts - prompts to not return value, instead update map(can support multi-value)
0d6aec2 to
7713479
Compare
|
Go convention - can you please add comments on public functions starting with the name of the function? |
internal/apply/apply.go
Outdated
| }) | ||
| } | ||
|
|
||
| func getParameterDefinition(modConfig moduleconfig.ModuleConfig, field string) moduleconfig.Parameter { |
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.
Is this function not actually used anywhere?
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 looks like it, will remove
|
Can you add a new file in docs to capture the schema and usage of the module.yml now that it's getting more complex? |
pkg/credentials/credentials.go
Outdated
| SecretAccessKey string `yaml:"secretAccessKey,omitempty" env:"AWS_SECRET_ACCESS_KEY,omitempty"` | ||
| } | ||
|
|
||
| var GetAWSCredsPath = awsCredsPath |
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.
Why assign here rather than calling the function directly?
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.
In the tests i'm overwriting the function so it fetches the mock path, it only lets me do it if its a variable
what's the proper way to
I guess I should just have the function receive the credentials path as well?
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 how about you accept an optional base path, and if it's not supplied we default to the home dir?
pkg/credentials/credentials.go
Outdated
|
|
||
| func AwsCredsPath() string { | ||
| type AWSResourceConfig struct { | ||
| AccessKeyID string `yaml:"accessKeyId,omitempty" env:"AWS_ACCESS_KEY_ID,omitempty"` |
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.
Why "yaml"? If this annotation is just to be used by the ReflectStructValueIntoMap function we might as well use our own identifier so it's clear that it's not supposed to be used in some other way to generate yaml.
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.
No particular reason, mostly just because I reused the struct from before (global creds)
what should we change it to, should we just call it zero?
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.
How about just key or something? If we control this struct entirely in code and don't need to worry about parsing it to/from a file it might be a bit overkill to even use an annotation for this.
| | `data` | list(string) | Supply extra data for condition to run | | ||
|
|
||
|
|
||
| ### Validation |
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.
Missing info on some of the other things like the contitions and template fields related to templating.
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.
definitely good call to add this documentation, I looked at conditions and thought oh its there, but theres actually 2 types
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 the naming might be a bit confusing..
internal/init/prompts.go
Outdated
| err, result = promptParameter(p) | ||
| } | ||
| if err != nil { | ||
| exit.Fatal("Exiting prompt: %v\n", err) |
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.
Mind adding a bit more info here? Maybe say that it's related to the module properties, and if possible, say which module the problem is with? I'm thinking for CustomPromptHandler for example, if the module specifies an invalid string, it's gonna be hard for a user to understand what's going on.
Co-authored-by: Bill Monkman <bmonkman@gmail.com>
Co-authored-by: Bill Monkman <bmonkman@gmail.com>
feature changes includes:
OmitFromProjectFiledefault's tofalse)behaviour changes includes: