fix: respect the reason required org setting for ignore creation#409
fix: respect the reason required org setting for ignore creation#409CatalinSnyk wants to merge 1 commit intomainfrom
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) ✅ code/snyk check is complete. No issues have been found. (View Details) |
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) ✅ code/snyk check is complete. No issues have been found. (View Details) |
ed8b2ca to
cb1ddfc
Compare
cb1ddfc to
95b41b2
Compare
| }) | ||
| } | ||
|
|
||
| func getOrgIgnoreSettings(engine workflow.Engine) (*contract.OrgSettingsResponse, error) { |
There was a problem hiding this comment.
suggestion: pass in the necessary parameters only, instead of the entire engine
| return nil, err | ||
| } | ||
|
|
||
| engine.GetConfiguration().Set(ConfigIgnoreSettings, settings) |
There was a problem hiding this comment.
suggestion: we already have the config declared, any reason not to use it here?
| engine.GetConfiguration().Set(ConfigIgnoreSettings, settings) | |
| config.Set(ConfigIgnoreSettings, settings) |
| } | ||
| } | ||
|
|
||
| func getOrgIgnoreReasonRequired(engine workflow.Engine) configuration.DefaultValueFunction { |
There was a problem hiding this comment.
suggest: getOrgIgnoreReasonRequired, getOrgIgnoreSettingsConfig, getOrgIgnoreApprovalEnabled are all making use of getOrgIgnoreSettings. Is getOrgIgnoreSettings something that can be added to config via config.AddDefaultValue? That way we can take advangate of caching to save mulutiple API calls.
| return err | ||
| } | ||
|
|
||
| engine.GetConfiguration().AddDefaultValue(ConfigIgnoreSettings, getOrgIgnoreSettingsConfig(engine)) |
There was a problem hiding this comment.
suggest: looks like we do here, can we then not do a config.get(ConfigIgnoreSettings) instead of the repeated calls to getOrgIgnoreSettings?
95b41b2 to
883102c
Compare
883102c to
95b41b2
Compare
Adds support for the
ReasonRequiredorg setting in regards to ignores. The changes add a new config value for it and adapt the validator function in regards to the setting.