-
Notifications
You must be signed in to change notification settings - Fork 8
feat: ignore request command [IDE-1063] #825
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
21bb73f
to
5a9bcd8
Compare
5a9bcd8
to
f3c0dcc
Compare
f3c0dcc
to
2f3da48
Compare
2f3da48
to
39eef13
Compare
} | ||
|
||
func (cmd *submitIgnoreRequest) sendShowDocumentRequest(issue types.Issue) { | ||
snykUri, _ := code.SnykMagnetUri(issue, code.ShowInDetailPanelIdeCommand) |
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.
please refactor, this seems like code duplication with autofix. also, errors must be handled.
ignoreType, ok := cmd.command.Arguments[2].(string) | ||
if !ok { | ||
return nil, fmt.Errorf("ignoreType should be a string") | ||
} | ||
reason, ok := cmd.command.Arguments[3].(string) | ||
if !ok { | ||
return nil, fmt.Errorf("reason should be a string") | ||
} | ||
expiration, ok := cmd.command.Arguments[4].(string) | ||
if !ok { | ||
return nil, fmt.Errorf("expiration should be a string") | ||
} | ||
ignoreId, ok := cmd.command.Arguments[5].(string) | ||
if !ok { | ||
return nil, fmt.Errorf("ignoreId should be a string") | ||
} |
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.
some of the argument checks are also duplications, please refactor accordingly to only have the necessary code once.
domain/snyk/issues.go
Outdated
Fingerprint string | ||
GlobalIdentity string | ||
SuppressionStatus string | ||
FindingsId string |
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.
should be findingId
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.
do we need json tags? please add if needed
internal/types/command.go
Outdated
GetActiveUserCommand = "snyk.getActiveUser" | ||
TrustWorkspaceFoldersCommand = "snyk.trustWorkspaceFolders" | ||
OpenLearnLesson = "snyk.openLearnLesson" | ||
GetLearnLesson = "snyk.getLearnLesson" | ||
GetSettingsSastEnabled = "snyk.getSettingsSastEnabled" | ||
GetFeatureFlagStatus = "snyk.getFeatureFlagStatus" | ||
GetActiveUserCommand = "snyk.getActiveUser" | ||
ReportAnalyticsCommand = "snyk.reportAnalytics" | ||
WorkspaceScanCommand = "snyk.workspace.scan" | ||
WorkspaceFolderScanCommand = "snyk.workspaceFolder.scan" | ||
ClearCacheCommand = "snyk.clearCache" | ||
ReportAnalyticsCommand = "snyk.reportAnalytics" | ||
GenerateIssueDescriptionCommand = "snyk.generateIssueDescription" | ||
OpenBrowserCommand = "snyk.openBrowser" | ||
NavigateToRangeCommand = "snyk.navigateToRange" | ||
OpenLearnLesson = "snyk.openLearnLesson" | ||
GetLearnLesson = "snyk.getLearnLesson" | ||
SubmitIgnoreRequest = "snyk.submitIgnoreRequest" |
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?
@@ -88,8 +88,10 @@ type Issue interface { | |||
GetMessage() string | |||
GetFormattedMessage() string | |||
GetAffectedFilePath() FilePath | |||
GetContentRoot() FilePath | |||
GetIsNew() bool | |||
GetIsIgnored() bool |
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.
IsIgnored
Description
New LS command for policy CRUD operations
Operation (CREATE,UPDATE,DELETE)
ignoreId (might be empty in case of CREATE)
reason (wont-fix, not-vulnerable, temporary-ignore)
expirationDate
comment
The LS Command should trigger the GAF Ignore WF created in IDE-1058.
Enrich the cached LS Issue with the GAF Ignore WF workflow afterwards.
Send generateIssueDescription Notification to refresh the page
Checklist