Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We can now download the bundle in the snyk-iac-test executable, so we don't need to download it here. We are leaving the env variable `IAC_BUNDLE_PATH` in place, so that it can be used for local development and debugging.
- Loading branch information
Ilianna Papastefanou
committed
Oct 19, 2022
1 parent
10190c0
commit d339015
Showing
11 changed files
with
22 additions
and
425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
src/lib/iac/test/v2/local-cache/policy-engine/constants/utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 0 additions & 108 deletions
108
src/lib/iac/test/v2/local-cache/rules-bundle/download.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
import { TestConfig } from '../../types'; | ||
import { downloadRulesBundle } from './download'; | ||
import config from '../../../../../config'; | ||
import * as createDebugLogger from 'debug'; | ||
|
||
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); | ||
const debugLog = createDebugLogger('snyk-iac'); | ||
|
||
return await downloadRulesBundle(testConfig); | ||
export function getLocalRulesBundle(): string { | ||
// 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) { | ||
return ''; | ||
} | ||
debugLog(`Located a local rules bundle at ${config.IAC_BUNDLE_PATH}`); | ||
return config.IAC_BUNDLE_PATH; | ||
} |
40 changes: 0 additions & 40 deletions
40
src/lib/iac/test/v2/local-cache/rules-bundle/lookup-local.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.