-
Notifications
You must be signed in to change notification settings - Fork 13
fix: respect the reason required org setting for ignore creation #409
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
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
ReasonRequired
org setting in regards to ignores. The changes add a new config value for it and adapt the validator function in regards to the setting.