Skip to content

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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

acke
Copy link
Contributor

@acke acke commented Apr 8, 2025

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

  • Tests added and all succeed
  • Linted
  • README.md updated, if user-facing
  • License file updated, if new 3rd-party dependency is introduced

@acke acke force-pushed the feat/IDE-1063_ignore-request-command branch from 21bb73f to 5a9bcd8 Compare April 9, 2025 08:33
@acke acke force-pushed the feat/IDE-1063_ignore-request-command branch from 5a9bcd8 to f3c0dcc Compare April 9, 2025 09:53
@acke acke force-pushed the feat/IDE-1063_ignore-request-command branch from f3c0dcc to 2f3da48 Compare April 9, 2025 13:30
@acke acke force-pushed the feat/IDE-1063_ignore-request-command branch from 2f3da48 to 39eef13 Compare April 9, 2025 13:30
}

func (cmd *submitIgnoreRequest) sendShowDocumentRequest(issue types.Issue) {
snykUri, _ := code.SnykMagnetUri(issue, code.ShowInDetailPanelIdeCommand)
Copy link
Collaborator

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.

Comment on lines 186 to 201
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")
}
Copy link
Collaborator

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.

Fingerprint string
GlobalIdentity string
SuppressionStatus string
FindingsId string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be findingId

Copy link
Collaborator

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

Comment on lines 31 to 44
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"
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IsIgnored

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.

4 participants