diff --git a/package-lock.json b/package-lock.json index f24a18a2..9d12fad2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.9.4-ea.3", "license": "Apache-2.0", "dependencies": { - "@RHEcosystemAppEng/exhort-javascript-api": "^0.1.1-ea.14", + "@RHEcosystemAppEng/exhort-javascript-api": "^0.1.1-ea.24", "@xml-tools/ast": "^5.0.5", "@xml-tools/parser": "^1.0.11", "json-to-ast": "^2.1.0", @@ -837,9 +837,9 @@ } }, "node_modules/@RHEcosystemAppEng/exhort-javascript-api": { - "version": "0.1.1-ea.14", - "resolved": "https://npm.pkg.github.com/download/@RHEcosystemAppEng/exhort-javascript-api/0.1.1-ea.14/b7f01baf0e01d8d697a2b5264e4f374d001004fd", - "integrity": "sha512-B0bnokCaz37eS3dIQPuPuwrAGU/y3TM4DT8u7xMMN9hjK9kSOq4UsWPgkJIaYstUzChgomQnXTRQhd2kNfvIIw==", + "version": "0.1.1-ea.24", + "resolved": "https://npm.pkg.github.com/download/@RHEcosystemAppEng/exhort-javascript-api/0.1.1-ea.24/94cdb21bc22642d84e1699f88b7531fbf248c2a3", + "integrity": "sha512-/1FNlRxmQTdkt5bqI4dxeBrBYg9A+ivcrCz48vmpbkNfXyp7SpZ07MQPwNWfPCMrprYJP+PzUKDHxzuhBYJMEg==", "license": "Apache-2.0", "dependencies": { "@babel/core": "^7.23.2", diff --git a/package.json b/package.json index 3f89a2d5..7f2dadf3 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "dist" ], "dependencies": { - "@RHEcosystemAppEng/exhort-javascript-api": "^0.1.1-ea.14", + "@RHEcosystemAppEng/exhort-javascript-api": "^0.1.1-ea.24", "@xml-tools/ast": "^5.0.5", "@xml-tools/parser": "^1.0.11", "json-to-ast": "^2.1.0", diff --git a/src/componentAnalysis.ts b/src/componentAnalysis.ts index 00111d59..b280e688 100644 --- a/src/componentAnalysis.ts +++ b/src/componentAnalysis.ts @@ -165,6 +165,7 @@ async function executeComponentAnalysis (diagnosticFilePath: string, contents: s 'RHDA_TOKEN': globalConfig.telemetryId, 'RHDA_SOURCE': globalConfig.utmSource, 'MATCH_MANIFEST_VERSIONS': globalConfig.matchManifestVersions, + 'EXHORT_PYTHON_VIRTUAL_ENV': globalConfig.setPythonVirtualEnvironment, 'EXHORT_MVN_PATH': globalConfig.exhortMvnPath, 'EXHORT_NPM_PATH': globalConfig.exhortNpmPath, 'EXHORT_GO_PATH': globalConfig.exhortGoPath, diff --git a/src/config.ts b/src/config.ts index 4c6fa7d1..b72f0f86 100644 --- a/src/config.ts +++ b/src/config.ts @@ -16,6 +16,7 @@ class Config utmSource: string; exhortSnykToken: string; matchManifestVersions: string; + setPythonVirtualEnvironment: string; vulnerabilityAlertSeverity: string; exhortMvnPath: string; exhortNpmPath: string; @@ -39,6 +40,7 @@ class Config this.utmSource = process.env.VSCEXT_UTM_SOURCE || ''; this.exhortSnykToken = process.env.VSCEXT_EXHORT_SNYK_TOKEN || ''; this.matchManifestVersions = process.env.VSCEXT_MATCH_MANIFEST_VERSIONS || 'true'; + this.setPythonVirtualEnvironment = process.env.VSCEXT_SET_PYTHON_VIRTUAL_ENVIRONMENT || 'false'; this.vulnerabilityAlertSeverity = process.env.VSCEXT_VULNERABILITY_ALERT_SEVERITY || 'Error'; this.exhortMvnPath = process.env.VSCEXT_EXHORT_MVN_PATH || 'mvn'; this.exhortNpmPath = process.env.VSCEXT_EXHORT_NPM_PATH || 'npm'; @@ -55,6 +57,7 @@ class Config */ updateConfig( rhdaData: any ) { this.matchManifestVersions = rhdaData.matchManifestVersions ? 'true' : 'false'; + this.setPythonVirtualEnvironment = rhdaData.setPythonVirtualEnvironment ? 'true' : 'false'; this.vulnerabilityAlertSeverity = rhdaData.vulnerabilityAlertSeverity; this.exhortMvnPath = rhdaData.mvn.executable.path || 'mvn'; this.exhortNpmPath = rhdaData.npm.executable.path || 'npm'; diff --git a/test/config.test.ts b/test/config.test.ts index 5e8ac23f..5c833432 100644 --- a/test/config.test.ts +++ b/test/config.test.ts @@ -18,6 +18,7 @@ describe('Config tests', () => { const rhdaData = { exhortSnykToken: 'mockToken', matchManifestVersions: false, + setPythonVirtualEnvironment: true, mvn: { executable: { path: 'mockPath' } }, @@ -44,6 +45,7 @@ describe('Config tests', () => { const partialRhdaData = { exhortSnykToken: 'mockToken', matchManifestVersions: true, + setPythonVirtualEnvironment: false, mvn: { executable: { path: '' } }, @@ -74,6 +76,7 @@ describe('Config tests', () => { expect(mockConfig.utmSource).to.eq(''); expect(mockConfig.exhortSnykToken).to.eq(''); expect(mockConfig.matchManifestVersions).to.eq('true'); + expect(mockConfig.setPythonVirtualEnvironment).to.eq('false'); expect(mockConfig.exhortMvnPath).to.eq('mvn'); expect(mockConfig.exhortNpmPath).to.eq('npm'); expect(mockConfig.exhortGoPath).to.eq('go'); @@ -88,6 +91,7 @@ describe('Config tests', () => { mockConfig.updateConfig(rhdaData); expect(mockConfig.matchManifestVersions).to.eq('false'); + expect(mockConfig.setPythonVirtualEnvironment).to.eq('true'); expect(mockConfig.exhortMvnPath).to.eq('mockPath'); expect(mockConfig.exhortNpmPath).to.eq('mockPath'); expect(mockConfig.exhortGoPath).to.eq('mockPath'); @@ -102,6 +106,7 @@ describe('Config tests', () => { mockConfig.updateConfig(partialRhdaData); expect(mockConfig.matchManifestVersions).to.eq('true'); + expect(mockConfig.setPythonVirtualEnvironment).to.eq('false'); expect(mockConfig.exhortMvnPath).to.eq('mvn'); expect(mockConfig.exhortNpmPath).to.eq('npm'); expect(mockConfig.exhortGoPath).to.eq('go');