Skip to content

Conversation

CatalinSnyk
Copy link
Contributor

@CatalinSnyk CatalinSnyk commented Aug 21, 2025

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.

Copy link

snyk-io bot commented Aug 21, 2025

🎉 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)

Copy link

snyk-io bot commented Aug 21, 2025

🎉 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)

@CatalinSnyk CatalinSnyk force-pushed the fix/CLI-1087_iaw_reason_required_org_setting branch 3 times, most recently from ed8b2ca to cb1ddfc Compare August 21, 2025 10:17
@CatalinSnyk CatalinSnyk force-pushed the fix/CLI-1087_iaw_reason_required_org_setting branch from cb1ddfc to 95b41b2 Compare August 22, 2025 06:59
@CatalinSnyk CatalinSnyk marked this pull request as ready for review August 22, 2025 07:05
@CatalinSnyk CatalinSnyk requested review from a team as code owners August 22, 2025 07:05
cursor[bot]

This comment was marked as outdated.

})
}

func getOrgIgnoreSettings(engine workflow.Engine) (*contract.OrgSettingsResponse, error) {
Copy link
Contributor

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)
Copy link
Contributor

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?

Suggested change
engine.GetConfiguration().Set(ConfigIgnoreSettings, settings)
config.Set(ConfigIgnoreSettings, settings)

}
}

func getOrgIgnoreReasonRequired(engine workflow.Engine) configuration.DefaultValueFunction {
Copy link
Contributor

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))
Copy link
Contributor

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?

@CatalinSnyk CatalinSnyk force-pushed the fix/CLI-1087_iaw_reason_required_org_setting branch from 95b41b2 to 883102c Compare September 1, 2025 08:05
@j-luong j-luong force-pushed the fix/CLI-1087_iaw_reason_required_org_setting branch from 883102c to 95b41b2 Compare September 4, 2025 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants