Skip to content

Commit

Permalink
Merge pull request #4111 from snyk/feat/snyk-iac-debug-log
Browse files Browse the repository at this point in the history
chore: Add debug log for local bundle
  • Loading branch information
ipapast committed Oct 6, 2022
2 parents 7533751 + 85bfd82 commit 9b48446
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/lib/iac/test/v2/local-cache/rules-bundle/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ export async function downloadRulesBundle(
// IAC_BUNDLE_PATH is a developer setting that is not useful to most users. It
// is not a replacement for custom rules.
if (config.IAC_BUNDLE_PATH) {
debugLog(`Located a local rules bundle at ${testConfig.iacCachePath}`);
return config.IAC_BUNDLE_PATH;
}

debugLog(
`Downloading the rules bundle and saving it at ${testConfig.iacCachePath}`,
);

let downloadDurationSeconds = 0;

const timer = new TimerMetricInstance('iac_rules_bundle_download');
Expand Down
7 changes: 0 additions & 7 deletions src/lib/iac/test/v2/local-cache/rules-bundle/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import * as createDebugLogger from 'debug';

import { TestConfig } from '../../types';
import { downloadRulesBundle } from './download';

const debugLogger = createDebugLogger('snyk-iac');

export async function initRulesBundle(testConfig: TestConfig): Promise<string> {
// We are currently using the legacy rules bundle and we need to re-download it each time to use the latest one available.
// debugLogger('Looking for rules bundle locally');
// let rulesBundlePath = await lookupLocalRulesBundle(testConfig);

debugLogger(
`Downloading the rules bundle and saving it at ${testConfig.iacCachePath}`,
);
return await downloadRulesBundle(testConfig);
}

0 comments on commit 9b48446

Please sign in to comment.