Skip to content

Commit 7dcc145

Browse files
authored
chore: migrate to @trustify-da js client library (#848)
1 parent 13e1c23 commit 7dcc145

21 files changed

+166
-168
lines changed

CHANGELOG.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
- Fixed an issue with file diagnostics not triggering on `package.json` files when associated with the `jsonc` language ID. See [PR#759](https://github.com/fabric8-analytics/fabric8-analytics-vscode-extension/pull/759) for details.
2929
- Fixed a parsing issue that was causing version numbers to be considered floating
3030
point numbers. As a consequence version `1.80` was considered `1.8` and causing
31-
false positives. See [PR#221](https://github.com/trustification/exhort-javascript-api/pull/221) for details.
32-
- Fixed issue with ignoring Maven dependencies with version defined in properties. See [PR#219](https://github.com/trustification/exhort-javascript-api/pull/219) for details.
33-
- Do not generate package-lock file for non npm projects. See [PR#151](https://github.com/trustification/exhort-javascript-api/pull/151) for details.
34-
- Fix self-adding of npm workspace to package.json. See [PR#189](https://github.com/trustification/exhort-javascript-api/pull/189) for details.
35-
- Fix problem with Gradle projects including missing dependencies that were causing false positives. See [PR#225](https://github.com/trustification/exhort-javascript-api/pull/225) for details.
31+
false positives. See [PR#221](https://github.com/guacsec/trustify-da-javascript-client/pull/221) for details.
32+
- Fixed issue with ignoring Maven dependencies with version defined in properties. See [PR#219](https://github.com/guacsec/trustify-da-javascript-client/pull/219) for details.
33+
- Do not generate package-lock file for non npm projects. See [PR#151](https://github.com/guacsec/trustify-da-javascript-client/pull/151) for details.
34+
- Fix self-adding of npm workspace to package.json. See [PR#189](https://github.com/guacsec/trustify-da-javascript-client/pull/189) for details.
35+
- Fix problem with Gradle projects including missing dependencies that were causing false positives. See [PR#225](https://github.com/guacsec/trustify-da-javascript-client/pull/225) for details.
3636

3737
### Enhancements
3838
- Built-in Open Container Initiative (OCI) image analysis. Red Hat Dependency Analytics no longer uses the Exhort Java API. See [PR#772](https://github.com/fabric8-analytics/fabric8-analytics-vscode-extension/pull/772) for details.
@@ -41,8 +41,8 @@ false positives. See [PR#221](https://github.com/trustification/exhort-javascrip
4141
- Added support for the `pnpm` package manager. See [Issue#765](https://github.com/fabric8-analytics/fabric8-analytics-vscode-extension/issues/765) for details.
4242
- Added debug logging output for Red Hat Dependency Analytics reports. See [PR#761](https://github.com/fabric8-analytics/fabric8-analytics-vscode-extension/pull/761) for details.
4343
- Added support for configuring Maven wrapper usage. See [PR#757](https://github.com/fabric8-analytics/fabric8-analytics-vscode-extension/pull/757) for details.
44-
- Improve error messages for package manager invocations. See [PR#159](https://github.com/trustification/exhort-javascript-api/pull/159), [PR#183](https://github.com/trustification/exhort-javascript-api/pull/183), [PR#185](https://github.com/trustification/exhort-javascript-api/pull/185) for details.
45-
- Support node version managers FNM and NVM. See [PR#206](https://github.com/trustification/exhort-javascript-api/pull/206) for details.
44+
- Improve error messages for package manager invocations. See [PR#159](https://github.com/guacsec/trustify-da-javascript-client/pull/159), [PR#183](https://github.com/guacsec/trustify-da-javascript-client/pull/183), [PR#185](https://github.com/guacsec/trustify-da-javascript-client/pull/185) for details.
45+
- Support node version managers FNM and NVM. See [PR#206](https://github.com/guacsec/trustify-da-javascript-client/pull/206) for details.
4646

4747
### Chores
4848
- `axios` updated from 1.7.2 to 1.9.0. See [PR#763](https://github.com/fabric8-analytics/fabric8-analytics-vscode-extension/pull/763) for details.
@@ -80,9 +80,9 @@ false positives. See [PR#221](https://github.com/trustification/exhort-javascrip
8080
- enhancement - Added a vulnerability severity alert level setting for the user to receive inline notifications for just errors or warnings. See [PR#674](https://github.com/fabric8-analytics/fabric8-analytics-vscode-extension/pull/674) for details.
8181
- fixes - Fixed an issue with the `codeActionsMap` call. When multiple manifest documents are open that have the same dependency, one of the document entries gets deleted. This gave a wrong result in the analysis. See [PR#236](https://github.com/fabric8-analytics/fabric8-analytics-lsp-server/pull/236) for details.
8282
- fixes - Fixed an issue in the Exhort Javascript API. This fix enables and supports analysis of `pom.xml` manifests that include local modules, and a parent Project Object Model (POM). See the [PR#237](https://github.com/fabric8-analytics/fabric8-analytics-lsp-server/pull/237) for details.
83-
- fixes - Fixed an issue with the analysis report not displaying because of spaces in the manifest file path. See [PR#100](https://github.com/trustification/exhort-javascript-api/pull/100) for details.
83+
- fixes - Fixed an issue with the analysis report not displaying because of spaces in the manifest file path. See [PR#100](https://github.com/guacsec/trustify-da-javascript-client/pull/100) for details.
8484
## 0.9.1 (Dec 24th 2023)
85-
- fixes - Resolved endpoint configuration issue by removing EXHORT_DEV_MODE environment configuration parameter. See [PR#672](https://github.com/fabric8-analytics/fabric8-analytics-vscode-extension/pull/672) for details.
85+
- fixes - Resolved endpoint configuration issue by removing TRUSTIFY_DA_DEV_MODE environment configuration parameter. See [PR#672](https://github.com/fabric8-analytics/fabric8-analytics-vscode-extension/pull/672) for details.
8686
## 0.9.0 (Dec 21th 2023)
8787
- informational - Service Preview release of Red Hat Dependency Analytics (RHDA) extension.
8888
- informational - Configuration names for all supported executable paths in the extension settings have changed. These executable paths are only used for the analysis.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ Specify glob patterns for manifests to be ignored for background analysis e.g. `
350350
This setting applies to Python and Go environments.
351351

352352
<br >An alternative workaround exists for Python environments only.
353-
The user can start Visual Studio Code with the [`EXHORT_PYTHON_VIRTUAL_ENV`](https://github.com/RHEcosystemAppEng/exhort-javascript-api#:~:text=EXHORT_PYTHON_VIRTUAL_ENV) variable set to `true`.
353+
The user can start Visual Studio Code with the [`TRUSTIFY_DA_PYTHON_VIRTUAL_ENV`](https://github.com/RHEcosystemAppEng/exhort-javascript-api#:~:text=TRUSTIFY_DA_PYTHON_VIRTUAL_ENV) variable set to `true`.
354354
Doing this allows Red Hat Dependency Analytics to install Python packages into a virtual environment to perform the analysis.
355355
The benefit is having a clean Python environment not influenced by earlier installations, but the downside is a significantly slower analysis process.
356356

package-lock.json

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@
427427
},
428428
"dependencies": {
429429
"@redhat-developer/vscode-redhat-telemetry": "^0.8.0",
430-
"@trustification/exhort-api-spec": "^1.0.18",
431-
"@trustification/exhort-javascript-api": "^0.2.4-ea.9",
430+
"@trustify-da/trustify-da-api-model": "^2.0.1",
431+
"@trustify-da/trustify-da-javascript-client": "^0.2.4-ea.96817e4",
432432
"@xml-tools/ast": "^5.0.5",
433433
"@xml-tools/parser": "^1.0.11",
434434
"cli-table3": "^0.6.5",

src/config.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -175,30 +175,30 @@ class Config {
175175
process.env['VSCEXT_ENABLE_PYTHON_BEST_EFFORTS_INSTALLATION'] = this.enablePythonBestEffortsInstallation;
176176
process.env['VSCEXT_USE_PIP_DEP_TREE'] = this.usePipDepTree;
177177
process.env['VSCEXT_VULNERABILITY_ALERT_SEVERITY'] = this.vulnerabilityAlertSeverity;
178-
process.env['VSCEXT_EXHORT_MVN_PATH'] = this.exhortMvnPath;
179-
process.env['VSCEXT_EXHORT_PREFER_MVNW'] = this.exhortPreferMvnw;
180-
process.env['VSCEXT_EXHORT_MVN_ARGS'] = this.exhortMvnArgs;
181-
process.env['VSCEXT_EXHORT_GRADLE_PATH'] = this.exhortGradlePath;
182-
process.env['VSCEXT_EXHORT_PREFER_GRADLEW'] = this.exhortPreferGradlew;
183-
process.env['VSCEXT_EXHORT_NPM_PATH'] = this.exhortNpmPath;
184-
process.env['VSCEXT_EXHORT_YARN_PATH'] = this.exhortYarnPath;
185-
process.env['VSCEXT_EXHORT_PNPM_PATH'] = this.exhortPnpmPath;
186-
process.env['VSCEXT_EXHORT_GO_PATH'] = this.exhortGoPath;
187-
process.env['VSCEXT_EXHORT_PYTHON3_PATH'] = this.exhortPython3Path;
188-
process.env['VSCEXT_EXHORT_PIP3_PATH'] = this.exhortPip3Path;
189-
process.env['VSCEXT_EXHORT_PYTHON_PATH'] = this.exhortPythonPath;
190-
process.env['VSCEXT_EXHORT_PIP_PATH'] = this.exhortPipPath;
178+
process.env['VSCEXT_TRUSTIFY_DA_MVN_PATH'] = this.exhortMvnPath;
179+
process.env['VSCEXT_TRUSTIFY_DA_PREFER_MVNW'] = this.exhortPreferMvnw;
180+
process.env['VSCEXT_TRUSTIFY_DA_MVN_ARGS'] = this.exhortMvnArgs;
181+
process.env['VSCEXT_TRUSTIFY_DA_GRADLE_PATH'] = this.exhortGradlePath;
182+
process.env['VSCEXT_TRUSTIFY_DA_PREFER_GRADLEW'] = this.exhortPreferGradlew;
183+
process.env['VSCEXT_TRUSTIFY_DA_NPM_PATH'] = this.exhortNpmPath;
184+
process.env['VSCEXT_TRUSTIFY_DA_YARN_PATH'] = this.exhortYarnPath;
185+
process.env['VSCEXT_TRUSTIFY_DA_PNPM_PATH'] = this.exhortPnpmPath;
186+
process.env['VSCEXT_TRUSTIFY_DA_GO_PATH'] = this.exhortGoPath;
187+
process.env['VSCEXT_TRUSTIFY_DA_PYTHON3_PATH'] = this.exhortPython3Path;
188+
process.env['VSCEXT_TRUSTIFY_DA_PIP3_PATH'] = this.exhortPip3Path;
189+
process.env['VSCEXT_TRUSTIFY_DA_PYTHON_PATH'] = this.exhortPythonPath;
190+
process.env['VSCEXT_TRUSTIFY_DA_PIP_PATH'] = this.exhortPipPath;
191191
process.env['VSCEXT_TELEMETRY_ID'] = this.telemetryId;
192-
process.env['VSCEXT_EXHORT_SYFT_PATH'] = this.exhortSyftPath;
193-
process.env['VSCEXT_EXHORT_SYFT_CONFIG_PATH'] = this.exhortSyftConfigPath;
194-
process.env['VSCEXT_EXHORT_SKOPEO_PATH'] = this.exhortSkopeoPath;
195-
process.env['VSCEXT_EXHORT_SKOPEO_CONFIG_PATH'] = this.exhortSkopeoConfigPath;
196-
process.env['VSCEXT_EXHORT_DOCKER_PATH'] = this.exhortDockerPath;
197-
process.env['VSCEXT_EXHORT_PODMAN_PATH'] = this.exhortPodmanPath;
198-
process.env['VSCEXT_EXHORT_IMAGE_PLATFORM'] = this.exhortImagePlatform;
192+
process.env['VSCEXT_TRUSTIFY_DA_SYFT_PATH'] = this.exhortSyftPath;
193+
process.env['VSCEXT_TRUSTIFY_DA_SYFT_CONFIG_PATH'] = this.exhortSyftConfigPath;
194+
process.env['VSCEXT_TRUSTIFY_DA_SKOPEO_PATH'] = this.exhortSkopeoPath;
195+
process.env['VSCEXT_TRUSTIFY_DA_SKOPEO_CONFIG_PATH'] = this.exhortSkopeoConfigPath;
196+
process.env['VSCEXT_TRUSTIFY_DA_DOCKER_PATH'] = this.exhortDockerPath;
197+
process.env['VSCEXT_TRUSTIFY_DA_PODMAN_PATH'] = this.exhortPodmanPath;
198+
process.env['VSCEXT_TRUSTIFY_DA_IMAGE_PLATFORM'] = this.exhortImagePlatform;
199199

200200
// const token = await this.getSnykToken();
201-
// process.env['VSCEXT_EXHORT_SNYK_TOKEN'] = token;
201+
// process.env['VSCEXT_TRUSTIFY_DA_SNYK_TOKEN'] = token;
202202
}
203203

204204
/**

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export enum Titles {
3030
}
3131

3232
export const settingNameMappings: { [key: string]: string } = {
33-
'EXHORT_PYTHON_VIRTUAL_ENV': 'Use Python Virtual Environment'
33+
'TRUSTIFY_DA_PYTHON_VIRTUAL_ENV': 'Use Python Virtual Environment'
3434
};
3535

3636
// Refer `name` from package.json

src/dependencyAnalysis/analysis.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
* ------------------------------------------------------------------------------------------ */
55
'use strict';
66

7-
import exhort, { Options } from '@trustification/exhort-javascript-api';
8-
import { AnalysisReport } from '@trustification/exhort-api-spec/model/v4/AnalysisReport';
7+
import exhort, { Options } from '@trustify-da/trustify-da-javascript-client';
98

109
import { isDefined } from '../utils';
1110
import { IDependencyProvider } from '../dependencyAnalysis/collector';
1211
import { Uri } from 'vscode';
1312
import { notifications, outputChannelDep } from '../extension';
14-
import { Source } from '@trustification/exhort-api-spec/model/v4/Source';
15-
import { DependencyReport } from '@trustification/exhort-api-spec/model/v4/DependencyReport';
16-
import { Issue } from '@trustification/exhort-api-spec/model/v4/Issue';
13+
import { AnalysisReport } from '@trustify-da/trustify-da-api-model/model/v5/AnalysisReport';
14+
import { Source } from '@trustify-da/trustify-da-api-model/model/v5/Source';
15+
import { DependencyReport } from '@trustify-da/trustify-da-api-model/model/v5/DependencyReport';
16+
import { Issue } from '@trustify-da/trustify-da-api-model/model/v5/Issue';
1717

1818
/**
1919
* Represents a source object with an ID and dependencies array.

src/dependencyAnalysis/diagnostics.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { AbstractDiagnosticsPipeline } from '../diagnosticsPipeline';
1515
import { Diagnostic, DiagnosticSeverity, Uri } from 'vscode';
1616
import { notifications, outputChannelDep } from '../extension';
1717
import { globalConfig } from '../config';
18-
import { Options } from '@trustification/exhort-javascript-api';
18+
import { Options } from '@trustify-da/trustify-da-javascript-client';
1919

2020
/**
2121
* Implementation of DiagnosticsPipeline interface.
@@ -100,26 +100,26 @@ async function performDiagnostics(diagnosticFilePath: Uri, contents: string, pro
100100
try {
101101
// Define configuration options for the component analysis request
102102
const options: Options = {
103-
'RHDA_TOKEN': globalConfig.telemetryId,
104-
'RHDA_SOURCE': globalConfig.utmSource,
103+
'TRUSTIFY_DA_TOKEN': globalConfig.telemetryId,
104+
'TRUSTIFY_DA_SOURCE': globalConfig.utmSource,
105105
'MATCH_MANIFEST_VERSIONS': globalConfig.matchManifestVersions,
106-
'EXHORT_PROXY_URL': globalConfig.exhortProxyUrl,
107-
'EXHORT_PYTHON_VIRTUAL_ENV': globalConfig.usePythonVirtualEnvironment,
108-
'EXHORT_GO_MVS_LOGIC_ENABLED': globalConfig.useGoMVS,
109-
'EXHORT_PYTHON_INSTALL_BEST_EFFORTS': globalConfig.enablePythonBestEffortsInstallation,
110-
'EXHORT_PIP_USE_DEP_TREE': globalConfig.usePipDepTree,
111-
'EXHORT_MVN_PATH': globalConfig.exhortMvnPath,
112-
'EXHORT_PREFER_MVNW': globalConfig.exhortPreferMvnw,
113-
'EXHORT_MVN_ARGS': globalConfig.exhortMvnArgs,
114-
'EXHORT_GRADLE_PATH': globalConfig.exhortGradlePath,
115-
'EXHORT_NPM_PATH': globalConfig.exhortNpmPath,
116-
'EXHORT_YARN_PATH': globalConfig.exhortYarnPath,
117-
'EXHORT_PNPM_PATH': globalConfig.exhortPnpmPath,
118-
'EXHORT_GO_PATH': globalConfig.exhortGoPath,
119-
'EXHORT_PYTHON3_PATH': globalConfig.exhortPython3Path,
120-
'EXHORT_PIP3_PATH': globalConfig.exhortPip3Path,
121-
'EXHORT_PYTHON_PATH': globalConfig.exhortPythonPath,
122-
'EXHORT_PIP_PATH': globalConfig.exhortPipPath
106+
'TRUSTIFY_DA_PROXY_URL': globalConfig.exhortProxyUrl,
107+
'TRUSTIFY_DA_PYTHON_VIRTUAL_ENV': globalConfig.usePythonVirtualEnvironment,
108+
'TRUSTIFY_DA_GO_MVS_LOGIC_ENABLED': globalConfig.useGoMVS,
109+
'TRUSTIFY_DA_PYTHON_INSTALL_BEST_EFFORTS': globalConfig.enablePythonBestEffortsInstallation,
110+
'TRUSTIFY_DA_PIP_USE_DEP_TREE': globalConfig.usePipDepTree,
111+
'TRUSTIFY_DA_MVN_PATH': globalConfig.exhortMvnPath,
112+
'TRUSTIFY_DA_PREFER_MVNW': globalConfig.exhortPreferMvnw,
113+
'TRUSTIFY_DA_MVN_ARGS': globalConfig.exhortMvnArgs,
114+
'TRUSTIFY_DA_GRADLE_PATH': globalConfig.exhortGradlePath,
115+
'TRUSTIFY_DA_NPM_PATH': globalConfig.exhortNpmPath,
116+
'TRUSTIFY_DA_YARN_PATH': globalConfig.exhortYarnPath,
117+
'TRUSTIFY_DA_PNPM_PATH': globalConfig.exhortPnpmPath,
118+
'TRUSTIFY_DA_GO_PATH': globalConfig.exhortGoPath,
119+
'TRUSTIFY_DA_PYTHON3_PATH': globalConfig.exhortPython3Path,
120+
'TRUSTIFY_DA_PIP3_PATH': globalConfig.exhortPip3Path,
121+
'TRUSTIFY_DA_PYTHON_PATH': globalConfig.exhortPythonPath,
122+
'TRUSTIFY_DA_PIP_PATH': globalConfig.exhortPipPath
123123
};
124124

125125
const dependencies = provider.collect(contents);

src/exhortServices.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22

33
import * as vscode from 'vscode';
4-
import exhort, { ImageRef, Options, parseImageRef } from '@trustification/exhort-javascript-api';
4+
import exhort, { ImageRef, Options, parseImageRef } from '@trustify-da/trustify-da-javascript-client';
55

66
import { IImageRef, type IOptions } from './imageAnalysis';
7-
import { AnalysisReport } from '@trustification/exhort-api-spec/model/v4/AnalysisReport';
7+
import { AnalysisReport } from '@trustify-da/trustify-da-api-model/model/v5/AnalysisReport';
88

99
/**
1010
* Executes RHDA image analysis using the provided images and options.

0 commit comments

Comments
 (0)