Skip to content
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

fix: add iac ignore button [IDE-683] #634

Merged
merged 9 commits into from
Nov 19, 2024
Merged

Conversation

DariusZdroba
Copy link
Contributor

@DariusZdroba DariusZdroba commented Nov 12, 2024

Description

This provides the logic to ignore an IaC finding for a specific file in the IntelliJ plugin, the ignore button is implicitly hidden and set to show in IntelliJ only.

The HTML panel that comes from the Language Server receives dynamic attributes with injected values such as the path and Issue.ID, these are extracted in a custom JS script and called through a callback when clicking ignore button , this triggers the IgnoreHandler .
In the IgnoreHandler the IgnoreService is called which calls calls the CLI through the LS Wrapper to execute the snyk ignore command on the specified params.

This path and issue id comes injected in the HTML template which comes from Snyk LS.

Checklist

  • Tests added and all succeed
  • Linted
  • CHANGELOG.md updated
  • README.md updated, if user-facing

Screenshots / GIFs

Visuals that may help the reviewer. Please add screenshots for any UI change. GIFs are most welcome!

@DariusZdroba DariusZdroba requested a review from a team as a code owner November 12, 2024 14:10
@@ -209,7 +233,6 @@ class SuggestionDescriptionPanelFromLS(

private fun getCustomScript(): String {
return """
(function () {
Copy link
Contributor Author

@DariusZdroba DariusZdroba Nov 15, 2024

Choose a reason for hiding this comment

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

When extracting the script to migrate it to Language Server, we need acces to some variables which are locked in the scope of this self invoked function and can't be accessed outside,

we can have all the logic encapsulated in a self invoked function in Language Server, that would require some minimal changes to all IDE's that inject scripts.

@DariusZdroba DariusZdroba changed the title fix: add iac ignore button fix: add iac ignore button [IDE-683] Nov 15, 2024
@DariusZdroba DariusZdroba merged commit 264465c into master Nov 19, 2024
9 checks passed
@DariusZdroba DariusZdroba deleted the fix/add-iac-ignore-button branch November 19, 2024 10:34
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