Skip to content

Commit 6f63189

Browse files
committed
chore: export IAW config constant
1 parent b6bf932 commit 6f63189

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pkg/local_workflows/ignore_workflow/ignore_workflow.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const (
6161
interactiveEnsureVersionControlMessage = "👉🏼 Ensure the code containing the issue is committed and pushed to remote origin, so approvers can review it."
6262
interactiveIgnoreRequestSubmissionMessage = "✅ Your ignore request has been submitted."
6363

64-
configIgnoreApprovalEnabled = "internal_iaw_enabled"
64+
ConfigIgnoreApprovalEnabled = "internal_iaw_enabled"
6565
)
6666

6767
var reasonPromptHelpMap = map[string]string{
@@ -90,7 +90,7 @@ func InitIgnoreWorkflows(engine workflow.Engine) error {
9090
return err
9191
}
9292

93-
engine.GetConfiguration().AddDefaultValue(configIgnoreApprovalEnabled, getOrgIgnoreApprovalEnabled(engine))
93+
engine.GetConfiguration().AddDefaultValue(ConfigIgnoreApprovalEnabled, getOrgIgnoreApprovalEnabled(engine))
9494

9595
return nil
9696
}
@@ -102,7 +102,7 @@ func ignoreCreateWorkflowEntryPoint(invocationCtx workflow.InvocationContext, _
102102
config := invocationCtx.GetConfiguration()
103103
id := invocationCtx.GetWorkflowIdentifier()
104104

105-
if !config.GetBool(configIgnoreApprovalEnabled) {
105+
if !config.GetBool(ConfigIgnoreApprovalEnabled) {
106106
return nil, snyk_errors.Error{
107107
ID: "SNYK-CLI-0014",
108108
Title: "Organization setting not enabled",

pkg/local_workflows/ignore_workflow/ignore_workflow_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func setupMockIgnoreContext(t *testing.T, payload string, statusCode int) *mocks
5151
config := configuration.New()
5252
config.Set(configuration.API_URL, "https://api.snyk.io")
5353
config.Set(configuration.ORGANIZATION, uuid.New().String())
54-
config.Set(configIgnoreApprovalEnabled, true)
54+
config.Set(ConfigIgnoreApprovalEnabled, true)
5555
// setup mocks
5656
ctrl := gomock.NewController(t)
5757
networkAccessMock := mocks.NewMockNetworkAccess(ctrl)
@@ -306,7 +306,7 @@ func Test_ignoreCreateWorkflowEntryPoint(t *testing.T) {
306306

307307
invocationContext := setupMockIgnoreContext(t, "{}", http.StatusCreated)
308308
config := invocationContext.GetConfiguration()
309-
config.Set(configIgnoreApprovalEnabled, false)
309+
config.Set(ConfigIgnoreApprovalEnabled, false)
310310

311311
config.Set(InteractiveKey, false)
312312

@@ -330,7 +330,7 @@ func setupInteractiveMockContext(t *testing.T, mockApiResponse string, mockApiSt
330330
config := configuration.New()
331331
config.Set(configuration.API_URL, "https://api.snyk.io")
332332
config.Set(configuration.ORGANIZATION, uuid.New().String())
333-
config.Set(configIgnoreApprovalEnabled, true)
333+
config.Set(ConfigIgnoreApprovalEnabled, true)
334334
config.Set(InteractiveKey, true) // Always interactive
335335
config.Set(EnrichResponseKey, true)
336336
config.Set(configuration.ORGANIZATION_SLUG, "some-org")

0 commit comments

Comments
 (0)