Skip to content

Commit

Permalink
chore: revert to single source (#233)
Browse files Browse the repository at this point in the history
Signed-off-by: Ilona Shishov <[email protected]>
  • Loading branch information
IlonaShishov authored Dec 18, 2023
1 parent f712280 commit 0125af0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 20 deletions.
4 changes: 0 additions & 4 deletions src/componentAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,6 @@ async function executeComponentAnalysis (diagnosticFilePath: string, contents: s
if (globalConfig.exhortSnykToken !== '') {
options['EXHORT_SNYK_TOKEN'] = globalConfig.exhortSnykToken;
}
if (globalConfig.exhortOSSIndexUser !== '' && globalConfig.exhortOSSIndexToken !== '') {
options['EXHORT_OSS_INDEX_USER'] = globalConfig.exhortOSSIndexUser;
options['EXHORT_OSS_INDEX_TOKEN'] = globalConfig.exhortOSSIndexToken;
}

const componentAnalysisJson = await exhort.componentAnalysis(path.basename(diagnosticFilePath), contents, options); // Execute component analysis

Expand Down
6 changes: 0 additions & 6 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ class Config
telemetryId: string;
utmSource: string;
exhortSnykToken: string;
exhortOSSIndexUser: string;
exhortOSSIndexToken: string;
matchManifestVersions: string;
exhortMvnPath: string;
exhortNpmPath: string;
Expand All @@ -35,8 +33,6 @@ class Config
this.telemetryId = process.env.VSCEXT_TELEMETRY_ID || '';
this.utmSource = process.env.VSCEXT_UTM_SOURCE || '';
this.exhortSnykToken = process.env.VSCEXT_EXHORT_SNYK_TOKEN || '';
this.exhortOSSIndexUser = process.env.VSCEXT_EXHORT_OSS_INDEX_USER || '';
this.exhortOSSIndexToken = process.env.VSCEXT_EXHORT_OSS_INDEX_TOKEN || '';
this.matchManifestVersions = process.env.VSCEXT_MATCH_MANIFEST_VERSIONS || 'true';
this.exhortMvnPath = process.env.VSCEXT_EXHORT_MVN_PATH || 'mvn';
this.exhortNpmPath = process.env.VSCEXT_EXHORT_NPM_PATH || 'npm';
Expand All @@ -53,8 +49,6 @@ class Config
*/
updateConfig( data: any ) {
this.exhortSnykToken = data.redHatDependencyAnalytics.exhortSnykToken;
this.exhortOSSIndexUser = data.redHatDependencyAnalytics.exhortOSSIndexUser;
this.exhortOSSIndexToken = data.redHatDependencyAnalytics.exhortOSSIndexToken;
this.matchManifestVersions = data.redHatDependencyAnalytics.matchManifestVersions ? 'true' : 'false';
this.exhortMvnPath = data.mvn.executable.path || 'mvn';
this.exhortNpmPath = data.npm.executable.path || 'npm';
Expand Down
10 changes: 0 additions & 10 deletions test/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ describe('Config tests', () => {
const data = {
redHatDependencyAnalytics: {
exhortSnykToken: 'mockToken',
exhortOSSIndexUser: 'mockUser',
exhortOSSIndexToken: 'mockToken',
matchManifestVersions: false
},
mvn: {
Expand Down Expand Up @@ -41,8 +39,6 @@ describe('Config tests', () => {
const partialData = {
redHatDependencyAnalytics: {
exhortSnykToken: 'mockToken',
exhortOSSIndexUser: 'mockUser',
exhortOSSIndexToken: 'mockToken',
matchManifestVersions: true
},
mvn: {
Expand Down Expand Up @@ -74,8 +70,6 @@ describe('Config tests', () => {
expect(mockConfig.telemetryId).to.eq('');
expect(mockConfig.utmSource).to.eq('');
expect(mockConfig.exhortSnykToken).to.eq('');
expect(mockConfig.exhortOSSIndexUser).to.eq('');
expect(mockConfig.exhortOSSIndexToken).to.eq('');
expect(mockConfig.matchManifestVersions).to.eq('true');
expect(mockConfig.exhortMvnPath).to.eq('mvn');
expect(mockConfig.exhortNpmPath).to.eq('npm');
Expand All @@ -91,8 +85,6 @@ describe('Config tests', () => {
mockConfig.updateConfig(data);

expect(mockConfig.exhortSnykToken).to.eq('mockToken');
expect(mockConfig.exhortOSSIndexUser).to.eq('mockUser');
expect(mockConfig.exhortOSSIndexToken).to.eq('mockToken');
expect(mockConfig.matchManifestVersions).to.eq('false');
expect(mockConfig.exhortMvnPath).to.eq('mockPath');
expect(mockConfig.exhortNpmPath).to.eq('mockPath');
Expand All @@ -108,8 +100,6 @@ describe('Config tests', () => {
mockConfig.updateConfig(partialData);

expect(mockConfig.exhortSnykToken).to.eq('mockToken');
expect(mockConfig.exhortOSSIndexUser).to.eq('mockUser');
expect(mockConfig.exhortOSSIndexToken).to.eq('mockToken');
expect(mockConfig.matchManifestVersions).to.eq('true');
expect(mockConfig.exhortMvnPath).to.eq('mvn');
expect(mockConfig.exhortNpmPath).to.eq('npm');
Expand Down

0 comments on commit 0125af0

Please sign in to comment.