From 169cf9424ebdc1f44dbbd478452df84bdf5e6bb3 Mon Sep 17 00:00:00 2001 From: Avishagp Date: Thu, 28 Sep 2023 14:49:03 +0100 Subject: [PATCH] feat: remove false positives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit False positives is just an empty feature flag now with analytics. It’s not used anywhere and confuses customers. --- CHANGELOG.md | 6 + ampli.json | 4 +- package.json | 6 - src/ampli/index.ts | 239 ++++-------------- src/snyk/common/analytics/itly.ts | 24 -- src/snyk/common/commands/types.ts | 4 - .../common/configuration/configuration.ts | 2 - src/snyk/common/constants/views.ts | 1 - src/snyk/snykCode/codeSettings.ts | 9 - src/snyk/snykCode/messages/error.ts | 2 - .../suggestion/codeSuggestionWebviewScript.ts | 9 - src/test/unit/common/configuration.test.ts | 2 - .../languageServer/languageServer.test.ts | 1 - .../common/languageServer/middleware.test.ts | 1 - src/test/unit/snykCode/codeSettings.test.ts | 2 - 15 files changed, 55 insertions(+), 257 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cde68261..2cd602655 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Snyk Security - Code and Open Source Dependencies Changelog +## [1.23.2] + +### Fixed + +- Removed false positives feature flag + ## [1.23.1] ### Fixed diff --git a/ampli.json b/ampli.json index e4e7d2a6c..64f026ea6 100644 --- a/ampli.json +++ b/ampli.json @@ -3,10 +3,10 @@ "SourceId": "4be0392d-f232-4850-943e-edab84cc8ccd", "Path": "./src/ampli", "Branch": "main", - "Version": "249.0.0", + "Version": "322.0.0", "OrgId": "114775", "Runtime": "node.js:typescript-v3", - "VersionId": "f20814a9-b2ff-43b0-88ef-0581da87dfbd", + "VersionId": "d8260d9e-1d43-4871-99ca-1e78645b558f", "Platform": "Node.js", "Language": "TypeScript", "SDK": "@itly/sdk@^2.0" diff --git a/package.json b/package.json index f0580ce9d..dc412c457 100644 --- a/package.json +++ b/package.json @@ -208,12 +208,6 @@ "description": "Preview features that are currently in development. Setting keys will be removed when features become stable.", "propertyNames": true, "properties": { - "reportFalsePositives": { - "type": "boolean", - "title": "Enable \"report false positives\"", - "description": "Allows reporting false positives for Snyk Code suggestions.", - "default": false - }, "advisor": { "type": "boolean", "title": "Enable \"Snyk Advisor\"", diff --git a/src/ampli/index.ts b/src/ampli/index.ts index 2f13c979c..5fe2b2e1c 100644 --- a/src/ampli/index.ts +++ b/src/ampli/index.ts @@ -54,15 +54,45 @@ export interface IdentifyProperties { * Link to access more information about the user */ adminLink?: string; + /** + * Company name as provided by the user in Appcues user profile survey + */ + appcuesCompanyName?: string; + /** + * First name as provided by the user in Appcues user profile survey + */ + appcuesFirstName?: string; + /** + * Job title as provided by the user in Appcues user profile survey + */ + appcuesJobTitle?: string; + /** + * Last name as provided by the user in Appcues user profile survey + */ + appcuesLastName?: string; + /** + * Current goal as provided by the user in Appcues user profile survey + */ + appcuesUserGoal?: string; + /** + * Work email as provided by the user in Appcues user profile survey + */ + appcuesWorkEmail?: string; /** * Auth provider (login method) */ authProvider?: string; - createdAt?: number; + createdAt?: { + [k: string]: unknown; + }; /** * Email address for the user */ email?: string; + /** + * User's first name + */ + firstName?: string; /** * Whether or not the user has their first integration set up */ @@ -91,6 +121,10 @@ export interface IdentifyProperties { * Whether or not the user should be considered a Snyk administrator */ isSnykAdmin?: boolean; + /** + * User's last name + */ + lastName?: string; /** * An array of the ecosystems(eg: javascript, java, docker, kubernetes) that the user selects as their favorites on the snyk learn app. */ @@ -460,115 +494,6 @@ export interface AuthenticateButtonIsClickedProperties { runtimeVersion?: string; } -export interface FalsePositiveIsDisplayedProperties { - /** - * Used to identify the source for multi-source events. - * - * For example, if a given event is shared between Snyk Advisor and Snyk Learn, this property helps to differentiate between the two. - * - * | Rule | Value | - * |---|---| - * | Enum Values | Advisor, App, Learn, IDE, Website, CodeSnippets | - */ - eventSource?: "Advisor" | "App" | "Learn" | "IDE" | "Website" | "CodeSnippets"; - /** - * Ide family. - * - * | Rule | Value | - * |---|---| - * | Enum Values | Visual Studio Code, Visual Studio, Eclipse, JetBrains, Other | - */ - ide: "Visual Studio Code" | "Visual Studio" | "Eclipse" | "JetBrains" | "Other"; - /** - * Operating system architecture - */ - osArch?: string; - /** - * Operating system platform - */ - osPlatform?: string; - /** - * IDE plugin runtime name. - */ - runtimeName?: string; - /** - * IDE plugin runtime version. - * - * | Rule | Value | - * |---|---| - * | Min Length | 1 | - */ - runtimeVersion?: string; -} - -export interface FalsePositiveIsSubmittedProperties { - /** - * Used to identify the source for multi-source events. - * - * For example, if a given event is shared between Snyk Advisor and Snyk Learn, this property helps to differentiate between the two. - * - * | Rule | Value | - * |---|---| - * | Enum Values | Advisor, App, Learn, IDE, Website, CodeSnippets | - */ - eventSource?: "Advisor" | "App" | "Learn" | "IDE" | "Website" | "CodeSnippets"; - /** - * Ide family. - * - * | Rule | Value | - * |---|---| - * | Enum Values | Visual Studio Code, Visual Studio, Eclipse, JetBrains, Other | - */ - ide: "Visual Studio Code" | "Visual Studio" | "Eclipse" | "JetBrains" | "Other"; - /** - * Issue ID as received from the backend. - */ - issueId?: string; - /** - * Issue type - * - * | Rule | Value | - * |---|---| - * | Enum Values | Advisor, Code Quality Issue, Code Security Vulnerability, Licence Issue, Open Source Vulnerability, Infrastructure as Code Issue, Container Vulnerability | - */ - issueType?: - | "Advisor" - | "Code Quality Issue" - | "Code Security Vulnerability" - | "Licence Issue" - | "Open Source Vulnerability" - | "Infrastructure as Code Issue" - | "Container Vulnerability"; - /** - * Operating system architecture - */ - osArch?: string; - /** - * Operating system platform - */ - osPlatform?: string; - /** - * IDE plugin runtime name. - */ - runtimeName?: string; - /** - * IDE plugin runtime version. - * - * | Rule | Value | - * |---|---| - * | Min Length | 1 | - */ - runtimeVersion?: string; - /** - * Severity of the issue - * - * | Rule | Value | - * |---|---| - * | Enum Values | High, Medium, Low, Critical | - */ - severity?: "High" | "Medium" | "Low" | "Critical"; -} - export interface IssueHoverIsDisplayedProperties { /** * Ide family. @@ -947,42 +872,6 @@ export class AuthenticateButtonIsClicked implements Event { } } -export class FalsePositiveIsDisplayed implements Event { - name = 'False Positive Is Displayed'; - id = '73047ba4-5e6b-4472-8d4e-1923fc7117f4'; - version = '4.0.0'; - properties: FalsePositiveIsDisplayedProperties & { - 'itly': true; - }; - - constructor( - properties: FalsePositiveIsDisplayedProperties, - ) { - this.properties = { - ...properties, - 'itly': true, - }; - } -} - -export class FalsePositiveIsSubmitted implements Event { - name = 'False Positive Is Submitted'; - id = '299be947-f18c-41c4-96f8-33f4c8daa5a1'; - version = '4.0.0'; - properties: FalsePositiveIsSubmittedProperties & { - 'itly': true; - }; - - constructor( - properties: FalsePositiveIsSubmittedProperties, - ) { - this.properties = { - ...properties, - 'itly': true, - }; - } -} - export class IssueHoverIsDisplayed implements Event { name = 'Issue Hover Is Displayed'; id = '5bcc7fd8-6118-4777-b719-366cda263a13'; @@ -1153,21 +1042,19 @@ class Itly { ...options, plugins: [ new SchemaValidatorPlugin({ - 'group': {"type":"object","properties":{"[Amplitude] Group ID":{"type":"object"},"[Amplitude] Group name":{"type":"object"},"$set":{"type":"object"},"$unset":{"type":"object"},"Account ARR":{"type":"object"},"Account Plan":{"type":"object"},"Billing Frequency":{"type":"object"},"Code Licenses":{"type":"object"},"Container Licenses":{"type":"object"},"countFixesFirst30Days":{"type":"object"},"countFixesFirst7Days":{"type":"object"},"countFixesPast30Days":{"type":"object"},"countFixesPast7Days":{"type":"object"},"countFixesTotal":{"type":"object"},"currentEngagementState":{"type":"object"},"dateLastEngagementStateChange":{"type":"object"},"daysSinceLastEngagementStateChange":{"type":"object"},"DB Feed Licenses":{"type":"object"},"Free Trial End Date":{"type":"object"},"Free Trial Start Date":{"type":"object"},"groupId":{"type":"string"},"groupName":{"type":"string"},"groupType":{"enum":["org","group","account"]},"hasFixFirst30Days":{"type":"object"},"hasFixFirst7Days":{"type":"object"},"hasFixPast30Days":{"type":"object"},"hasFixPast7Days":{"type":"object"},"IAC Licenses":{"type":"object"},"id":{"type":"object"},"internalName":{"type":"object"},"isPassthrough":{"type":"object"},"name":{"type":"object"},"Open Source Licenses":{"type":"object"},"plan":{"type":"string"},"priorEngagementState":{"type":"object"},"projectTypes":{"type":"array","items":{"type":"string"},"uniqueItems":true}},"additionalProperties":false,"required":[]}, - 'identify': {"type":"object","properties":{"accountType":{"enum":["user","service","app-instance","automated-test-user"]},"adminLink":{"type":"string"},"authProvider":{"type":"string"},"createdAt":{"type":"number"},"email":{"type":"string"},"hasFirstIntegration":{"type":"boolean"},"hasFirstProject":{"type":"boolean"},"hasPersonalEmail":{"type":"boolean"},"isAppUIBetaEnabled":{"type":"boolean"},"isNonUser":{"type":"boolean"},"isSnyk":{"type":"boolean"},"isSnykAdmin":{"type":"boolean"},"learnPreferredEcosystems":{"type":"array","items":{"type":"string"},"uniqueItems":true},"productUpdatesConsent":{"type":"boolean"},"productUpdatesConsentIsDisplayed":{"type":"boolean"},"user_id":{"type":"string"},"username":{"type":"string"},"utm_campaign":{"type":"string"},"utm_content":{"type":"string"},"utm_medium":{"type":"string"},"utm_source":{"type":"string"},"utm_term":{"type":"string"}},"additionalProperties":false,"required":[]}, + 'group': {"type":"object","properties":{"[Amplitude] Group ID":{"type":"object"},"[Amplitude] Group name":{"type":"object"},"$set":{"type":"object"},"$unset":{"type":"object"},"Account ARR":{"type":"object"},"Account Plan":{"type":"object"},"Billing Frequency":{"type":"object"},"Code Licenses":{"type":"object"},"Container Licenses":{"type":"object"},"countFixesFirst30Days":{"type":"object"},"countFixesFirst7Days":{"type":"object"},"countFixesPast30Days":{"type":"object"},"countFixesPast7Days":{"type":"object"},"countFixesTotal":{"type":"object"},"currentEngagementState":{"type":"object"},"dateLastEngagementStateChange":{"type":"object"},"daysSinceLastEngagementStateChange":{"type":"object"},"DB Feed Licenses":{"type":"object"},"Free Trial End Date":{"type":"object"},"Free Trial Start Date":{"type":"object"},"groupId":{"type":"string"},"groupName":{"type":"string"},"groupType":{"enum":["org","group","account"]},"hasFixFirst30Days":{"type":"object"},"hasFixFirst7Days":{"type":"object"},"hasFixPast30Days":{"type":"object"},"hasFixPast7Days":{"type":"object"},"IAC Licenses":{"type":"object"},"id":{"type":"object"},"internalName":{"type":"object"},"isPassthrough":{"type":"object"},"name":{"type":"object"},"Open Source Licenses":{"type":"object"},"plan":{"type":"string"},"priorEngagementState":{"type":"object"},"projectTypes":{"items":{"type":"string"},"uniqueItems":true,"type":"array"}},"additionalProperties":false,"required":[]}, + 'identify': {"type":"object","properties":{"accountType":{"enum":["user","service","app-instance","automated-test-user"]},"adminLink":{"type":"string"},"appcuesCompanyName":{"type":"string"},"appcuesFirstName":{"type":"string"},"appcuesJobTitle":{"type":"string"},"appcuesLastName":{"type":"string"},"appcuesUserGoal":{"type":"string"},"appcuesWorkEmail":{"type":"string"},"authProvider":{"type":"string"},"createdAt":{"type":"object"},"email":{"type":"string"},"firstName":{"type":"string"},"hasFirstIntegration":{"type":"boolean"},"hasFirstProject":{"type":"boolean"},"hasPersonalEmail":{"type":"boolean"},"isAppUIBetaEnabled":{"type":"boolean"},"isNonUser":{"type":"boolean"},"isSnyk":{"type":"boolean"},"isSnykAdmin":{"type":"boolean"},"lastName":{"type":"string"},"learnPreferredEcosystems":{"items":{"type":"string"},"uniqueItems":true,"type":"array"},"productUpdatesConsent":{"type":"boolean"},"productUpdatesConsentIsDisplayed":{"type":"boolean"},"user_id":{"type":"string"},"username":{"type":"string"},"utm_campaign":{"type":"string"},"utm_content":{"type":"string"},"utm_medium":{"type":"string"},"utm_source":{"type":"string"},"utm_term":{"type":"string"}},"additionalProperties":false,"required":[]}, 'page': {"type":"object","properties":{"ecosystem":{"type":"string"},"package":{"type":"string"},"packageManager":{"type":"string"},"packageVersion":{"type":"string"},"path":{"type":"string"},"referrer":{"type":"string"},"search":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"vulnerabilityId":{"type":"string"}},"additionalProperties":false,"required":[]}, - 'Analysis Is Ready': {"type":"object","properties":{"analysisType":{"enum":["Snyk Advisor","Snyk Code Quality","Snyk Code Security","Snyk Open Source","Snyk Container","Snyk Infrastructure as Code"]},"durationInSeconds":{"type":"number"},"fileCount":{"type":"integer"},"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"result":{"enum":["Success","Error"]},"runtimeName":{"type":"string"},"runtimeVersion":{"type":"string","minLength":1}},"additionalProperties":false,"required":["analysisType","ide","itly","result"]}, - 'Analysis Is Triggered': {"type":"object","properties":{"analysisType":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"type":"string","minLength":1},"triggeredByUser":{"type":"boolean"}},"additionalProperties":false,"required":["analysisType","ide","itly","triggeredByUser"]}, - 'Authenticate Button Is Clicked': {"type":"object","properties":{"eventSource":{"enum":["Advisor","App","Learn","IDE","Website","CodeSnippets"]},"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"type":"string","minLength":1}},"additionalProperties":false,"required":["ide","itly"]}, - 'False Positive Is Displayed': {"type":"object","properties":{"eventSource":{"enum":["Advisor","App","Learn","IDE","Website","CodeSnippets"]},"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"type":"string","minLength":1}},"additionalProperties":false,"required":["ide","itly"]}, - 'False Positive Is Submitted': {"type":"object","properties":{"eventSource":{"enum":["Advisor","App","Learn","IDE","Website","CodeSnippets"]},"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"issueId":{"type":"string"},"issueType":{"enum":["Advisor","Code Quality Issue","Code Security Vulnerability","Licence Issue","Open Source Vulnerability","Infrastructure as Code Issue","Container Vulnerability"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"type":"string","minLength":1},"severity":{"enum":["High","Medium","Low","Critical"]}},"additionalProperties":false,"required":["ide","itly"]}, - 'Issue Hover Is Displayed': {"type":"object","properties":{"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"issueId":{"type":"string"},"issueType":{"enum":["Advisor","Code Quality Issue","Code Security Vulnerability","Licence Issue","Open Source Vulnerability","Infrastructure as Code Issue","Container Vulnerability"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"type":"string","minLength":1},"severity":{"enum":["High","Medium","Low","Critical"]}},"additionalProperties":false,"required":["ide","itly"]}, - 'Issue In Tree Is Clicked': {"type":"object","properties":{"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"issueId":{"type":"string"},"issueType":{"enum":["Advisor","Code Quality Issue","Code Security Vulnerability","Licence Issue","Open Source Vulnerability","Infrastructure as Code Issue","Container Vulnerability"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"type":"string","minLength":1},"severity":{"enum":["High","Medium","Low","Critical"]}},"additionalProperties":false,"required":["ide","itly"]}, - 'Plugin Is Installed': {"type":"object","properties":{"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"type":"string","minLength":1}},"additionalProperties":false,"required":["ide","itly"]}, - 'Quick Fix Is Displayed': {"type":"object","properties":{"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"quickFixType":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"runtimeName":{"type":"string"},"runtimeVersion":{"type":"string","minLength":1}},"additionalProperties":false,"required":["ide","itly","quickFixType"]}, - 'Scan Mode Is Selected': {"type":"object","properties":{"eventSource":{"enum":["Advisor","App","Learn","IDE","Website","CodeSnippets"]},"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"type":"string","minLength":1},"scanMode":{"enum":["paused","auto","manual","throttled"]}},"additionalProperties":false,"required":["ide","itly","scanMode"]}, - 'Welcome Button Is Clicked': {"type":"object","properties":{"eventSource":{"enum":["Advisor","App","Learn","IDE","Website","CodeSnippets"]},"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"type":"string","minLength":1}},"additionalProperties":false,"required":["ide","itly"]}, - 'Welcome Is Viewed': {"type":"object","properties":{"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"type":"string","minLength":1}},"additionalProperties":false,"required":["ide","itly"]}, + 'Analysis Is Ready': {"type":"object","properties":{"analysisType":{"enum":["Snyk Advisor","Snyk Code Quality","Snyk Code Security","Snyk Open Source","Snyk Container","Snyk Infrastructure as Code"]},"durationInSeconds":{"type":"number"},"fileCount":{"type":"integer"},"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"result":{"enum":["Success","Error"]},"runtimeName":{"type":"string"},"runtimeVersion":{"minLength":1,"type":"string"}},"additionalProperties":false,"required":["analysisType","ide","itly","result"]}, + 'Analysis Is Triggered': {"type":"object","properties":{"analysisType":{"items":{"type":"string"},"minItems":1,"uniqueItems":true,"type":"array"},"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"minLength":1,"type":"string"},"triggeredByUser":{"type":"boolean"}},"additionalProperties":false,"required":["analysisType","ide","itly","triggeredByUser"]}, + 'Authenticate Button Is Clicked': {"type":"object","properties":{"eventSource":{"enum":["Advisor","App","Learn","IDE","Website","CodeSnippets"]},"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"minLength":1,"type":"string"}},"additionalProperties":false,"required":["ide","itly"]}, + 'Issue Hover Is Displayed': {"type":"object","properties":{"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"issueId":{"type":"string"},"issueType":{"enum":["Advisor","Code Quality Issue","Code Security Vulnerability","Licence Issue","Open Source Vulnerability","Infrastructure as Code Issue","Container Vulnerability"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"minLength":1,"type":"string"},"severity":{"enum":["High","Medium","Low","Critical"]}},"additionalProperties":false,"required":["ide","itly"]}, + 'Issue In Tree Is Clicked': {"type":"object","properties":{"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"issueId":{"type":"string"},"issueType":{"enum":["Advisor","Code Quality Issue","Code Security Vulnerability","Licence Issue","Open Source Vulnerability","Infrastructure as Code Issue","Container Vulnerability"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"minLength":1,"type":"string"},"severity":{"enum":["High","Medium","Low","Critical"]}},"additionalProperties":false,"required":["ide","itly"]}, + 'Plugin Is Installed': {"type":"object","properties":{"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"minLength":1,"type":"string"}},"additionalProperties":false,"required":["ide","itly"]}, + 'Quick Fix Is Displayed': {"type":"object","properties":{"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"quickFixType":{"items":{"type":"string"},"minItems":1,"uniqueItems":true,"type":"array"},"runtimeName":{"type":"string"},"runtimeVersion":{"minLength":1,"type":"string"}},"additionalProperties":false,"required":["ide","itly","quickFixType"]}, + 'Scan Mode Is Selected': {"type":"object","properties":{"eventSource":{"enum":["Advisor","App","Learn","IDE","Website","CodeSnippets"]},"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"minLength":1,"type":"string"},"scanMode":{"enum":["paused","auto","manual","throttled"]}},"additionalProperties":false,"required":["ide","itly","scanMode"]}, + 'Welcome Button Is Clicked': {"type":"object","properties":{"eventSource":{"enum":["Advisor","App","Learn","IDE","Website","CodeSnippets"]},"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"minLength":1,"type":"string"}},"additionalProperties":false,"required":["ide","itly"]}, + 'Welcome Is Viewed': {"type":"object","properties":{"ide":{"enum":["Visual Studio Code","Visual Studio","Eclipse","JetBrains","Other"]},"itly":{"const":true},"osArch":{"type":"string"},"osPlatform":{"type":"string"},"runtimeName":{"type":"string"},"runtimeVersion":{"minLength":1,"type":"string"}},"additionalProperties":false,"required":["ide","itly"]}, }), ...destinationPlugins, ...plugins, @@ -1263,38 +1150,6 @@ class Itly { this.itly.track(userId, new AuthenticateButtonIsClicked(properties), options); } - /** - * This event fires when the "Report false positive" view is shown in IDE. - * - * Owner: Michel Kaporin - * @param userId The user's ID. - * @param properties The event's properties (e.g. eventSource) - * @param options Options for this track call. - */ - falsePositiveIsDisplayed( - userId: string, - properties: FalsePositiveIsDisplayedProperties, - options?: TrackOptions, - ) { - this.itly.track(userId, new FalsePositiveIsDisplayed(properties), options); - } - - /** - * This event fires when false positive is reported from IDE. - * - * Owner: Michel Kaporin - * @param userId The user's ID. - * @param properties The event's properties (e.g. eventSource) - * @param options Options for this track call. - */ - falsePositiveIsSubmitted( - userId: string, - properties: FalsePositiveIsSubmittedProperties, - options?: TrackOptions, - ) { - this.itly.track(userId, new FalsePositiveIsSubmitted(properties), options); - } - /** * Triggered when issue hover is displayed in the IDE editor. * diff --git a/src/snyk/common/analytics/itly.ts b/src/snyk/common/analytics/itly.ts index 2743addec..90f7db690 100644 --- a/src/snyk/common/analytics/itly.ts +++ b/src/snyk/common/analytics/itly.ts @@ -1,7 +1,6 @@ import SegmentPlugin from '@itly/plugin-segment-node'; import itly, { AnalysisIsReadyProperties, - FalsePositiveIsSubmittedProperties, IssueHoverIsDisplayedProperties, IssueInTreeIsClickedProperties, ScanModeIsSelectedProperties, @@ -50,8 +49,6 @@ export interface IAnalytics { logQuickFixIsDisplayed(properties: QuickFixIsDisplayedProperties): void; logIssueHoverIsDisplayed(properties: IssueHoverIsDisplayedProperties): void; logScanModeIsSelected(properties: Omit): void; - logFalsePositiveIsDisplayed(): void; - logFalsePositiveIsSubmitted(properties: Omit): void; } /** @@ -235,27 +232,6 @@ export class Iteratively implements IAnalytics { }); } - public logFalsePositiveIsDisplayed(): void { - this.enqueueEvent(() => { - itly.falsePositiveIsDisplayed(this.getAuthenticatedUserId(), { - ide: this.ide, - eventSource: 'IDE', - }); - }); - } - - public logFalsePositiveIsSubmitted( - properties: Omit, - ): void { - this.enqueueEvent(() => { - itly.falsePositiveIsSubmitted(this.getAuthenticatedUserId(), { - ...properties, - ide: this.ide, - eventSource: 'IDE', - }); - }); - } - private enqueueEvent(eventFunction: () => void, mustBeAuthenticated = true): void { if (!this.canReportEvents()) { return; diff --git a/src/snyk/common/commands/types.ts b/src/snyk/common/commands/types.ts index 4b86368fd..5c61f0596 100644 --- a/src/snyk/common/commands/types.ts +++ b/src/snyk/common/commands/types.ts @@ -15,10 +15,6 @@ export type OpenIssueCommandArg = { issueType: OpenCommandIssueType; }; -export type ReportFalsePositiveCommandArg = { - suggestion: Readonly; -}; - export const isCodeIssue = ( _issue: completeFileSuggestionType | Issue | OssIssueCommandArg, issueType: OpenCommandIssueType, diff --git a/src/snyk/common/configuration/configuration.ts b/src/snyk/common/configuration/configuration.ts index 5a6646193..602f3ba40 100644 --- a/src/snyk/common/configuration/configuration.ts +++ b/src/snyk/common/configuration/configuration.ts @@ -45,7 +45,6 @@ export interface SeverityFilter { } export type PreviewFeatures = { - reportFalsePositives: boolean | undefined; advisor: boolean | undefined; }; @@ -434,7 +433,6 @@ export class Configuration implements IConfiguration { getPreviewFeatures(): PreviewFeatures { const defaultSetting: PreviewFeatures = { - reportFalsePositives: false, advisor: false, }; diff --git a/src/snyk/common/constants/views.ts b/src/snyk/common/constants/views.ts index 5eca816cd..b993f3763 100644 --- a/src/snyk/common/constants/views.ts +++ b/src/snyk/common/constants/views.ts @@ -6,7 +6,6 @@ export const SNYK_VIEW_ANALYSIS_CODE_QUALITY = 'snyk.views.analysis.code.quality export const SNYK_VIEW_ANALYSIS_OSS = 'snyk.views.analysis.oss'; export const SNYK_VIEW_SUPPORT = 'snyk.views.support'; export const SNYK_VIEW_SUGGESTION_CODE = 'snyk.views.suggestion.code'; -export const SNYK_VIEW_FALSE_POSITIVE_CODE = 'snyk.views.suggestion.code.falsePositive'; export const SNYK_VIEW_SUGGESTION_OSS = 'snyk.views.suggestion.oss'; export const SNYK_VIEW_SUGGESTION_IAC = 'snyk.views.suggestion.iac'; export const SNYK_VIEW_ANALYSIS_IAC = 'snyk.views.analysis.configuration'; diff --git a/src/snyk/snykCode/codeSettings.ts b/src/snyk/snykCode/codeSettings.ts index c25870175..face46032 100644 --- a/src/snyk/snykCode/codeSettings.ts +++ b/src/snyk/snykCode/codeSettings.ts @@ -6,8 +6,6 @@ import { IOpenerService } from '../common/services/openerService'; import { IVSCodeCommands } from '../common/vscode/commands'; export interface ICodeSettings { - reportFalsePositivesEnabled: boolean; - updateIsCodeEnabled(): Promise; enable(): Promise; @@ -20,16 +18,9 @@ export type SastSettings = { localCodeEngine: { enabled: boolean; }; - reportFalsePositivesEnabled: boolean; }; export class CodeSettings implements ICodeSettings { - private _reportFalsePositivesEnabled: boolean; - - get reportFalsePositivesEnabled(): boolean { - return this._reportFalsePositivesEnabled; - } - constructor( private readonly contextService: IContextService, private readonly config: IConfiguration, diff --git a/src/snyk/snykCode/messages/error.ts b/src/snyk/snykCode/messages/error.ts index 3ccc43ba9..450d5033a 100644 --- a/src/snyk/snykCode/messages/error.ts +++ b/src/snyk/snykCode/messages/error.ts @@ -1,7 +1,5 @@ export const messages = { suggestionViewShowFailed: 'Failed to show Snyk Code suggestion view', - reportFalsePositiveViewShowFailed: 'Failed to show Snyk Code report false positive view', - reportFalsePositiveFailed: 'Failed to report false positive.', suggestionViewMessageHandlingFailed: (msg: string): string => `Failed to handle message from Snyk Code suggestion view ${msg}`, diff --git a/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewScript.ts b/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewScript.ts index ba4edb850..e79ce3182 100644 --- a/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewScript.ts +++ b/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewScript.ts @@ -105,14 +105,6 @@ }, }); } - function openFalsePositiveCode() { - sendMessage({ - type: 'openFalsePositive', - args: { - suggestion: suggestion, - }, - }); - } function getSuggestionPosition(suggestionParam: Suggestion, position?: { file: string; rows: any; cols: any }) { return { uri: position?.file ?? suggestionParam.uri, @@ -317,7 +309,6 @@ document.getElementById('ignore-file-issue')!.addEventListener('click', () => { ignoreIssue(false); }); - document.getElementById('report-fp')?.addEventListener('click', openFalsePositiveCode); // deepcode ignore InsufficientValidation: Content Security Policy applied in provider window.addEventListener('message', event => { diff --git a/src/test/unit/common/configuration.test.ts b/src/test/unit/common/configuration.test.ts index 05960ffff..3f95c8ddc 100644 --- a/src/test/unit/common/configuration.test.ts +++ b/src/test/unit/common/configuration.test.ts @@ -185,14 +185,12 @@ suite('Configuration', () => { const configuration = new Configuration({}, workspace); deepStrictEqual(configuration.getPreviewFeatures(), { - reportFalsePositives: false, advisor: false, } as PreviewFeatures); }); test('Preview features: some features enabled', () => { const previewFeatures = { - reportFalsePositives: true, advisor: false, } as PreviewFeatures; const workspace = stubWorkspaceConfiguration(FEATURES_PREVIEW_SETTING, previewFeatures); diff --git a/src/test/unit/common/languageServer/languageServer.test.ts b/src/test/unit/common/languageServer/languageServer.test.ts index 731b9f7a6..754de0ae3 100644 --- a/src/test/unit/common/languageServer/languageServer.test.ts +++ b/src/test/unit/common/languageServer/languageServer.test.ts @@ -59,7 +59,6 @@ suite('Language Server', () => { getPreviewFeatures() { return { advisor: false, - reportFalsePositives: false, }; }, getFeaturesConfiguration() { diff --git a/src/test/unit/common/languageServer/middleware.test.ts b/src/test/unit/common/languageServer/middleware.test.ts index 08e3c48c8..f0ef0f8ca 100644 --- a/src/test/unit/common/languageServer/middleware.test.ts +++ b/src/test/unit/common/languageServer/middleware.test.ts @@ -31,7 +31,6 @@ suite('Language Server: Middleware', () => { getPreviewFeatures: () => { return { advisor: false, - reportFalsePositives: false, }; }, getFeaturesConfiguration() { diff --git a/src/test/unit/snykCode/codeSettings.test.ts b/src/test/unit/snykCode/codeSettings.test.ts index 11944a261..8d47b96e5 100644 --- a/src/test/unit/snykCode/codeSettings.test.ts +++ b/src/test/unit/snykCode/codeSettings.test.ts @@ -37,7 +37,6 @@ suite('Snyk Code Settings', () => { localCodeEngine: { enabled: false, }, - reportFalsePositivesEnabled: true, }); const codeEnabled = await settings.updateIsCodeEnabled(); @@ -53,7 +52,6 @@ suite('Snyk Code Settings', () => { localCodeEngine: { enabled: false, }, - reportFalsePositivesEnabled: true, }); const codeEnabled = await settings.updateIsCodeEnabled();