mirror of
https://github.com/github/codeql-action.git
synced 2025-12-10 09:44:32 +08:00
Compare commits
35 Commits
v2.23.2
...
codeql-bun
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf7e9f2349 | ||
|
|
39cc02b1d9 | ||
|
|
15b447d64b | ||
|
|
e1fa6ddb4a | ||
|
|
1d4866b058 | ||
|
|
da89f3f4cf | ||
|
|
921adb69c6 | ||
|
|
e8893c57a1 | ||
|
|
78d6c8e84d | ||
|
|
2db0327171 | ||
|
|
f9dea84e29 | ||
|
|
81eb6b2bf4 | ||
|
|
483bef1dab | ||
|
|
b58c2f67a6 | ||
|
|
f7d53249e3 | ||
|
|
254b53d999 | ||
|
|
e34513334c | ||
|
|
463930c71f | ||
|
|
d982a14465 | ||
|
|
55c1fd5777 | ||
|
|
0166a8a567 | ||
|
|
401f9d6286 | ||
|
|
d2e867f3be | ||
|
|
ec42edcaab | ||
|
|
8c22ec9e5d | ||
|
|
68d348377f | ||
|
|
e33271d071 | ||
|
|
eab49d76a3 | ||
|
|
202c383f78 | ||
|
|
cfefe3a7e8 | ||
|
|
25f779c0f2 | ||
|
|
738d232550 | ||
|
|
5c9716f453 | ||
|
|
a2c5130ffd | ||
|
|
9a9b0e4a8f |
85
.github/workflows/__build-mode-none.yml
generated
vendored
Normal file
85
.github/workflows/__build-mode-none.yml
generated
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
# Warning: This file is generated automatically, and should not be modified.
|
||||
# Instead, please modify the template in the pr-checks directory and run:
|
||||
# (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
|
||||
# to regenerate this file.
|
||||
|
||||
name: PR Check - Build mode none
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GO111MODULE: auto
|
||||
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- releases/v*
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
- ready_for_review
|
||||
workflow_dispatch: {}
|
||||
jobs:
|
||||
build-mode-none:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
name: Build mode none
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: write
|
||||
timeout-minutes: 45
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Setup Python on MacOS
|
||||
uses: actions/setup-python@v5
|
||||
if: >-
|
||||
matrix.os == 'macos-latest' && (
|
||||
|
||||
matrix.version == 'stable-20221211' ||
|
||||
|
||||
matrix.version == 'stable-20230418' ||
|
||||
|
||||
matrix.version == 'stable-v2.13.5' ||
|
||||
|
||||
matrix.version == 'stable-v2.14.6')
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Prepare test
|
||||
id: prepare-test
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: runner.os != 'Windows' && matrix.version == '20221211'
|
||||
shell: bash
|
||||
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
|
||||
- uses: ./../action/init
|
||||
id: init
|
||||
with:
|
||||
build-mode: none
|
||||
db-location: ${{ runner.temp }}/customDbLocation
|
||||
languages: java
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
|
||||
- name: Validate database build mode
|
||||
run: |
|
||||
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
|
||||
build_mode=$(yq eval '.buildMode' "$metadata_path")
|
||||
if [[ "$build_mode" != "none" ]]; then
|
||||
echo "Expected build mode to be 'none' but was $build_mode"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- uses: ./../action/autobuild
|
||||
- uses: ./../action/analyze
|
||||
env:
|
||||
CODEQL_ACTION_TEST_MODE: true
|
||||
37
.github/workflows/__with-checkout-path.yml
generated
vendored
37
.github/workflows/__with-checkout-path.yml
generated
vendored
@@ -25,48 +25,12 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: stable-20221211
|
||||
- os: macos-latest
|
||||
version: stable-20221211
|
||||
- os: windows-latest
|
||||
version: stable-20221211
|
||||
- os: ubuntu-latest
|
||||
version: stable-20230418
|
||||
- os: macos-latest
|
||||
version: stable-20230418
|
||||
- os: windows-latest
|
||||
version: stable-20230418
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.13.5
|
||||
- os: macos-latest
|
||||
version: stable-v2.13.5
|
||||
- os: windows-latest
|
||||
version: stable-v2.13.5
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.14.6
|
||||
- os: macos-latest
|
||||
version: stable-v2.14.6
|
||||
- os: windows-latest
|
||||
version: stable-v2.14.6
|
||||
- os: ubuntu-latest
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: default
|
||||
- os: windows-latest
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
version: latest
|
||||
- os: windows-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
version: nightly-latest
|
||||
- os: windows-latest
|
||||
version: nightly-latest
|
||||
name: Use a custom `checkout_path`
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -120,7 +84,6 @@ jobs:
|
||||
# it's enough to test one compiled language and one interpreted language
|
||||
languages: csharp,javascript
|
||||
source-root: x/y/z/some-path/tests/multi-language-repo
|
||||
debug: true
|
||||
|
||||
- name: Build code
|
||||
shell: bash
|
||||
|
||||
@@ -4,6 +4,14 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
|
||||
|
||||
Note that the only difference between `v2` and `v3` of the CodeQL Action is the node version they support, with `v3` running on node 20 while we continue to release `v2` to support running on node 16. For example `3.22.11` was the first `v3` release and is functionally identical to `2.22.11`. This approach ensures an easy way to track exactly which features are included in different versions, indicated by the minor and patch version numbers.
|
||||
|
||||
## [UNRELEASED]
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 3.24.0 - 02 Feb 2024
|
||||
|
||||
- CodeQL Python analysis will no longer install dependencies on GitHub Enterprise Server, as is already the case for GitHub.com. See [release notes for 3.23.0](#3230---08-jan-2024) for more details. [#2106](https://github.com/github/codeql-action/pull/2106)
|
||||
|
||||
## 3.23.2 - 26 Jan 2024
|
||||
|
||||
- On Linux, the maximum possible value for the `--threads` option now respects the CPU count as specified in `cgroup` files to more accurately reflect the number of available cores when running in containers. [#2083](https://github.com/github/codeql-action/pull/2083)
|
||||
|
||||
13
README.md
13
README.md
@@ -16,6 +16,19 @@ We recommend using default setup to configure CodeQL analysis for your repositor
|
||||
|
||||
You can also configure advanced setup for a repository to find security vulnerabilities in your code using a highly customizable code scanning configuration. For more information, see "[Configuring advanced setup for code scanning](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/configuring-advanced-setup-for-code-scanning)" and "[Customizing your advanced setup for code scanning](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning)."
|
||||
|
||||
## Supported versions of the CodeQL Action
|
||||
|
||||
The following versions of the CodeQL Action are currently supported:
|
||||
|
||||
- v3 (latest)
|
||||
- v2 (deprecated, support will end on December 5th, 2024)
|
||||
|
||||
The only difference between CodeQL Action v2 and v3 is the version of Node.js on which they run. CodeQL Action v3 runs on Node 20, while CodeQL Action v2 runs on Node 16.
|
||||
|
||||
To provide the best experience to customers using older versions of GitHub Enterprise Server, we will continue to release CodeQL Action v2 so that these customers can continue to run the latest version of CodeQL as long as their version of GitHub Enterprise Server is supported. For example CodeQL Action v3.22.11 was the first release of CodeQL Action v3 and is functionally identical to v2.22.11. This approach provides an easy way to track exactly which features are included in different versions by looking at the minor and patch version numbers.
|
||||
|
||||
For more information, see ["Code scanning: deprecation of CodeQL Action v2."](https://github.blog/changelog/2024-01-12-code-scanning-deprecation-of-codeql-action-v2/).
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Read about [troubleshooting code scanning](https://docs.github.com/en/code-security/code-scanning/troubleshooting-code-scanning).
|
||||
|
||||
@@ -52,10 +52,10 @@ inputs:
|
||||
# If changing this, make sure to update workflow.ts accordingly.
|
||||
default: ${{ github.workspace }}
|
||||
ref:
|
||||
description: "The ref where results will be uploaded. If not provided, the Action will use the GITHUB_REF environment variable. If provided, the sha input must be provided as well. This input is not available in pull requests from forks."
|
||||
description: "The ref where results will be uploaded. If not provided, the Action will use the GITHUB_REF environment variable. If provided, the sha input must be provided as well. This input is ignored for pull requests from forks."
|
||||
required: false
|
||||
sha:
|
||||
description: "The sha of the HEAD of the ref where results will be uploaded. If not provided, the Action will use the GITHUB_SHA environment variable. If provided, the ref input must be provided as well. This input is not available in pull requests from forks."
|
||||
description: "The sha of the HEAD of the ref where results will be uploaded. If not provided, the Action will use the GITHUB_SHA environment variable. If provided, the ref input must be provided as well. This input is ignored for pull requests from forks."
|
||||
required: false
|
||||
category:
|
||||
description: String used by Code Scanning for matching the analyses
|
||||
|
||||
@@ -10,6 +10,23 @@ inputs:
|
||||
description: |
|
||||
A comma-separated value of the languages to be analysed e.g. python,javascript
|
||||
required: false
|
||||
build-mode:
|
||||
description: >-
|
||||
[Experimental, for internal testing only] The build mode that will be used to analyze the language.
|
||||
This input is only available in single-language analyses.
|
||||
|
||||
Available build modes will differ based on the language being analyzed. One of:
|
||||
|
||||
- none: The database will be created without building the source code.
|
||||
Available for all interpreted languages and some compiled languages.
|
||||
- autobuild: The database will be created by attempting to automatically build the source code.
|
||||
To use this build mode, ensure that your workflow calls the `autobuild` action
|
||||
between the `init` and `analyze` steps.
|
||||
Available for all compiled languages.
|
||||
- manual: The database will be created by building the source code using a manually specified
|
||||
build command. To use this build mode, specify manual build steps in your workflow
|
||||
between the `init` and `analyze` steps. Available for all compiled languages.
|
||||
required: false
|
||||
token:
|
||||
description: GitHub token to use for authenticating with this instance of GitHub. To download custom packs from multiple registries, use the registries input.
|
||||
default: ${{ github.token }}
|
||||
|
||||
18
lib/analyze.test.js
generated
18
lib/analyze.test.js
generated
@@ -95,25 +95,11 @@ const util = __importStar(require("./util"));
|
||||
},
|
||||
databasePrintBaseline: async () => "",
|
||||
});
|
||||
const config = {
|
||||
const config = (0, testing_utils_1.createTestConfig)({
|
||||
languages: [language],
|
||||
originalUserInput: {},
|
||||
tempDir: tmpDir,
|
||||
codeQLCmd: "",
|
||||
gitHubVersion: {
|
||||
type: util.GitHubVariant.DOTCOM,
|
||||
},
|
||||
dbLocation: path.resolve(tmpDir, "codeql_databases"),
|
||||
debugMode: false,
|
||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: {
|
||||
packsInputCombines: false,
|
||||
queriesInputCombines: false,
|
||||
},
|
||||
trapCaches: {},
|
||||
trapCacheDownloadTime: 0,
|
||||
};
|
||||
});
|
||||
fs.mkdirSync(util.getCodeQLDatabasePath(config, language), {
|
||||
recursive: true,
|
||||
});
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"analyze.test.js","sourceRoot":"","sources":["../src/analyze.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,8CAAuB;AACvB,6CAA+B;AAE/B,uCAAuC;AACvC,qCAAqC;AAErC,mDAA0C;AAC1C,2CAAuC;AACvC,uCAA4C;AAC5C,mDAA+E;AAC/E,wDAA0C;AAC1C,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB;;;;;GAKG;AACH,IAAA,aAAI,EAAC,sBAAsB,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,CAAC,IAAI,EAAE,EAAE;gBAC5C,2BAA2B,QAAQ,cAAc;gBACjD,eAAe;gBACf,qBAAqB,QAAQ,cAAc;aAC5C,CAAC,CAAC;YACH,KAAK,MAAM,WAAW,IAAI,YAAY,CAAC,aAAc,EAAE,CAAC;gBACtD,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,mCAAmC,CAAC,CAAC;gBACpE,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,WAAW,CAAC,CAAC;gBACpC,CAAC,CAAC,IAAI,CAAC,aAAa,IAAI,WAAW,CAAC,UAAW,CAAC,CAAC;YACnD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
||||
14
lib/codeql.js
generated
14
lib/codeql.js
generated
@@ -35,6 +35,7 @@ const environment_1 = require("./environment");
|
||||
const feature_flags_1 = require("./feature-flags");
|
||||
const languages_1 = require("./languages");
|
||||
const setupCodeql = __importStar(require("./setup-codeql"));
|
||||
const tools_features_1 = require("./tools-features");
|
||||
const util = __importStar(require("./util"));
|
||||
const util_1 = require("./util");
|
||||
class CommandInvocationError extends Error {
|
||||
@@ -201,10 +202,12 @@ function resolveFunction(partialCodeql, methodName, defaultImplementation) {
|
||||
function setCodeQL(partialCodeql) {
|
||||
cachedCodeQL = {
|
||||
getPath: resolveFunction(partialCodeql, "getPath", () => "/tmp/dummy-path"),
|
||||
getVersion: resolveFunction(partialCodeql, "getVersion", () => new Promise((resolve) => resolve({
|
||||
getVersion: resolveFunction(partialCodeql, "getVersion", async () => ({
|
||||
version: "1.0.0",
|
||||
}))),
|
||||
})),
|
||||
printVersion: resolveFunction(partialCodeql, "printVersion"),
|
||||
supportsFeature: resolveFunction(partialCodeql, "supportsFeature", async (feature) => !!partialCodeql.getVersion &&
|
||||
(0, tools_features_1.isSupportedToolsFeature)(await partialCodeql.getVersion(), feature)),
|
||||
databaseInitCluster: resolveFunction(partialCodeql, "databaseInitCluster"),
|
||||
runAutobuild: resolveFunction(partialCodeql, "runAutobuild"),
|
||||
extractScannedLanguage: resolveFunction(partialCodeql, "extractScannedLanguage"),
|
||||
@@ -279,6 +282,9 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
||||
async printVersion() {
|
||||
await runTool(cmd, ["version", "--format=json"]);
|
||||
},
|
||||
async supportsFeature(feature) {
|
||||
return (0, tools_features_1.isSupportedToolsFeature)(await this.getVersion(), feature);
|
||||
},
|
||||
async databaseInitCluster(config, sourceRoot, processName, qlconfigFile, logger) {
|
||||
const extraArgs = config.languages.map((language) => `--language=${language}`);
|
||||
if (config.languages.filter((l) => (0, languages_1.isTracedLanguage)(l)).length > 0) {
|
||||
@@ -292,6 +298,10 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
||||
if (externalRepositoryToken) {
|
||||
extraArgs.push("--external-repository-token-stdin");
|
||||
}
|
||||
if (config.buildMode !== undefined &&
|
||||
(await this.supportsFeature(tools_features_1.ToolsFeature.BuildModeOption))) {
|
||||
extraArgs.push(`--build-mode=${config.buildMode}`);
|
||||
}
|
||||
if (qlconfigFile !== undefined &&
|
||||
(await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_INIT_WITH_QLCONFIG))) {
|
||||
extraArgs.push(`--qlconfig-file=${qlconfigFile}`);
|
||||
|
||||
File diff suppressed because one or more lines are too long
20
lib/codeql.test.js
generated
20
lib/codeql.test.js
generated
@@ -49,25 +49,9 @@ const util_1 = require("./util");
|
||||
let stubConfig;
|
||||
ava_1.default.beforeEach(() => {
|
||||
(0, util_1.initializeEnvironment)("1.2.3");
|
||||
stubConfig = {
|
||||
stubConfig = (0, testing_utils_1.createTestConfig)({
|
||||
languages: [languages_1.Language.cpp],
|
||||
originalUserInput: {},
|
||||
tempDir: "",
|
||||
codeQLCmd: "",
|
||||
gitHubVersion: {
|
||||
type: util.GitHubVariant.DOTCOM,
|
||||
},
|
||||
dbLocation: "",
|
||||
debugMode: false,
|
||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: {
|
||||
packsInputCombines: false,
|
||||
queriesInputCombines: false,
|
||||
},
|
||||
trapCaches: {},
|
||||
trapCacheDownloadTime: 0,
|
||||
};
|
||||
});
|
||||
});
|
||||
async function installIntoToolcache({ apiDetails = testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, cliVersion, isPinned, tagName, tmpDir, }) {
|
||||
const url = (0, testing_utils_1.mockBundleDownloadApi)({ apiDetails, isPinned, tagName });
|
||||
|
||||
File diff suppressed because one or more lines are too long
46
lib/config-utils.js
generated
46
lib/config-utils.js
generated
@@ -212,16 +212,17 @@ exports.getRawLanguages = getRawLanguages;
|
||||
/**
|
||||
* Get the default config for when the user has not supplied one.
|
||||
*/
|
||||
async function getDefaultConfig(languagesInput, rawQueriesInput, rawPacksInput, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, gitHubVersion, logger) {
|
||||
const languages = await getLanguages(codeQL, languagesInput, repository, logger);
|
||||
const augmentationProperties = calculateAugmentation(rawPacksInput, rawQueriesInput, languages);
|
||||
const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime(trapCachingEnabled, codeQL, languages, logger);
|
||||
async function getDefaultConfig({ languagesInput, queriesInput, packsInput, buildModeInput, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeql, githubVersion, logger, }) {
|
||||
const languages = await getLanguages(codeql, languagesInput, repository, logger);
|
||||
const augmentationProperties = calculateAugmentation(packsInput, queriesInput, languages);
|
||||
const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime(trapCachingEnabled, codeql, languages, logger);
|
||||
return {
|
||||
languages,
|
||||
buildMode: buildModeInput,
|
||||
originalUserInput: {},
|
||||
tempDir,
|
||||
codeQLCmd: codeQL.getPath(),
|
||||
gitHubVersion,
|
||||
codeQLCmd: codeql.getPath(),
|
||||
gitHubVersion: githubVersion,
|
||||
dbLocation: dbLocationOrDefault(dbLocation, tempDir),
|
||||
debugMode,
|
||||
debugArtifactName,
|
||||
@@ -245,7 +246,7 @@ async function downloadCacheWithTime(trapCachingEnabled, codeQL, languages, logg
|
||||
/**
|
||||
* Load the config from the given file.
|
||||
*/
|
||||
async function loadConfig(languagesInput, rawQueriesInput, rawPacksInput, configFile, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, logger) {
|
||||
async function loadConfig({ languagesInput, queriesInput, packsInput, buildModeInput, configFile, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeql, workspacePath, githubVersion, apiDetails, logger, }) {
|
||||
let parsedYAML;
|
||||
if (isLocal(configFile)) {
|
||||
// Treat the config file as relative to the workspace
|
||||
@@ -255,15 +256,16 @@ async function loadConfig(languagesInput, rawQueriesInput, rawPacksInput, config
|
||||
else {
|
||||
parsedYAML = await getRemoteConfig(configFile, apiDetails);
|
||||
}
|
||||
const languages = await getLanguages(codeQL, languagesInput, repository, logger);
|
||||
const augmentationProperties = calculateAugmentation(rawPacksInput, rawQueriesInput, languages);
|
||||
const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime(trapCachingEnabled, codeQL, languages, logger);
|
||||
const languages = await getLanguages(codeql, languagesInput, repository, logger);
|
||||
const augmentationProperties = calculateAugmentation(packsInput, queriesInput, languages);
|
||||
const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime(trapCachingEnabled, codeql, languages, logger);
|
||||
return {
|
||||
languages,
|
||||
buildMode: buildModeInput,
|
||||
originalUserInput: parsedYAML,
|
||||
tempDir,
|
||||
codeQLCmd: codeQL.getPath(),
|
||||
gitHubVersion,
|
||||
codeQLCmd: codeql.getPath(),
|
||||
gitHubVersion: githubVersion,
|
||||
dbLocation: dbLocationOrDefault(dbLocation, tempDir),
|
||||
debugMode,
|
||||
debugArtifactName,
|
||||
@@ -452,24 +454,26 @@ function dbLocationOrDefault(dbLocation, tempDir) {
|
||||
* This will parse the config from the user input if present, or generate
|
||||
* a default config. The parsed config is then stored to a known location.
|
||||
*/
|
||||
async function initConfig(languagesInput, queriesInput, packsInput, configFile, dbLocation, configInput, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, logger) {
|
||||
async function initConfig(inputs) {
|
||||
let config;
|
||||
const { logger, workspacePath } = inputs;
|
||||
// if configInput is set, it takes precedence over configFile
|
||||
if (configInput) {
|
||||
if (configFile) {
|
||||
if (inputs.configInput) {
|
||||
if (inputs.configFile) {
|
||||
logger.warning(`Both a config file and config input were provided. Ignoring config file.`);
|
||||
}
|
||||
configFile = path.resolve(workspacePath, "user-config-from-action.yml");
|
||||
fs.writeFileSync(configFile, configInput);
|
||||
logger.debug(`Using config from action input: ${configFile}`);
|
||||
inputs.configFile = path.resolve(workspacePath, "user-config-from-action.yml");
|
||||
fs.writeFileSync(inputs.configFile, inputs.configInput);
|
||||
logger.debug(`Using config from action input: ${inputs.configFile}`);
|
||||
}
|
||||
// If no config file was provided create an empty one
|
||||
if (!configFile) {
|
||||
if (!inputs.configFile) {
|
||||
logger.debug("No configuration file was provided");
|
||||
config = await getDefaultConfig(languagesInput, queriesInput, packsInput, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, gitHubVersion, logger);
|
||||
config = await getDefaultConfig(inputs);
|
||||
}
|
||||
else {
|
||||
config = await loadConfig(languagesInput, queriesInput, packsInput, configFile, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, logger);
|
||||
// Convince the type checker that inputs.configFile is defined.
|
||||
config = await loadConfig({ ...inputs, configFile: inputs.configFile });
|
||||
}
|
||||
// Save the config so we can easily access it again in the future
|
||||
await saveConfig(config, logger);
|
||||
|
||||
File diff suppressed because one or more lines are too long
220
lib/config-utils.test.js
generated
220
lib/config-utils.test.js
generated
@@ -41,14 +41,35 @@ const repository_1 = require("./repository");
|
||||
const testing_utils_1 = require("./testing-utils");
|
||||
const util_1 = require("./util");
|
||||
(0, testing_utils_1.setupTests)(ava_1.default);
|
||||
const sampleApiDetails = {
|
||||
auth: "token",
|
||||
externalRepoAuth: "token",
|
||||
url: "https://github.example.com",
|
||||
apiURL: undefined,
|
||||
registriesAuthTokens: undefined,
|
||||
};
|
||||
const gitHubVersion = { type: util_1.GitHubVariant.DOTCOM };
|
||||
const githubVersion = { type: util_1.GitHubVariant.DOTCOM };
|
||||
function createTestInitConfigInputs(overrides) {
|
||||
return Object.assign({}, {
|
||||
languagesInput: undefined,
|
||||
queriesInput: undefined,
|
||||
packsInput: undefined,
|
||||
configFile: undefined,
|
||||
dbLocation: undefined,
|
||||
configInput: undefined,
|
||||
buildModeInput: undefined,
|
||||
trapCachingEnabled: false,
|
||||
debugMode: false,
|
||||
debugArtifactName: "",
|
||||
debugDatabaseName: "",
|
||||
repository: { owner: "github", repo: "example" },
|
||||
tempDir: "",
|
||||
codeql: {},
|
||||
workspacePath: "",
|
||||
githubVersion,
|
||||
apiDetails: {
|
||||
auth: "token",
|
||||
externalRepoAuth: "token",
|
||||
url: "https://github.example.com",
|
||||
apiURL: undefined,
|
||||
registriesAuthTokens: undefined,
|
||||
},
|
||||
logger: (0, logging_1.getRunnerLogger)(true),
|
||||
}, overrides);
|
||||
}
|
||||
// Returns the filepath of the newly-created file
|
||||
function createConfigFile(inputFileContents, tmpDir) {
|
||||
const configFilePath = path.join(tmpDir, "input");
|
||||
@@ -83,10 +104,10 @@ function mockListLanguages(languages) {
|
||||
sinon.stub(api, "getApiClient").value(() => client);
|
||||
}
|
||||
(0, ava_1.default)("load empty config", async (t) => {
|
||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||
const logger = (0, logging_1.getRunnerLogger)(true);
|
||||
const languages = "javascript,python";
|
||||
const codeQL = (0, codeql_1.setCodeQL)({
|
||||
const codeql = (0, codeql_1.setCodeQL)({
|
||||
async resolveQueries() {
|
||||
return {
|
||||
byLanguage: {
|
||||
@@ -101,14 +122,25 @@ function mockListLanguages(languages) {
|
||||
return { packs: [] };
|
||||
},
|
||||
});
|
||||
const config = await configUtils.initConfig(languages, undefined, undefined, undefined, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, logger);
|
||||
t.deepEqual(config, await configUtils.getDefaultConfig(languages, undefined, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, codeQL, gitHubVersion, logger));
|
||||
const config = await configUtils.initConfig(createTestInitConfigInputs({
|
||||
languagesInput: languages,
|
||||
repository: { owner: "github", repo: "example" },
|
||||
tempDir,
|
||||
codeql,
|
||||
logger,
|
||||
}));
|
||||
t.deepEqual(config, await configUtils.getDefaultConfig(createTestInitConfigInputs({
|
||||
languagesInput: languages,
|
||||
tempDir,
|
||||
codeql,
|
||||
logger,
|
||||
})));
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("loading config saves config", async (t) => {
|
||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||
const logger = (0, logging_1.getRunnerLogger)(true);
|
||||
const codeQL = (0, codeql_1.setCodeQL)({
|
||||
const codeql = (0, codeql_1.setCodeQL)({
|
||||
async resolveQueries() {
|
||||
return {
|
||||
byLanguage: {
|
||||
@@ -124,14 +156,20 @@ function mockListLanguages(languages) {
|
||||
},
|
||||
});
|
||||
// Sanity check the saved config file does not already exist
|
||||
t.false(fs.existsSync(configUtils.getPathToParsedConfigFile(tmpDir)));
|
||||
t.false(fs.existsSync(configUtils.getPathToParsedConfigFile(tempDir)));
|
||||
// Sanity check that getConfig returns undefined before we have called initConfig
|
||||
t.deepEqual(await configUtils.getConfig(tmpDir, logger), undefined);
|
||||
const config1 = await configUtils.initConfig("javascript,python", undefined, undefined, undefined, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, logger);
|
||||
t.deepEqual(await configUtils.getConfig(tempDir, logger), undefined);
|
||||
const config1 = await configUtils.initConfig(createTestInitConfigInputs({
|
||||
languagesInput: "javascript,python",
|
||||
tempDir,
|
||||
codeql,
|
||||
workspacePath: tempDir,
|
||||
logger,
|
||||
}));
|
||||
// The saved config file should now exist
|
||||
t.true(fs.existsSync(configUtils.getPathToParsedConfigFile(tmpDir)));
|
||||
t.true(fs.existsSync(configUtils.getPathToParsedConfigFile(tempDir)));
|
||||
// And that same newly-initialised config should now be returned by getConfig
|
||||
const config2 = await configUtils.getConfig(tmpDir, logger);
|
||||
const config2 = await configUtils.getConfig(tempDir, logger);
|
||||
t.not(config2, undefined);
|
||||
if (config2 !== undefined) {
|
||||
// removes properties assigned to undefined.
|
||||
@@ -141,22 +179,32 @@ function mockListLanguages(languages) {
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("load input outside of workspace", async (t) => {
|
||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||
try {
|
||||
await configUtils.initConfig(undefined, undefined, undefined, "../input", undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, (0, codeql_1.getCachedCodeQL)(), tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
||||
await configUtils.initConfig(createTestInitConfigInputs({
|
||||
configFile: "../input",
|
||||
tempDir,
|
||||
codeql: (0, codeql_1.getCachedCodeQL)(),
|
||||
workspacePath: tempDir,
|
||||
}));
|
||||
throw new Error("initConfig did not throw error");
|
||||
}
|
||||
catch (err) {
|
||||
t.deepEqual(err, new util_1.UserError(configUtils.getConfigFileOutsideWorkspaceErrorMessage(path.join(tmpDir, "../input"))));
|
||||
t.deepEqual(err, new util_1.UserError(configUtils.getConfigFileOutsideWorkspaceErrorMessage(path.join(tempDir, "../input"))));
|
||||
}
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("load non-local input with invalid repo syntax", async (t) => {
|
||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||
// no filename given, just a repo
|
||||
const configFile = "octo-org/codeql-config@main";
|
||||
try {
|
||||
await configUtils.initConfig(undefined, undefined, undefined, configFile, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, (0, codeql_1.getCachedCodeQL)(), tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
||||
await configUtils.initConfig(createTestInitConfigInputs({
|
||||
configFile,
|
||||
tempDir,
|
||||
codeql: (0, codeql_1.getCachedCodeQL)(),
|
||||
workspacePath: tempDir,
|
||||
}));
|
||||
throw new Error("initConfig did not throw error");
|
||||
}
|
||||
catch (err) {
|
||||
@@ -165,22 +213,28 @@ function mockListLanguages(languages) {
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("load non-existent input", async (t) => {
|
||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
const languages = "javascript";
|
||||
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||
const languagesInput = "javascript";
|
||||
const configFile = "input";
|
||||
t.false(fs.existsSync(path.join(tmpDir, configFile)));
|
||||
t.false(fs.existsSync(path.join(tempDir, configFile)));
|
||||
try {
|
||||
await configUtils.initConfig(languages, undefined, undefined, configFile, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, (0, codeql_1.getCachedCodeQL)(), tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
||||
await configUtils.initConfig(createTestInitConfigInputs({
|
||||
languagesInput,
|
||||
configFile,
|
||||
tempDir,
|
||||
codeql: (0, codeql_1.getCachedCodeQL)(),
|
||||
workspacePath: tempDir,
|
||||
}));
|
||||
throw new Error("initConfig did not throw error");
|
||||
}
|
||||
catch (err) {
|
||||
t.deepEqual(err, new util_1.UserError(configUtils.getConfigFileDoesNotExistErrorMessage(path.join(tmpDir, "input"))));
|
||||
t.deepEqual(err, new util_1.UserError(configUtils.getConfigFileDoesNotExistErrorMessage(path.join(tempDir, "input"))));
|
||||
}
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("load non-empty input", async (t) => {
|
||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
const codeQL = (0, codeql_1.setCodeQL)({
|
||||
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||
const codeql = (0, codeql_1.setCodeQL)({
|
||||
async resolveQueries() {
|
||||
return {
|
||||
byLanguage: {
|
||||
@@ -208,10 +262,11 @@ function mockListLanguages(languages) {
|
||||
- b
|
||||
paths:
|
||||
- c/d`;
|
||||
fs.mkdirSync(path.join(tmpDir, "foo"));
|
||||
fs.mkdirSync(path.join(tempDir, "foo"));
|
||||
// And the config we expect it to parse to
|
||||
const expectedConfig = {
|
||||
languages: [languages_1.Language.javascript],
|
||||
buildMode: "none",
|
||||
originalUserInput: {
|
||||
name: "my config",
|
||||
"disable-default-queries": true,
|
||||
@@ -219,10 +274,10 @@ function mockListLanguages(languages) {
|
||||
"paths-ignore": ["a", "b"],
|
||||
paths: ["c/d"],
|
||||
},
|
||||
tempDir: tmpDir,
|
||||
codeQLCmd: codeQL.getPath(),
|
||||
gitHubVersion,
|
||||
dbLocation: path.resolve(tmpDir, "codeql_databases"),
|
||||
tempDir,
|
||||
codeQLCmd: codeql.getPath(),
|
||||
gitHubVersion: githubVersion,
|
||||
dbLocation: path.resolve(tempDir, "codeql_databases"),
|
||||
debugMode: false,
|
||||
debugArtifactName: "my-artifact",
|
||||
debugDatabaseName: "my-db",
|
||||
@@ -230,9 +285,18 @@ function mockListLanguages(languages) {
|
||||
trapCaches: {},
|
||||
trapCacheDownloadTime: 0,
|
||||
};
|
||||
const languages = "javascript";
|
||||
const configFilePath = createConfigFile(inputFileContents, tmpDir);
|
||||
const actualConfig = await configUtils.initConfig(languages, undefined, undefined, configFilePath, undefined, undefined, false, false, "my-artifact", "my-db", { owner: "github", repo: "example" }, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
||||
const languagesInput = "javascript";
|
||||
const configFilePath = createConfigFile(inputFileContents, tempDir);
|
||||
const actualConfig = await configUtils.initConfig(createTestInitConfigInputs({
|
||||
languagesInput,
|
||||
buildModeInput: "none",
|
||||
configFile: configFilePath,
|
||||
debugArtifactName: "my-artifact",
|
||||
debugDatabaseName: "my-db",
|
||||
tempDir,
|
||||
codeql,
|
||||
workspacePath: tempDir,
|
||||
}));
|
||||
// Should exactly equal the object we constructed earlier
|
||||
t.deepEqual(actualConfig, expectedConfig);
|
||||
});
|
||||
@@ -256,14 +320,14 @@ function queriesToResolvedQueryForm(queries) {
|
||||
};
|
||||
}
|
||||
(0, ava_1.default)("Using config input and file together, config input should be used.", async (t) => {
|
||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
process.env["RUNNER_TEMP"] = tmpDir;
|
||||
process.env["GITHUB_WORKSPACE"] = tmpDir;
|
||||
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||
process.env["RUNNER_TEMP"] = tempDir;
|
||||
process.env["GITHUB_WORKSPACE"] = tempDir;
|
||||
const inputFileContents = `
|
||||
name: my config
|
||||
queries:
|
||||
- uses: ./foo_file`;
|
||||
const configFilePath = createConfigFile(inputFileContents, tmpDir);
|
||||
const configFilePath = createConfigFile(inputFileContents, tempDir);
|
||||
const configInput = `
|
||||
name: my config
|
||||
queries:
|
||||
@@ -274,9 +338,9 @@ function queriesToResolvedQueryForm(queries) {
|
||||
python:
|
||||
- c/d@1.2.3
|
||||
`;
|
||||
fs.mkdirSync(path.join(tmpDir, "foo"));
|
||||
fs.mkdirSync(path.join(tempDir, "foo"));
|
||||
const resolveQueriesArgs = [];
|
||||
const codeQL = (0, codeql_1.setCodeQL)({
|
||||
const codeql = (0, codeql_1.setCodeQL)({
|
||||
async resolveQueries(queries, extraSearchPath) {
|
||||
resolveQueriesArgs.push({ queries, extraSearchPath });
|
||||
return queriesToResolvedQueryForm(queries);
|
||||
@@ -286,14 +350,21 @@ function queriesToResolvedQueryForm(queries) {
|
||||
},
|
||||
});
|
||||
// Only JS, python packs will be ignored
|
||||
const languages = "javascript";
|
||||
const config = await configUtils.initConfig(languages, undefined, undefined, undefined, configFilePath, configInput, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
||||
const languagesInput = "javascript";
|
||||
const config = await configUtils.initConfig(createTestInitConfigInputs({
|
||||
languagesInput,
|
||||
configFile: configFilePath,
|
||||
configInput,
|
||||
tempDir,
|
||||
codeql,
|
||||
workspacePath: tempDir,
|
||||
}));
|
||||
t.deepEqual(config.originalUserInput, yaml.load(configInput));
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("API client used when reading remote config", async (t) => {
|
||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
const codeQL = (0, codeql_1.setCodeQL)({
|
||||
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||
const codeql = (0, codeql_1.setCodeQL)({
|
||||
async resolveQueries() {
|
||||
return {
|
||||
byLanguage: {
|
||||
@@ -326,20 +397,31 @@ function queriesToResolvedQueryForm(queries) {
|
||||
};
|
||||
const spyGetContents = mockGetContents(dummyResponse);
|
||||
// Create checkout directory for remote queries repository
|
||||
fs.mkdirSync(path.join(tmpDir, "foo/bar/dev"), { recursive: true });
|
||||
fs.mkdirSync(path.join(tempDir, "foo/bar/dev"), { recursive: true });
|
||||
const configFile = "octo-org/codeql-config/config.yaml@main";
|
||||
const languages = "javascript";
|
||||
await configUtils.initConfig(languages, undefined, undefined, configFile, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
||||
const languagesInput = "javascript";
|
||||
await configUtils.initConfig(createTestInitConfigInputs({
|
||||
languagesInput,
|
||||
configFile,
|
||||
tempDir,
|
||||
codeql,
|
||||
workspacePath: tempDir,
|
||||
}));
|
||||
t.assert(spyGetContents.called);
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("Remote config handles the case where a directory is provided", async (t) => {
|
||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||
const dummyResponse = []; // directories are returned as arrays
|
||||
mockGetContents(dummyResponse);
|
||||
const repoReference = "octo-org/codeql-config/config.yaml@main";
|
||||
try {
|
||||
await configUtils.initConfig(undefined, undefined, undefined, repoReference, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, (0, codeql_1.getCachedCodeQL)(), tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
||||
await configUtils.initConfig(createTestInitConfigInputs({
|
||||
configFile: repoReference,
|
||||
tempDir,
|
||||
codeql: (0, codeql_1.getCachedCodeQL)(),
|
||||
workspacePath: tempDir,
|
||||
}));
|
||||
throw new Error("initConfig did not throw error");
|
||||
}
|
||||
catch (err) {
|
||||
@@ -348,14 +430,19 @@ function queriesToResolvedQueryForm(queries) {
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("Invalid format of remote config handled correctly", async (t) => {
|
||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||
const dummyResponse = {
|
||||
// note no "content" property here
|
||||
};
|
||||
mockGetContents(dummyResponse);
|
||||
const repoReference = "octo-org/codeql-config/config.yaml@main";
|
||||
try {
|
||||
await configUtils.initConfig(undefined, undefined, undefined, repoReference, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, (0, codeql_1.getCachedCodeQL)(), tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
||||
await configUtils.initConfig(createTestInitConfigInputs({
|
||||
configFile: repoReference,
|
||||
tempDir,
|
||||
codeql: (0, codeql_1.getCachedCodeQL)(),
|
||||
workspacePath: tempDir,
|
||||
}));
|
||||
throw new Error("initConfig did not throw error");
|
||||
}
|
||||
catch (err) {
|
||||
@@ -364,9 +451,9 @@ function queriesToResolvedQueryForm(queries) {
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("No detected languages", async (t) => {
|
||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||
mockListLanguages([]);
|
||||
const codeQL = (0, codeql_1.setCodeQL)({
|
||||
const codeql = (0, codeql_1.setCodeQL)({
|
||||
async resolveLanguages() {
|
||||
return {};
|
||||
},
|
||||
@@ -375,7 +462,11 @@ function queriesToResolvedQueryForm(queries) {
|
||||
},
|
||||
});
|
||||
try {
|
||||
await configUtils.initConfig(undefined, undefined, undefined, undefined, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
||||
await configUtils.initConfig(createTestInitConfigInputs({
|
||||
tempDir,
|
||||
codeql,
|
||||
workspacePath: tempDir,
|
||||
}));
|
||||
throw new Error("initConfig did not throw error");
|
||||
}
|
||||
catch (err) {
|
||||
@@ -384,10 +475,15 @@ function queriesToResolvedQueryForm(queries) {
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("Unknown languages", async (t) => {
|
||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
const languages = "rubbish,english";
|
||||
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||
const languagesInput = "rubbish,english";
|
||||
try {
|
||||
await configUtils.initConfig(languages, undefined, undefined, undefined, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, (0, codeql_1.getCachedCodeQL)(), tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
||||
await configUtils.initConfig(createTestInitConfigInputs({
|
||||
languagesInput,
|
||||
tempDir,
|
||||
codeql: (0, codeql_1.getCachedCodeQL)(),
|
||||
workspacePath: tempDir,
|
||||
}));
|
||||
throw new Error("initConfig did not throw error");
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
15
lib/database-upload.test.js
generated
15
lib/database-upload.test.js
generated
@@ -33,7 +33,6 @@ const sinon = __importStar(require("sinon"));
|
||||
const actionsUtil = __importStar(require("./actions-util"));
|
||||
const apiClient = __importStar(require("./api-client"));
|
||||
const codeql_1 = require("./codeql");
|
||||
const config_utils_1 = require("./config-utils");
|
||||
const database_upload_1 = require("./database-upload");
|
||||
const languages_1 = require("./languages");
|
||||
const testing_utils_1 = require("./testing-utils");
|
||||
@@ -49,20 +48,10 @@ const testApiDetails = {
|
||||
apiURL: undefined,
|
||||
};
|
||||
function getTestConfig(tmpDir) {
|
||||
return {
|
||||
return (0, testing_utils_1.createTestConfig)({
|
||||
languages: [languages_1.Language.javascript],
|
||||
originalUserInput: {},
|
||||
tempDir: tmpDir,
|
||||
codeQLCmd: "foo",
|
||||
gitHubVersion: { type: util_1.GitHubVariant.DOTCOM },
|
||||
dbLocation: tmpDir,
|
||||
debugMode: false,
|
||||
debugArtifactName: util_1.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: util_1.DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: config_utils_1.defaultAugmentationProperties,
|
||||
trapCaches: {},
|
||||
trapCacheDownloadTime: 0,
|
||||
};
|
||||
});
|
||||
}
|
||||
async function mockHttpRequests(databaseUploadStatusCode) {
|
||||
// Passing an auth token is required, so we just use a dummy value
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
lib/feature-flags.js
generated
2
lib/feature-flags.js
generated
@@ -105,7 +105,7 @@ exports.featureConfig = {
|
||||
// here!
|
||||
envVar: "CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION",
|
||||
minimumVersion: "2.16.0",
|
||||
defaultValue: false,
|
||||
defaultValue: true,
|
||||
},
|
||||
};
|
||||
exports.FEATURE_FLAGS_FILE_NAME = "cached-feature-flags.json";
|
||||
|
||||
File diff suppressed because one or more lines are too long
34
lib/init-action.js
generated
34
lib/init-action.js
generated
@@ -137,12 +137,30 @@ async function run() {
|
||||
logger.info("Detected no issues with the code scanning workflow.");
|
||||
}
|
||||
core.endGroup();
|
||||
config = await (0, init_1.initConfig)((0, actions_util_1.getOptionalInput)("languages"), (0, actions_util_1.getOptionalInput)("queries"), (0, actions_util_1.getOptionalInput)("packs"), (0, actions_util_1.getOptionalInput)("config-file"), (0, actions_util_1.getOptionalInput)("db-location"), (0, actions_util_1.getOptionalInput)("config"), getTrapCachingEnabled(),
|
||||
// Debug mode is enabled if:
|
||||
// - The `init` Action is passed `debug: true`.
|
||||
// - Actions step debugging is enabled (e.g. by [enabling debug logging for a rerun](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs#re-running-all-the-jobs-in-a-workflow),
|
||||
// or by setting the `ACTIONS_STEP_DEBUG` secret to `true`).
|
||||
(0, actions_util_1.getOptionalInput)("debug") === "true" || core.isDebug(), (0, actions_util_1.getOptionalInput)("debug-artifact-name") || util_1.DEFAULT_DEBUG_ARTIFACT_NAME, (0, actions_util_1.getOptionalInput)("debug-database-name") || util_1.DEFAULT_DEBUG_DATABASE_NAME, repositoryNwo, (0, actions_util_1.getTemporaryDirectory)(), codeql, (0, util_1.getRequiredEnvParam)("GITHUB_WORKSPACE"), gitHubVersion, apiDetails, logger);
|
||||
config = await (0, init_1.initConfig)({
|
||||
languagesInput: (0, actions_util_1.getOptionalInput)("languages"),
|
||||
queriesInput: (0, actions_util_1.getOptionalInput)("queries"),
|
||||
packsInput: (0, actions_util_1.getOptionalInput)("packs"),
|
||||
buildModeInput: (0, actions_util_1.getOptionalInput)("build-mode"),
|
||||
configFile: (0, actions_util_1.getOptionalInput)("config-file"),
|
||||
dbLocation: (0, actions_util_1.getOptionalInput)("db-location"),
|
||||
configInput: (0, actions_util_1.getOptionalInput)("config"),
|
||||
trapCachingEnabled: getTrapCachingEnabled(),
|
||||
// Debug mode is enabled if:
|
||||
// - The `init` Action is passed `debug: true`.
|
||||
// - Actions step debugging is enabled (e.g. by [enabling debug logging for a rerun](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs#re-running-all-the-jobs-in-a-workflow),
|
||||
// or by setting the `ACTIONS_STEP_DEBUG` secret to `true`).
|
||||
debugMode: (0, actions_util_1.getOptionalInput)("debug") === "true" || core.isDebug(),
|
||||
debugArtifactName: (0, actions_util_1.getOptionalInput)("debug-artifact-name") || util_1.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: (0, actions_util_1.getOptionalInput)("debug-database-name") || util_1.DEFAULT_DEBUG_DATABASE_NAME,
|
||||
repository: repositoryNwo,
|
||||
tempDir: (0, actions_util_1.getTemporaryDirectory)(),
|
||||
codeql,
|
||||
workspacePath: (0, util_1.getRequiredEnvParam)("GITHUB_WORKSPACE"),
|
||||
githubVersion: gitHubVersion,
|
||||
apiDetails,
|
||||
logger,
|
||||
});
|
||||
await (0, init_1.checkInstallPython311)(config.languages, codeql);
|
||||
if (config.languages.includes(languages_1.Language.python) &&
|
||||
(0, actions_util_1.getRequiredInput)("setup-python-dependencies") === "true") {
|
||||
@@ -167,8 +185,6 @@ async function run() {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// Query CLI for supported features
|
||||
const versionInfo = await codeql.getVersion();
|
||||
// Forward Go flags
|
||||
const goFlags = process.env["GOFLAGS"];
|
||||
if (goFlags) {
|
||||
@@ -185,7 +201,7 @@ async function run() {
|
||||
// replacing the `go` binary with a shell script that invokes the actual `go` binary. Since the shell is
|
||||
// typically dynamically linked, this provides a suitable entry point for the CodeQL tracer.
|
||||
if (fileOutput.includes("statically linked") &&
|
||||
!(0, tools_features_1.isSupportedToolsFeature)(versionInfo, tools_features_1.ToolsFeature.IndirectTracingSupportsStaticBinaries)) {
|
||||
!(await codeql.supportsFeature(tools_features_1.ToolsFeature.IndirectTracingSupportsStaticBinaries))) {
|
||||
try {
|
||||
logger.debug(`Applying static binary workaround for Go`);
|
||||
// Create a directory that we can add to the system PATH.
|
||||
|
||||
File diff suppressed because one or more lines are too long
7
lib/init.js
generated
7
lib/init.js
generated
@@ -41,9 +41,10 @@ async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVe
|
||||
return { codeql, toolsDownloadDurationMs, toolsSource, toolsVersion };
|
||||
}
|
||||
exports.initCodeQL = initCodeQL;
|
||||
async function initConfig(languagesInput, queriesInput, packsInput, configFile, dbLocation, configInput, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, logger) {
|
||||
async function initConfig(inputs) {
|
||||
const logger = inputs.logger;
|
||||
logger.startGroup("Load language configuration");
|
||||
const config = await configUtils.initConfig(languagesInput, queriesInput, packsInput, configFile, dbLocation, configInput, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, logger);
|
||||
const config = await configUtils.initConfig(inputs);
|
||||
printPathFiltersWarning(config, logger);
|
||||
logger.endGroup();
|
||||
return config;
|
||||
@@ -63,7 +64,7 @@ async function runInit(codeql, config, sourceRoot, processName, registriesInput,
|
||||
catch (e) {
|
||||
throw processError(e);
|
||||
}
|
||||
return await (0, tracer_config_1.getCombinedTracerConfig)(await codeql.getVersion(), config);
|
||||
return await (0, tracer_config_1.getCombinedTracerConfig)(codeql, config);
|
||||
}
|
||||
exports.runInit = runInit;
|
||||
function printPathFiltersWarning(config, logger) {
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA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IAAI,CAAC,aAAa,EAAE,MAAM,CAAC;gBAChC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;aAC/B,CAAC,CAAC,IAAI,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,CAAC,QAAQ,EAAE,CAAC;QAClB,MAAM,CAAC,OAAO,CACZ,gFAAgF,CAAC,IAAI;YACnF,qGAAqG;YACrG,oGAAoG;YACpG,iDAAiD,CACpD,CAAC;QACF,OAAO;IACT,CAAC;IACD,MAAM,CAAC,QAAQ,EAAE,CAAC;AACpB,CAAC;AAzCD,8CAyCC"}
|
||||
6
lib/status-report.js
generated
6
lib/status-report.js
generated
@@ -103,9 +103,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, diskI
|
||||
job_name: jobName,
|
||||
job_run_uuid: jobRunUUID,
|
||||
ref,
|
||||
runner_available_disk_space_bytes: diskInfo.numAvailableBytes,
|
||||
runner_os: runnerOs,
|
||||
runner_total_disk_space_bytes: diskInfo.numTotalBytes,
|
||||
started_at: workflowStartedAt,
|
||||
status,
|
||||
testing_environment: testingEnvironment,
|
||||
@@ -113,6 +111,10 @@ async function createStatusReportBase(actionName, status, actionStartedAt, diskI
|
||||
workflow_run_attempt: workflowRunAttempt,
|
||||
workflow_run_id: workflowRunID,
|
||||
};
|
||||
if (diskInfo) {
|
||||
statusReport.runner_available_disk_space_bytes = diskInfo.numAvailableBytes;
|
||||
statusReport.runner_total_disk_space_bytes = diskInfo.numTotalBytes;
|
||||
}
|
||||
// Add optional parameters
|
||||
if (cause) {
|
||||
statusReport.cause = cause;
|
||||
|
||||
File diff suppressed because one or more lines are too long
33
lib/testing-utils.js
generated
33
lib/testing-utils.js
generated
@@ -26,14 +26,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.mockBundleDownloadApi = exports.createFeatures = exports.mockCodeQLVersion = exports.makeVersionInfo = exports.mockLanguagesInRepo = exports.mockFeatureFlagApiEndpoint = exports.getRecordingLogger = exports.setupActionsVars = exports.setupTests = exports.SAMPLE_DEFAULT_CLI_VERSION = exports.SAMPLE_DOTCOM_API_DETAILS = void 0;
|
||||
exports.createTestConfig = exports.mockBundleDownloadApi = exports.createFeatures = exports.mockCodeQLVersion = exports.makeVersionInfo = exports.mockLanguagesInRepo = exports.mockFeatureFlagApiEndpoint = exports.getRecordingLogger = exports.setupActionsVars = exports.setupTests = exports.SAMPLE_DEFAULT_CLI_VERSION = exports.SAMPLE_DOTCOM_API_DETAILS = void 0;
|
||||
const node_util_1 = require("node:util");
|
||||
const path_1 = __importDefault(require("path"));
|
||||
const github = __importStar(require("@actions/github"));
|
||||
const nock_1 = __importDefault(require("nock"));
|
||||
const sinon = __importStar(require("sinon"));
|
||||
const apiClient = __importStar(require("./api-client"));
|
||||
const CodeQL = __importStar(require("./codeql"));
|
||||
const codeql = __importStar(require("./codeql"));
|
||||
const util_1 = require("./util");
|
||||
exports.SAMPLE_DOTCOM_API_DETAILS = {
|
||||
auth: "token",
|
||||
@@ -74,7 +74,7 @@ function setupTests(test) {
|
||||
typedTest.beforeEach((t) => {
|
||||
// Set an empty CodeQL object so that all method calls will fail
|
||||
// unless the test explicitly sets one up.
|
||||
CodeQL.setCodeQL({});
|
||||
codeql.setCodeQL({});
|
||||
// Replace stdout and stderr so we can record output during tests
|
||||
t.context.testOutput = "";
|
||||
const processStdoutWrite = process.stdout.write.bind(process.stdout);
|
||||
@@ -196,11 +196,11 @@ const makeVersionInfo = (version, features) => ({
|
||||
});
|
||||
exports.makeVersionInfo = makeVersionInfo;
|
||||
function mockCodeQLVersion(version, features) {
|
||||
return {
|
||||
return codeql.setCodeQL({
|
||||
async getVersion() {
|
||||
return (0, exports.makeVersionInfo)(version, features);
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
exports.mockCodeQLVersion = mockCodeQLVersion;
|
||||
/**
|
||||
@@ -241,4 +241,27 @@ function mockBundleDownloadApi({ apiDetails = exports.SAMPLE_DOTCOM_API_DETAILS,
|
||||
return `${baseUrl}${relativeUrl}`;
|
||||
}
|
||||
exports.mockBundleDownloadApi = mockBundleDownloadApi;
|
||||
function createTestConfig(overrides) {
|
||||
return Object.assign({}, {
|
||||
languages: [],
|
||||
buildMode: undefined,
|
||||
originalUserInput: {},
|
||||
tempDir: "",
|
||||
codeQLCmd: "",
|
||||
gitHubVersion: {
|
||||
type: util_1.GitHubVariant.DOTCOM,
|
||||
},
|
||||
dbLocation: "",
|
||||
debugMode: false,
|
||||
debugArtifactName: util_1.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: util_1.DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: {
|
||||
packsInputCombines: false,
|
||||
queriesInputCombines: false,
|
||||
},
|
||||
trapCaches: {},
|
||||
trapCacheDownloadTime: 0,
|
||||
}, overrides);
|
||||
}
|
||||
exports.createTestConfig = createTestConfig;
|
||||
//# sourceMappingURL=testing-utils.js.map
|
||||
File diff suppressed because one or more lines are too long
1
lib/tools-features.js
generated
1
lib/tools-features.js
generated
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isSupportedToolsFeature = exports.ToolsFeature = void 0;
|
||||
var ToolsFeature;
|
||||
(function (ToolsFeature) {
|
||||
ToolsFeature["BuildModeOption"] = "buildModeOption";
|
||||
ToolsFeature["IndirectTracingSupportsStaticBinaries"] = "indirectTracingSupportsStaticBinaries";
|
||||
ToolsFeature["SetsCodeqlRunnerEnvVar"] = "setsCodeqlRunnerEnvVar";
|
||||
})(ToolsFeature || (exports.ToolsFeature = ToolsFeature = {}));
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"tools-features.js","sourceRoot":"","sources":["../src/tools-features.ts"],"names":[],"mappings":";;;AAEA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,+FAA+E,CAAA;IAC/E,iEAAiD,CAAA;AACnD,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACrC,WAAwB,EACxB,OAAqB;IAErB,OAAO,CAAC,CAAC,WAAW,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACjE,CAAC;AALD,0DAKC"}
|
||||
{"version":3,"file":"tools-features.js","sourceRoot":"","sources":["../src/tools-features.ts"],"names":[],"mappings":";;;AAEA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,mDAAmC,CAAA;IACnC,+FAA+E,CAAA;IAC/E,iEAAiD,CAAA;AACnD,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACrC,WAAwB,EACxB,OAAqB;IAErB,OAAO,CAAC,CAAC,WAAW,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACjE,CAAC;AALD,0DAKC"}
|
||||
4
lib/tracer-config.js
generated
4
lib/tracer-config.js
generated
@@ -59,7 +59,7 @@ async function getTracerConfigForCluster(config) {
|
||||
};
|
||||
}
|
||||
exports.getTracerConfigForCluster = getTracerConfigForCluster;
|
||||
async function getCombinedTracerConfig(versionInfo, config) {
|
||||
async function getCombinedTracerConfig(codeql, config) {
|
||||
// Abort if there are no traced languages as there's nothing to do
|
||||
const tracedLanguages = config.languages.filter((l) => (0, languages_1.isTracedLanguage)(l));
|
||||
if (tracedLanguages.length === 0) {
|
||||
@@ -68,7 +68,7 @@ async function getCombinedTracerConfig(versionInfo, config) {
|
||||
const mainTracerConfig = await getTracerConfigForCluster(config);
|
||||
// If the CLI doesn't yet support setting the CODEQL_RUNNER environment variable to
|
||||
// the runner executable path, we set it here in the Action.
|
||||
if (!(0, tools_features_1.isSupportedToolsFeature)(versionInfo, tools_features_1.ToolsFeature.SetsCodeqlRunnerEnvVar)) {
|
||||
if (!(await codeql.supportsFeature(tools_features_1.ToolsFeature.SetsCodeqlRunnerEnvVar))) {
|
||||
// On MacOS when System Integrity Protection is enabled, it's necessary to prefix
|
||||
// the build command with the runner executable for indirect tracing, so we expose
|
||||
// it here via the CODEQL_RUNNER environment variable.
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"tracer-config.js","sourceRoot":"","sources":["../src/tracer-config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAI7B,2CAA+C;AAC/C,qDAAyE;AAMlE,KAAK,UAAU,oBAAoB,CACxC,MAA0B;IAE1B,kEAAkE;IAClE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,4BAAgB,EAAC,CAAC,CAAC,CAAC;QAAE,OAAO;IAE/D,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CACnC,MAAM,CAAC,UAAU,EACjB,0CAA0C,CAC3C,CAAC;IACF,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CACb,kDAAkD,gBAAgB,EAAE,CACrE,CAAC;IACJ,CAAC;IACD,IAAI,CAAC;QACH,MAAM,sBAAsB,GAA+B,IAAI,CAAC,KAAK,CACnE,EAAE,CAAC,YAAY,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAC1C,CAAC;QACF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,EAAE,CAAC;YAClE,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBACnB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YAC3B,CAAC;iBAAM,CAAC;gBACN,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAA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AC;IACJ,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AA/BD,0DA+BC"}
|
||||
26
lib/tracer-config.test.js
generated
26
lib/tracer-config.test.js
generated
@@ -29,34 +29,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs = __importStar(require("fs"));
|
||||
const path = __importStar(require("path"));
|
||||
const ava_1 = __importDefault(require("ava"));
|
||||
const configUtils = __importStar(require("./config-utils"));
|
||||
const languages_1 = require("./languages");
|
||||
const testing_utils_1 = require("./testing-utils");
|
||||
const tracer_config_1 = require("./tracer-config");
|
||||
const util = __importStar(require("./util"));
|
||||
(0, testing_utils_1.setupTests)(ava_1.default);
|
||||
function getTestConfig(tmpDir) {
|
||||
return {
|
||||
function getTestConfig(tempDir) {
|
||||
return (0, testing_utils_1.createTestConfig)({
|
||||
languages: [languages_1.Language.java],
|
||||
originalUserInput: {},
|
||||
tempDir: tmpDir,
|
||||
codeQLCmd: "",
|
||||
gitHubVersion: { type: util.GitHubVariant.DOTCOM },
|
||||
dbLocation: path.resolve(tmpDir, "codeql_databases"),
|
||||
debugMode: false,
|
||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: configUtils.defaultAugmentationProperties,
|
||||
trapCaches: {},
|
||||
trapCacheDownloadTime: 0,
|
||||
};
|
||||
tempDir,
|
||||
dbLocation: path.resolve(tempDir, "codeql_databases"),
|
||||
});
|
||||
}
|
||||
(0, ava_1.default)("getCombinedTracerConfig - return undefined when no languages are traced languages", async (t) => {
|
||||
await util.withTmpDir(async (tmpDir) => {
|
||||
const config = getTestConfig(tmpDir);
|
||||
// No traced languages
|
||||
config.languages = [languages_1.Language.javascript, languages_1.Language.python];
|
||||
t.deepEqual(await (0, tracer_config_1.getCombinedTracerConfig)((0, testing_utils_1.makeVersionInfo)("1.0.0"), config), undefined);
|
||||
t.deepEqual(await (0, tracer_config_1.getCombinedTracerConfig)((0, testing_utils_1.mockCodeQLVersion)("1.0.0"), config), undefined);
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("getCombinedTracerConfig - with start-tracing.json environment file", async (t) => {
|
||||
@@ -77,7 +67,7 @@ function getTestConfig(tmpDir) {
|
||||
fs.mkdirSync(tracingEnvironmentDir, { recursive: true });
|
||||
const startTracingJson = path.join(tracingEnvironmentDir, "start-tracing.json");
|
||||
fs.writeFileSync(startTracingJson, JSON.stringify(startTracingEnv));
|
||||
const result = await (0, tracer_config_1.getCombinedTracerConfig)((0, testing_utils_1.makeVersionInfo)("1.0.0"), config);
|
||||
const result = await (0, tracer_config_1.getCombinedTracerConfig)((0, testing_utils_1.mockCodeQLVersion)("1.0.0"), config);
|
||||
t.notDeepEqual(result, undefined);
|
||||
const expectedEnv = startTracingEnv;
|
||||
if (process.platform === "win32") {
|
||||
@@ -112,7 +102,7 @@ function getTestConfig(tmpDir) {
|
||||
fs.mkdirSync(tracingEnvironmentDir, { recursive: true });
|
||||
const startTracingJson = path.join(tracingEnvironmentDir, "start-tracing.json");
|
||||
fs.writeFileSync(startTracingJson, JSON.stringify(startTracingEnv));
|
||||
const result = await (0, tracer_config_1.getCombinedTracerConfig)((0, testing_utils_1.makeVersionInfo)("1.0.0", { setsCodeqlRunnerEnvVar: true }), config);
|
||||
const result = await (0, tracer_config_1.getCombinedTracerConfig)((0, testing_utils_1.mockCodeQLVersion)("1.0.0", { setsCodeqlRunnerEnvVar: true }), config);
|
||||
t.notDeepEqual(result, undefined);
|
||||
t.false(Object.prototype.hasOwnProperty.call(result?.env, "CODEQL_RUNNER"));
|
||||
});
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"tracer-config.test.js","sourceRoot":"","sources":["../src/tracer-config.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,8CAAuB;AAEvB,4DAA8C;AAC9C,2CAAuC;AACv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B,MAAM,EACN,oBAAoB,CACrB,CAAC;QACF,EAAE,CAAC,SAAS,CAAC,qBAAqB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACzD,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAChC,qBAAqB,EACrB,oBAAoB,CACrB,CAAC;QACF,EAAE,CAAC,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC;QAEpE,MAAM,MAAM,GAAG,MAAM,IAAA,uCAAuB,EAC1C,IAAA,iCAAiB,EAAC,OAAO,EAAE,EAAE,sBAAsB,EAAE,IAAI,EAAE,CAAC,EAC5D,MAAM,CACP,CAAC;QACF,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAElC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
||||
44
lib/trap-caching.test.js
generated
44
lib/trap-caching.test.js
generated
@@ -78,48 +78,22 @@ const stubCodeql = (0, codeql_1.setCodeQL)({
|
||||
};
|
||||
},
|
||||
});
|
||||
const testConfigWithoutTmpDir = {
|
||||
const testConfigWithoutTmpDir = (0, testing_utils_1.createTestConfig)({
|
||||
languages: [languages_1.Language.javascript, languages_1.Language.cpp],
|
||||
originalUserInput: {},
|
||||
tempDir: "",
|
||||
codeQLCmd: "",
|
||||
gitHubVersion: {
|
||||
type: util.GitHubVariant.DOTCOM,
|
||||
},
|
||||
dbLocation: "",
|
||||
debugMode: false,
|
||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: {
|
||||
packsInputCombines: false,
|
||||
queriesInputCombines: false,
|
||||
},
|
||||
trapCaches: {
|
||||
javascript: "/some/cache/dir",
|
||||
},
|
||||
trapCacheDownloadTime: 0,
|
||||
};
|
||||
function getTestConfigWithTempDir(tmpDir) {
|
||||
return {
|
||||
});
|
||||
function getTestConfigWithTempDir(tempDir) {
|
||||
return (0, testing_utils_1.createTestConfig)({
|
||||
languages: [languages_1.Language.javascript, languages_1.Language.ruby],
|
||||
originalUserInput: {},
|
||||
tempDir: tmpDir,
|
||||
codeQLCmd: "",
|
||||
gitHubVersion: { type: util.GitHubVariant.DOTCOM },
|
||||
dbLocation: path.resolve(tmpDir, "codeql_databases"),
|
||||
debugMode: false,
|
||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: {
|
||||
packsInputCombines: false,
|
||||
queriesInputCombines: false,
|
||||
},
|
||||
tempDir,
|
||||
dbLocation: path.resolve(tempDir, "codeql_databases"),
|
||||
trapCaches: {
|
||||
javascript: path.resolve(tmpDir, "jsCache"),
|
||||
ruby: path.resolve(tmpDir, "rubyCache"),
|
||||
javascript: path.resolve(tempDir, "jsCache"),
|
||||
ruby: path.resolve(tempDir, "rubyCache"),
|
||||
},
|
||||
trapCacheDownloadTime: 0,
|
||||
};
|
||||
});
|
||||
}
|
||||
(0, ava_1.default)("check flags for JS, analyzing default branch", async (t) => {
|
||||
await util.withTmpDir(async (tmpDir) => {
|
||||
|
||||
File diff suppressed because one or more lines are too long
38
lib/util.js
generated
38
lib/util.js
generated
@@ -789,23 +789,31 @@ function prettyPrintPack(pack) {
|
||||
}
|
||||
exports.prettyPrintPack = prettyPrintPack;
|
||||
async function checkDiskUsage(logger) {
|
||||
const diskUsage = await (0, check_disk_space_1.default)(getRequiredEnvParam("GITHUB_WORKSPACE"));
|
||||
const gbInBytes = 1024 * 1024 * 1024;
|
||||
if (logger && diskUsage.free < 2 * gbInBytes) {
|
||||
const message = "The Actions runner is running low on disk space " +
|
||||
`(${(diskUsage.free / gbInBytes).toPrecision(4)} GB available).`;
|
||||
if (process.env[environment_1.EnvVar.HAS_WARNED_ABOUT_DISK_SPACE] !== "true") {
|
||||
logger.warning(message);
|
||||
try {
|
||||
const diskUsage = await (0, check_disk_space_1.default)(getRequiredEnvParam("GITHUB_WORKSPACE"));
|
||||
const gbInBytes = 1024 * 1024 * 1024;
|
||||
if (logger && diskUsage.free < 2 * gbInBytes) {
|
||||
const message = "The Actions runner is running low on disk space " +
|
||||
`(${(diskUsage.free / gbInBytes).toPrecision(4)} GB available).`;
|
||||
if (process.env[environment_1.EnvVar.HAS_WARNED_ABOUT_DISK_SPACE] !== "true") {
|
||||
logger.warning(message);
|
||||
}
|
||||
else {
|
||||
logger.debug(message);
|
||||
}
|
||||
core.exportVariable(environment_1.EnvVar.HAS_WARNED_ABOUT_DISK_SPACE, "true");
|
||||
}
|
||||
else {
|
||||
logger.debug(message);
|
||||
}
|
||||
core.exportVariable(environment_1.EnvVar.HAS_WARNED_ABOUT_DISK_SPACE, "true");
|
||||
return {
|
||||
numAvailableBytes: diskUsage.free,
|
||||
numTotalBytes: diskUsage.size,
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
if (logger) {
|
||||
logger.warning(`Failed to check available disk space: ${getErrorMessage(error)}`);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
numAvailableBytes: diskUsage.free,
|
||||
numTotalBytes: diskUsage.size,
|
||||
};
|
||||
}
|
||||
exports.checkDiskUsage = checkDiskUsage;
|
||||
/**
|
||||
|
||||
File diff suppressed because one or more lines are too long
110
node_modules/.package-lock.json
generated
vendored
110
node_modules/.package-lock.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codeql",
|
||||
"version": "3.23.2",
|
||||
"version": "3.24.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
@@ -25,9 +25,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/cache": {
|
||||
"version": "3.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.2.3.tgz",
|
||||
"integrity": "sha512-m8KvmcD+JxSLOfNUXuBF2jL0Lp+co/Fhbf0NTt0M9lz61WnXRdqpIGrOvTRZmKIl+7HaHil6kGE3fkEfrKQCQA==",
|
||||
"version": "3.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.2.4.tgz",
|
||||
"integrity": "sha512-RuHnwfcDagtX+37s0ZWy7clbOfnZ7AlDJQ7k/9rzt2W4Gnwde3fa/qjSjVuz4vLcLIpc7fUob27CMrqiWZytYA==",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.0.1",
|
||||
@@ -955,21 +955,21 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@types/uuid": {
|
||||
"version": "9.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.7.tgz",
|
||||
"integrity": "sha512-WUtIVRUZ9i5dYXefDEAI7sh9/O7jGvHg7Df/5O/gtH3Yabe5odI3UWopVR1qbPXQtvOxWu3mM4XxlYeZtMWF4g=="
|
||||
"version": "9.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz",
|
||||
"integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA=="
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.19.1.tgz",
|
||||
"integrity": "sha512-roQScUGFruWod9CEyoV5KlCYrubC/fvG8/1zXuT0WTcxX87GnMMmnksMwSg99lo1xiKrBzw2icsJPMAw1OtKxg==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.20.0.tgz",
|
||||
"integrity": "sha512-fTwGQUnjhoYHeSF6m5pWNkzmDDdsKELYrOBxhjMrofPqCkoC2k3B2wvGHFxa1CTIqkEn88nlW1HVMztjo2K8Hg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.5.1",
|
||||
"@typescript-eslint/scope-manager": "6.19.1",
|
||||
"@typescript-eslint/type-utils": "6.19.1",
|
||||
"@typescript-eslint/utils": "6.19.1",
|
||||
"@typescript-eslint/visitor-keys": "6.19.1",
|
||||
"@typescript-eslint/scope-manager": "6.20.0",
|
||||
"@typescript-eslint/type-utils": "6.20.0",
|
||||
"@typescript-eslint/utils": "6.20.0",
|
||||
"@typescript-eslint/visitor-keys": "6.20.0",
|
||||
"debug": "^4.3.4",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.2.4",
|
||||
@@ -995,15 +995,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.19.1.tgz",
|
||||
"integrity": "sha512-WEfX22ziAh6pRE9jnbkkLGp/4RhTpffr2ZK5bJ18M8mIfA8A+k97U9ZyaXCEJRlmMHh7R9MJZWXp/r73DzINVQ==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.20.0.tgz",
|
||||
"integrity": "sha512-bYerPDF/H5v6V76MdMYhjwmwgMA+jlPVqjSDq2cRqMi8bP5sR3Z+RLOiOMad3nsnmDVmn2gAFCyNgh/dIrfP/w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "6.19.1",
|
||||
"@typescript-eslint/types": "6.19.1",
|
||||
"@typescript-eslint/typescript-estree": "6.19.1",
|
||||
"@typescript-eslint/visitor-keys": "6.19.1",
|
||||
"@typescript-eslint/scope-manager": "6.20.0",
|
||||
"@typescript-eslint/types": "6.20.0",
|
||||
"@typescript-eslint/typescript-estree": "6.20.0",
|
||||
"@typescript-eslint/visitor-keys": "6.20.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1023,13 +1023,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.19.1.tgz",
|
||||
"integrity": "sha512-4CdXYjKf6/6aKNMSly/BP4iCSOpvMmqtDzRtqFyyAae3z5kkqEjKndR5vDHL8rSuMIIWP8u4Mw4VxLyxZW6D5w==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.20.0.tgz",
|
||||
"integrity": "sha512-p4rvHQRDTI1tGGMDFQm+GtxP1ZHyAh64WANVoyEcNMpaTFn3ox/3CcgtIlELnRfKzSs/DwYlDccJEtr3O6qBvA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.19.1",
|
||||
"@typescript-eslint/visitor-keys": "6.19.1"
|
||||
"@typescript-eslint/types": "6.20.0",
|
||||
"@typescript-eslint/visitor-keys": "6.20.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
@@ -1040,13 +1040,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.19.1.tgz",
|
||||
"integrity": "sha512-0vdyld3ecfxJuddDjACUvlAeYNrHP/pDeQk2pWBR2ESeEzQhg52DF53AbI9QCBkYE23lgkhLCZNkHn2hEXXYIg==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.20.0.tgz",
|
||||
"integrity": "sha512-qnSobiJQb1F5JjN0YDRPHruQTrX7ICsmltXhkV536mp4idGAYrIyr47zF/JmkJtEcAVnIz4gUYJ7gOZa6SmN4g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/typescript-estree": "6.19.1",
|
||||
"@typescript-eslint/utils": "6.19.1",
|
||||
"@typescript-eslint/typescript-estree": "6.20.0",
|
||||
"@typescript-eslint/utils": "6.20.0",
|
||||
"debug": "^4.3.4",
|
||||
"ts-api-utils": "^1.0.1"
|
||||
},
|
||||
@@ -1067,9 +1067,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.1.tgz",
|
||||
"integrity": "sha512-6+bk6FEtBhvfYvpHsDgAL3uo4BfvnTnoge5LrrCj2eJN8g3IJdLTD4B/jK3Q6vo4Ql/Hoip9I8aB6fF+6RfDqg==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.20.0.tgz",
|
||||
"integrity": "sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
@@ -1080,13 +1080,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.1.tgz",
|
||||
"integrity": "sha512-aFdAxuhzBFRWhy+H20nYu19+Km+gFfwNO4TEqyszkMcgBDYQjmPJ61erHxuT2ESJXhlhrO7I5EFIlZ+qGR8oVA==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.20.0.tgz",
|
||||
"integrity": "sha512-RnRya9q5m6YYSpBN7IzKu9FmLcYtErkDkc8/dKv81I9QiLLtVBHrjz+Ev/crAqgMNW2FCsoZF4g2QUylMnJz+g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.19.1",
|
||||
"@typescript-eslint/visitor-keys": "6.19.1",
|
||||
"@typescript-eslint/types": "6.20.0",
|
||||
"@typescript-eslint/visitor-keys": "6.20.0",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
@@ -1132,17 +1132,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.19.1.tgz",
|
||||
"integrity": "sha512-JvjfEZuP5WoMqwh9SPAPDSHSg9FBHHGhjPugSRxu5jMfjvBpq5/sGTD+9M9aQ5sh6iJ8AY/Kk/oUYVEMAPwi7w==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.20.0.tgz",
|
||||
"integrity": "sha512-/EKuw+kRu2vAqCoDwDCBtDRU6CTKbUmwwI7SH7AashZ+W+7o8eiyy6V2cdOqN49KsTcASWsC5QeghYuRDTyOOg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.4.0",
|
||||
"@types/json-schema": "^7.0.12",
|
||||
"@types/semver": "^7.5.0",
|
||||
"@typescript-eslint/scope-manager": "6.19.1",
|
||||
"@typescript-eslint/types": "6.19.1",
|
||||
"@typescript-eslint/typescript-estree": "6.19.1",
|
||||
"@typescript-eslint/scope-manager": "6.20.0",
|
||||
"@typescript-eslint/types": "6.20.0",
|
||||
"@typescript-eslint/typescript-estree": "6.20.0",
|
||||
"semver": "^7.5.4"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1157,12 +1157,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.1.tgz",
|
||||
"integrity": "sha512-gkdtIO+xSO/SmI0W68DBg4u1KElmIUo3vXzgHyGPs6cxgB0sa3TlptRAAE0hUY1hM6FcDKEv7aIwiTGm76cXfQ==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz",
|
||||
"integrity": "sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.19.1",
|
||||
"@typescript-eslint/types": "6.20.0",
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
},
|
||||
"engines": {
|
||||
@@ -4564,9 +4564,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/nock": {
|
||||
"version": "13.5.0",
|
||||
"resolved": "https://registry.npmjs.org/nock/-/nock-13.5.0.tgz",
|
||||
"integrity": "sha512-9hc1eCS2HtOz+sE9W7JQw/tXJktg0zoPSu48s/pYe73e25JW9ywiowbqnUSd7iZPeVawLcVpPZeZS312fwSY+g==",
|
||||
"version": "13.5.1",
|
||||
"resolved": "https://registry.npmjs.org/nock/-/nock-13.5.1.tgz",
|
||||
"integrity": "sha512-+s7b73fzj5KnxbKH4Oaqz07tQ8degcMilU4rrmnKvI//b0JMBU4wEXFQ8zqr+3+L4eWSfU3H/UoIVGUV0tue1Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"debug": "^4.1.0",
|
||||
@@ -5439,9 +5439,9 @@
|
||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.5.4",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
||||
"version": "7.6.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",
|
||||
"integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
|
||||
5
node_modules/@actions/cache/lib/internal/cacheUtils.js
generated
vendored
5
node_modules/@actions/cache/lib/internal/cacheUtils.js
generated
vendored
@@ -189,7 +189,10 @@ function assertDefined(name, value) {
|
||||
exports.assertDefined = assertDefined;
|
||||
function isGhes() {
|
||||
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
|
||||
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
|
||||
const hostname = ghUrl.hostname.trimEnd().toUpperCase();
|
||||
const isGitHubHost = hostname === 'GITHUB.COM';
|
||||
const isGheHost = hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST');
|
||||
return !isGitHubHost && !isGheHost;
|
||||
}
|
||||
exports.isGhes = isGhes;
|
||||
//# sourceMappingURL=cacheUtils.js.map
|
||||
2
node_modules/@actions/cache/lib/internal/cacheUtils.js.map
generated
vendored
2
node_modules/@actions/cache/lib/internal/cacheUtils.js.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"cacheUtils.js","sourceRoot":"","sources":["../../src/internal/cacheUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC,YAAY,IAAI,0BAA0B,CAAC,CAAA;KACxD;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAND,sCAMC;AAED,SAAgB,MAAM;IACpB,MAAM,KAAK,GAAG,IAAI,GAAG,CACnB,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,oBAAoB,CACzD,CAAA;IAED,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,CAAA;IACvD,MAAM,YAAY,GAAG,QAAQ,KAAK,YAAY,CAAA;IAC9C,MAAM,SAAS,GACb,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAA;IAEtE,OAAO,CAAC,YAAY,IAAI,CAAC,SAAS,CAAA;AACpC,CAAC;AAXD,wBAWC"}
|
||||
2
node_modules/@actions/cache/package.json
generated
vendored
2
node_modules/@actions/cache/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@actions/cache",
|
||||
"version": "3.2.3",
|
||||
"version": "3.2.4",
|
||||
"preview": true,
|
||||
"description": "Actions cache lib",
|
||||
"keywords": [
|
||||
|
||||
2
node_modules/@types/uuid/README.md
generated
vendored
2
node_modules/@types/uuid/README.md
generated
vendored
@@ -8,7 +8,7 @@ This package contains type definitions for uuid (https://github.com/uuidjs/uuid)
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/uuid.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 07 Nov 2023 20:08:00 GMT
|
||||
* Last updated: Thu, 25 Jan 2024 23:07:19 GMT
|
||||
* Dependencies: none
|
||||
|
||||
# Credits
|
||||
|
||||
2
node_modules/@types/uuid/index.d.mts
generated
vendored
2
node_modules/@types/uuid/index.d.mts
generated
vendored
@@ -8,3 +8,5 @@ export import version = uuid.version;
|
||||
export import validate = uuid.validate;
|
||||
export import stringify = uuid.stringify;
|
||||
export import parse = uuid.parse;
|
||||
export import V1Options = uuid.V1Options;
|
||||
export import V4Options = uuid.V4Options;
|
||||
|
||||
6
node_modules/@types/uuid/package.json
generated
vendored
6
node_modules/@types/uuid/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@types/uuid",
|
||||
"version": "9.0.7",
|
||||
"version": "9.0.8",
|
||||
"description": "TypeScript definitions for uuid",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/uuid",
|
||||
"license": "MIT",
|
||||
@@ -49,6 +49,6 @@
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "71fc550147b942c5824c8f2b1b9d6788b5342357a90b8f7d76e60260d05180c0",
|
||||
"typeScriptVersion": "4.5"
|
||||
"typesPublisherContentHash": "ee6ba7ad17fbbead7a508faf213a9ad0f49c12929e8c6b0f05fb35129bc72d61",
|
||||
"typeScriptVersion": "4.6"
|
||||
}
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-methods-use-this.js
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-methods-use-this.js
generated
vendored
@@ -32,7 +32,7 @@ exports.default = (0, util_1.createRule)({
|
||||
},
|
||||
ignoreOverrideMethods: {
|
||||
type: 'boolean',
|
||||
description: 'Ingore members marked with the `override` modifier',
|
||||
description: 'Ignore members marked with the `override` modifier',
|
||||
},
|
||||
ignoreClassesThatImplementAnInterface: {
|
||||
oneOf: [
|
||||
|
||||
@@ -49,7 +49,7 @@ exports.default = (0, util_1.createRule)({
|
||||
type: 'boolean',
|
||||
},
|
||||
allowTypedFunctionExpressions: {
|
||||
description: 'Whether to ignore type annotations on the variable of a function expresion.',
|
||||
description: 'Whether to ignore type annotations on the variable of a function expression.',
|
||||
type: 'boolean',
|
||||
},
|
||||
},
|
||||
|
||||
File diff suppressed because one or more lines are too long
4
node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js
generated
vendored
@@ -537,7 +537,9 @@ exports.default = (0, util_1.createRule)({
|
||||
},
|
||||
defaultOptions: [
|
||||
{
|
||||
default: exports.defaultOrder,
|
||||
default: {
|
||||
memberTypes: exports.defaultOrder,
|
||||
},
|
||||
},
|
||||
],
|
||||
create(context, [options]) {
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js.map
generated
vendored
File diff suppressed because one or more lines are too long
27
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-template-literals.js
generated
vendored
27
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-template-literals.js
generated
vendored
@@ -57,6 +57,17 @@ exports.default = (0, util_1.createRule)({
|
||||
}
|
||||
return isString(type);
|
||||
}
|
||||
function isLiteral(expression) {
|
||||
return expression.type === utils_1.AST_NODE_TYPES.Literal;
|
||||
}
|
||||
function isInfinityIdentifier(expression) {
|
||||
return (expression.type === utils_1.AST_NODE_TYPES.Identifier &&
|
||||
expression.name === 'Infinity');
|
||||
}
|
||||
function isNaNIdentifier(expression) {
|
||||
return (expression.type === utils_1.AST_NODE_TYPES.Identifier &&
|
||||
expression.name === 'NaN');
|
||||
}
|
||||
return {
|
||||
TemplateLiteral(node) {
|
||||
if (node.parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression) {
|
||||
@@ -88,9 +99,11 @@ exports.default = (0, util_1.createRule)({
|
||||
});
|
||||
return;
|
||||
}
|
||||
const literalsOrUndefinedExpressions = node.expressions.filter((expression) => expression.type === utils_1.AST_NODE_TYPES.Literal ||
|
||||
(0, util_1.isUndefinedIdentifier)(expression));
|
||||
literalsOrUndefinedExpressions.forEach(expression => {
|
||||
const fixableExpressions = node.expressions.filter((expression) => isLiteral(expression) ||
|
||||
(0, util_1.isUndefinedIdentifier)(expression) ||
|
||||
isInfinityIdentifier(expression) ||
|
||||
isNaNIdentifier(expression));
|
||||
fixableExpressions.forEach(expression => {
|
||||
context.report({
|
||||
node: expression,
|
||||
messageId: 'noUselessTemplateLiteral',
|
||||
@@ -109,11 +122,9 @@ exports.default = (0, util_1.createRule)({
|
||||
nextQuasi.range[0] + 1,
|
||||
]),
|
||||
];
|
||||
// Remove quotes for string literals (i.e. `'a'` will become `a`).
|
||||
const isStringLiteral = isUnderlyingTypeString(expression) &&
|
||||
expression.type === utils_1.AST_NODE_TYPES.Literal;
|
||||
if (isStringLiteral) {
|
||||
const escapedValue = expression.value.replace(/([`$\\])/g, '\\$1');
|
||||
const stringValue = (0, util_1.getStaticStringValue)(expression);
|
||||
if (stringValue != null) {
|
||||
const escapedValue = stringValue.replace(/([`$\\])/g, '\\$1');
|
||||
fixes.push(fixer.replaceText(expression, escapedValue));
|
||||
}
|
||||
return fixes;
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"no-useless-template-literals.js","sourceRoot":"","sources":["../../src/rules/no-useless-template-literals.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,oDAA0D;AAC1D,+CAAiC;AAEjC,kCAMiB;AAIjB,kBAAe,IAAA,iBAAU,EAAgB;IACvC,IAAI,EAAE,8BAA8B;IACpC,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,wCAAwC;YACrD,WAAW,EAAE,QAAQ;YACrB,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,wBAAwB,EACtB,mEAAmE;SACtE;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,QAAQ,GAAG,IAAA,wBAAiB,EAAC,OAAO,CAAC,CAAC;QAE5C,SAAS,sBAAsB,CAC7B,UAA+B;YAE/B,MAAM,IAAI,GAAG,IAAA,m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AEF,KAAK,CAAC,WAAW,CAAC;oCAChB,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;oCACnB,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;iCACvB,CAAC;6BACH,CAAC;4BAEF,kEAAkE;4BAClE,MAAM,eAAe,GACnB,sBAAsB,CAAC,UAAU,CAAC;gCAClC,UAAU,CAAC,IAAI,KAAK,sBAAc,CAAC,OAAO,CAAC;4BAE7C,IAAI,eAAe,EAAE,CAAC;gCACpB,MAAM,YAAY,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,CAC3C,WAAW,EACX,MAAM,CACP,CAAC;gCAEF,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC;4BAC1D,CAAC;4BAED,OAAO,KAAK,CAAC;wBACf,CAAC;qBACF,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
||||
{"version":3,"file":"no-useless-template-literals.js","sourceRoot":"","sources":["../../src/rules/no-useless-template-literals.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,oDAA0D;AAC1D,+CAAiC;AAEjC,kCAOiB;AAIjB,kBAAe,IAAA,iBAAU,EAAgB;IACvC,IAAI,EAAE,8BAA8B;IACpC,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,wCAAwC;YACrD,WAAW,EAAE,QAAQ;YACrB,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,wBAAwB,EACtB,mEAAmE;SACtE;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,QAAQ,GAAG,IAAA,wBAAiB,EAAC,OAAO,CAAC,CAAC;QAE5C,SAAS,sB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AAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAE,UAAU;wBAChB,SAAS,EAAE,0BAA0B;wBACrC,GAAG,CAAC,KAAK;4BACP,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;4BACnD,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;4BACrC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;4BAEzC,uEAAuE;4BACvE,MAAM,KAAK,GAAG;gCACZ,KAAK,CAAC,WAAW,CAAC;oCAChB,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;oCACtB,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;iCACpB,CAAC;gCAEF,KAAK,CAAC,WAAW,CAAC;oCAChB,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;oCACnB,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;iCACvB,CAAC;6BACH,CAAC;4BAEF,MAAM,WAAW,GAAG,IAAA,2BAAoB,EAAC,UAAU,CAAC,CAAC;4BAErD,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;gCACxB,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;gCAE9D,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC;4BAC1D,CAAC;4BAED,OAAO,KAAK,CAAC;wBACf,CAAC;qBACF,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
||||
@@ -350,7 +350,7 @@ function verifyForAlways(context, prevNode, nextNode, paddingLines) {
|
||||
}
|
||||
return true;
|
||||
},
|
||||
}) || nextNode;
|
||||
}) ?? nextNode;
|
||||
const insertText = (0, util_1.isTokenOnSameLine)(prevToken, nextToken)
|
||||
? '\n\n'
|
||||
: '\n';
|
||||
|
||||
@@ -240,7 +240,7 @@ exports.default = (0, util_1.createRule)({
|
||||
'LogicalExpression[operator = "||"]'(node) {
|
||||
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
|
||||
const type = checker.getTypeAtLocation(tsNode.left);
|
||||
if (!(0, util_1.isNullableType)(type)) {
|
||||
if (!(0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Null | ts.TypeFlags.Undefined)) {
|
||||
return;
|
||||
}
|
||||
if (ignoreConditionalTests === true && isConditionalTest(node)) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js
generated
vendored
@@ -211,7 +211,7 @@ class ClassScope {
|
||||
addDeclaredVariable(node) {
|
||||
if (!(tsutils.isModifierFlagSet(node, ts.ModifierFlags.Private) ||
|
||||
node.name.kind === ts.SyntaxKind.PrivateIdentifier) ||
|
||||
tsutils.isModifierFlagSet(node, ts.ModifierFlags.Readonly) ||
|
||||
tsutils.isModifierFlagSet(node, ts.ModifierFlags.Accessor | ts.ModifierFlags.Readonly) ||
|
||||
ts.isComputedPropertyName(node.name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js.map
generated
vendored
File diff suppressed because one or more lines are too long
4
node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js
generated
vendored
@@ -222,7 +222,7 @@ exports.default = (0, util_1.createRule)({
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return typeContainsTypeParameter(type.typeAnnotation ||
|
||||
return typeContainsTypeParameter(type.typeAnnotation ??
|
||||
type.elementType);
|
||||
}
|
||||
}
|
||||
@@ -308,7 +308,7 @@ exports.default = (0, util_1.createRule)({
|
||||
function addOverload(signature, key, containingNode) {
|
||||
key ??= getOverloadKey(signature);
|
||||
if (currentScope &&
|
||||
(containingNode || signature).parent === currentScope.parent) {
|
||||
(containingNode ?? signature).parent === currentScope.parent) {
|
||||
const overloads = currentScope.overloads.get(key);
|
||||
if (overloads !== undefined) {
|
||||
overloads.push(signature);
|
||||
|
||||
333
node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md
generated
vendored
333
node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md
generated
vendored
@@ -25,7 +25,7 @@ type OrderConfig = MemberType[] | SortedOrderConfig | 'never';
|
||||
interface SortedOrderConfig {
|
||||
memberTypes?: MemberType[] | 'never';
|
||||
optionalityOrder?: 'optional-first' | 'required-first';
|
||||
order:
|
||||
order?:
|
||||
| 'alphabetically'
|
||||
| 'alphabetically-case-insensitive'
|
||||
| 'as-written'
|
||||
@@ -80,176 +80,178 @@ The default configuration looks as follows:
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"default": [
|
||||
// Index signature
|
||||
"signature",
|
||||
"call-signature",
|
||||
"default": {
|
||||
"memberTypes": [
|
||||
// Index signature
|
||||
"signature",
|
||||
"call-signature",
|
||||
|
||||
// Fields
|
||||
"public-static-field",
|
||||
"protected-static-field",
|
||||
"private-static-field",
|
||||
"#private-static-field",
|
||||
// Fields
|
||||
"public-static-field",
|
||||
"protected-static-field",
|
||||
"private-static-field",
|
||||
"#private-static-field",
|
||||
|
||||
"public-decorated-field",
|
||||
"protected-decorated-field",
|
||||
"private-decorated-field",
|
||||
"public-decorated-field",
|
||||
"protected-decorated-field",
|
||||
"private-decorated-field",
|
||||
|
||||
"public-instance-field",
|
||||
"protected-instance-field",
|
||||
"private-instance-field",
|
||||
"#private-instance-field",
|
||||
"public-instance-field",
|
||||
"protected-instance-field",
|
||||
"private-instance-field",
|
||||
"#private-instance-field",
|
||||
|
||||
"public-abstract-field",
|
||||
"protected-abstract-field",
|
||||
"public-abstract-field",
|
||||
"protected-abstract-field",
|
||||
|
||||
"public-field",
|
||||
"protected-field",
|
||||
"private-field",
|
||||
"#private-field",
|
||||
"public-field",
|
||||
"protected-field",
|
||||
"private-field",
|
||||
"#private-field",
|
||||
|
||||
"static-field",
|
||||
"instance-field",
|
||||
"abstract-field",
|
||||
"static-field",
|
||||
"instance-field",
|
||||
"abstract-field",
|
||||
|
||||
"decorated-field",
|
||||
"decorated-field",
|
||||
|
||||
"field",
|
||||
"field",
|
||||
|
||||
// Static initialization
|
||||
"static-initialization",
|
||||
// Static initialization
|
||||
"static-initialization",
|
||||
|
||||
// Constructors
|
||||
"public-constructor",
|
||||
"protected-constructor",
|
||||
"private-constructor",
|
||||
// Constructors
|
||||
"public-constructor",
|
||||
"protected-constructor",
|
||||
"private-constructor",
|
||||
|
||||
"constructor",
|
||||
"constructor",
|
||||
|
||||
// Accessors
|
||||
"public-static-accessor",
|
||||
"protected-static-accessor",
|
||||
"private-static-accessor",
|
||||
"#private-static-accessor",
|
||||
// Accessors
|
||||
"public-static-accessor",
|
||||
"protected-static-accessor",
|
||||
"private-static-accessor",
|
||||
"#private-static-accessor",
|
||||
|
||||
"public-decorated-accessor",
|
||||
"protected-decorated-accessor",
|
||||
"private-decorated-accessor",
|
||||
"public-decorated-accessor",
|
||||
"protected-decorated-accessor",
|
||||
"private-decorated-accessor",
|
||||
|
||||
"public-instance-accessor",
|
||||
"protected-instance-accessor",
|
||||
"private-instance-accessor",
|
||||
"#private-instance-accessor",
|
||||
"public-instance-accessor",
|
||||
"protected-instance-accessor",
|
||||
"private-instance-accessor",
|
||||
"#private-instance-accessor",
|
||||
|
||||
"public-abstract-accessor",
|
||||
"protected-abstract-accessor",
|
||||
"public-abstract-accessor",
|
||||
"protected-abstract-accessor",
|
||||
|
||||
"public-accessor",
|
||||
"protected-accessor",
|
||||
"private-accessor",
|
||||
"#private-accessor",
|
||||
"public-accessor",
|
||||
"protected-accessor",
|
||||
"private-accessor",
|
||||
"#private-accessor",
|
||||
|
||||
"static-accessor",
|
||||
"instance-accessor",
|
||||
"abstract-accessor",
|
||||
"static-accessor",
|
||||
"instance-accessor",
|
||||
"abstract-accessor",
|
||||
|
||||
"decorated-accessor",
|
||||
"decorated-accessor",
|
||||
|
||||
"accessor",
|
||||
"accessor",
|
||||
|
||||
// Getters
|
||||
"public-static-get",
|
||||
"protected-static-get",
|
||||
"private-static-get",
|
||||
"#private-static-get",
|
||||
// Getters
|
||||
"public-static-get",
|
||||
"protected-static-get",
|
||||
"private-static-get",
|
||||
"#private-static-get",
|
||||
|
||||
"public-decorated-get",
|
||||
"protected-decorated-get",
|
||||
"private-decorated-get",
|
||||
"public-decorated-get",
|
||||
"protected-decorated-get",
|
||||
"private-decorated-get",
|
||||
|
||||
"public-instance-get",
|
||||
"protected-instance-get",
|
||||
"private-instance-get",
|
||||
"#private-instance-get",
|
||||
"public-instance-get",
|
||||
"protected-instance-get",
|
||||
"private-instance-get",
|
||||
"#private-instance-get",
|
||||
|
||||
"public-abstract-get",
|
||||
"protected-abstract-get",
|
||||
"public-abstract-get",
|
||||
"protected-abstract-get",
|
||||
|
||||
"public-get",
|
||||
"protected-get",
|
||||
"private-get",
|
||||
"#private-get",
|
||||
"public-get",
|
||||
"protected-get",
|
||||
"private-get",
|
||||
"#private-get",
|
||||
|
||||
"static-get",
|
||||
"instance-get",
|
||||
"abstract-get",
|
||||
"static-get",
|
||||
"instance-get",
|
||||
"abstract-get",
|
||||
|
||||
"decorated-get",
|
||||
"decorated-get",
|
||||
|
||||
"get",
|
||||
"get",
|
||||
|
||||
// Setters
|
||||
"public-static-set",
|
||||
"protected-static-set",
|
||||
"private-static-set",
|
||||
"#private-static-set",
|
||||
// Setters
|
||||
"public-static-set",
|
||||
"protected-static-set",
|
||||
"private-static-set",
|
||||
"#private-static-set",
|
||||
|
||||
"public-decorated-set",
|
||||
"protected-decorated-set",
|
||||
"private-decorated-set",
|
||||
"public-decorated-set",
|
||||
"protected-decorated-set",
|
||||
"private-decorated-set",
|
||||
|
||||
"public-instance-set",
|
||||
"protected-instance-set",
|
||||
"private-instance-set",
|
||||
"#private-instance-set",
|
||||
"public-instance-set",
|
||||
"protected-instance-set",
|
||||
"private-instance-set",
|
||||
"#private-instance-set",
|
||||
|
||||
"public-abstract-set",
|
||||
"protected-abstract-set",
|
||||
"public-abstract-set",
|
||||
"protected-abstract-set",
|
||||
|
||||
"public-set",
|
||||
"protected-set",
|
||||
"private-set",
|
||||
"#private-set",
|
||||
"public-set",
|
||||
"protected-set",
|
||||
"private-set",
|
||||
"#private-set",
|
||||
|
||||
"static-set",
|
||||
"instance-set",
|
||||
"abstract-set",
|
||||
"static-set",
|
||||
"instance-set",
|
||||
"abstract-set",
|
||||
|
||||
"decorated-set",
|
||||
"decorated-set",
|
||||
|
||||
"set",
|
||||
"set",
|
||||
|
||||
// Methods
|
||||
"public-static-method",
|
||||
"protected-static-method",
|
||||
"private-static-method",
|
||||
"#private-static-method",
|
||||
// Methods
|
||||
"public-static-method",
|
||||
"protected-static-method",
|
||||
"private-static-method",
|
||||
"#private-static-method",
|
||||
|
||||
"public-decorated-method",
|
||||
"protected-decorated-method",
|
||||
"private-decorated-method",
|
||||
"public-decorated-method",
|
||||
"protected-decorated-method",
|
||||
"private-decorated-method",
|
||||
|
||||
"public-instance-method",
|
||||
"protected-instance-method",
|
||||
"private-instance-method",
|
||||
"#private-instance-method",
|
||||
"public-instance-method",
|
||||
"protected-instance-method",
|
||||
"private-instance-method",
|
||||
"#private-instance-method",
|
||||
|
||||
"public-abstract-method",
|
||||
"protected-abstract-method",
|
||||
"public-abstract-method",
|
||||
"protected-abstract-method",
|
||||
|
||||
"public-method",
|
||||
"protected-method",
|
||||
"private-method",
|
||||
"#private-method",
|
||||
"public-method",
|
||||
"protected-method",
|
||||
"private-method",
|
||||
"#private-method",
|
||||
|
||||
"static-method",
|
||||
"instance-method",
|
||||
"abstract-method",
|
||||
"static-method",
|
||||
"instance-method",
|
||||
"abstract-method",
|
||||
|
||||
"decorated-method",
|
||||
"decorated-method",
|
||||
|
||||
"method"
|
||||
]
|
||||
"method"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -792,7 +794,8 @@ type Foo = {
|
||||
#### Sorting Alphabetically Within Member Groups
|
||||
|
||||
This config specifies that within each `memberTypes` group, members are in an alphabetic case-sensitive order.
|
||||
You can copy and paste the default order from [Default Configuration](#default-configuration).
|
||||
The default member order will be applied if `memberTypes` is not specified.
|
||||
You can see the default order in [Default Configuration](#default-configuration).
|
||||
|
||||
```jsonc
|
||||
// .eslintrc.json
|
||||
@@ -802,9 +805,6 @@ You can copy and paste the default order from [Default Configuration](#default-c
|
||||
"error",
|
||||
{
|
||||
"default": {
|
||||
"memberTypes": [
|
||||
/* <Default Order> */
|
||||
],
|
||||
"order": "alphabetically"
|
||||
}
|
||||
}
|
||||
@@ -817,7 +817,7 @@ You can copy and paste the default order from [Default Configuration](#default-c
|
||||
|
||||
##### ❌ Incorrect
|
||||
|
||||
```ts option='{"default":{"memberTypes":["signature","call-signature","public-static-field","protected-static-field","private-static-field","#private-static-field","public-decorated-field","protected-decorated-field","private-decorated-field","public-instance-field","protected-instance-field","private-instance-field","#private-instance-field","public-abstract-field","protected-abstract-field","public-field","protected-field","private-field","#private-field","static-field","instance-field","abstract-field","decorated-field","field","static-initialization","public-constructor","protected-constructor","private-constructor","constructor","public-static-get","protected-static-get","private-static-get","#private-static-get","public-decorated-get","protected-decorated-get","private-decorated-get","public-instance-get","protected-instance-get","private-instance-get","#private-instance-get","public-abstract-get","protected-abstract-get","public-get","protected-get","private-get","#private-get","static-get","instance-get","abstract-get","decorated-get","get","public-static-set","protected-static-set","private-static-set","#private-static-set","public-decorated-set","protected-decorated-set","private-decorated-set","public-instance-set","protected-instance-set","private-instance-set","#private-instance-set","public-abstract-set","protected-abstract-set","public-set","protected-set","private-set","#private-set","static-set","instance-set","abstract-set","decorated-set","set","public-static-method","protected-static-method","private-static-method","#private-static-method","public-decorated-method","protected-decorated-method","private-decorated-method","public-instance-method","protected-instance-method","private-instance-method","#private-instance-method","public-abstract-method","protected-abstract-method","public-method","protected-method","private-method","#private-method","static-method","instance-method","abstract-method","decorated-method","method"],"order":"alphabetically"}}'
|
||||
```ts option='{"default":{"order":"alphabetically"}}'
|
||||
interface Foo {
|
||||
a: x;
|
||||
B: x;
|
||||
@@ -831,7 +831,7 @@ interface Foo {
|
||||
|
||||
##### ✅ Correct
|
||||
|
||||
```ts option='{"default":{"memberTypes":["signature","call-signature","public-static-field","protected-static-field","private-static-field","#private-static-field","public-decorated-field","protected-decorated-field","private-decorated-field","public-instance-field","protected-instance-field","private-instance-field","#private-instance-field","public-abstract-field","protected-abstract-field","public-field","protected-field","private-field","#private-field","static-field","instance-field","abstract-field","decorated-field","field","static-initialization","public-constructor","protected-constructor","private-constructor","constructor","public-static-get","protected-static-get","private-static-get","#private-static-get","public-decorated-get","protected-decorated-get","private-decorated-get","public-instance-get","protected-instance-get","private-instance-get","#private-instance-get","public-abstract-get","protected-abstract-get","public-get","protected-get","private-get","#private-get","static-get","instance-get","abstract-get","decorated-get","get","public-static-set","protected-static-set","private-static-set","#private-static-set","public-decorated-set","protected-decorated-set","private-decorated-set","public-instance-set","protected-instance-set","private-instance-set","#private-instance-set","public-abstract-set","protected-abstract-set","public-set","protected-set","private-set","#private-set","static-set","instance-set","abstract-set","decorated-set","set","public-static-method","protected-static-method","private-static-method","#private-static-method","public-decorated-method","protected-decorated-method","private-decorated-method","public-instance-method","protected-instance-method","private-instance-method","#private-instance-method","public-abstract-method","protected-abstract-method","public-method","protected-method","private-method","#private-method","static-method","instance-method","abstract-method","decorated-method","method"],"order":"alphabetically"}}'
|
||||
```ts option='{"default":{"order":"alphabetically"}}'
|
||||
interface Foo {
|
||||
B: x;
|
||||
a: x;
|
||||
@@ -843,10 +843,62 @@ interface Foo {
|
||||
}
|
||||
```
|
||||
|
||||
#### Sorting Alphabetically Case Insensitive Within Member Groups
|
||||
#### Sorting Alphabetically Within Custom Member Groups
|
||||
|
||||
This config specifies that within each `memberTypes` group, members are in an alphabetic case-insensitive order.
|
||||
You can copy and paste the default order from [Default Configuration](#default-configuration).
|
||||
This config specifies that within each custom `memberTypes` group, members are in an alphabetic case-sensitive order.
|
||||
|
||||
```jsonc
|
||||
// .eslintrc.json
|
||||
{
|
||||
"rules": {
|
||||
"@typescript-eslint/member-ordering": [
|
||||
"error",
|
||||
{
|
||||
"default": {
|
||||
"memberTypes": ["method", "field"],
|
||||
"order": "alphabetically"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!--tabs-->
|
||||
|
||||
##### ❌ Incorrect
|
||||
|
||||
```ts option='{"default":{"memberTypes":["method","field"],"order":"alphabetically"}}'
|
||||
interface Foo {
|
||||
B(): void;
|
||||
c(): void;
|
||||
a(): void;
|
||||
|
||||
a: x;
|
||||
B: x;
|
||||
c: x;
|
||||
}
|
||||
```
|
||||
|
||||
##### ✅ Correct
|
||||
|
||||
```ts option='{"default":{"memberTypes":["method","field"],"order":"alphabetically"}}'
|
||||
interface Foo {
|
||||
B(): void;
|
||||
a(): void;
|
||||
c(): void;
|
||||
|
||||
B: x;
|
||||
a: x;
|
||||
c: x;
|
||||
}
|
||||
```
|
||||
|
||||
#### Sorting Alphabetically Case Insensitive Within Member Groups
|
||||
|
||||
This config specifies that within each `memberTypes` group, members are in an alphabetic case-insensitive order.
|
||||
The default member order will be applied if `memberTypes` is not specified.
|
||||
You can see the default order in [Default Configuration](#default-configuration).
|
||||
|
||||
```jsonc
|
||||
// .eslintrc.json
|
||||
@@ -856,9 +908,6 @@ You can copy and paste the default order from [Default Configuration](#default-c
|
||||
"error",
|
||||
{
|
||||
"default": {
|
||||
"memberTypes": [
|
||||
/* <Default Order> */
|
||||
],
|
||||
"order": "alphabetically-case-insensitive"
|
||||
}
|
||||
}
|
||||
@@ -871,7 +920,7 @@ You can copy and paste the default order from [Default Configuration](#default-c
|
||||
|
||||
##### ❌ Incorrect
|
||||
|
||||
```ts option='{"default":{"memberTypes":["signature","call-signature","public-static-field","protected-static-field","private-static-field","#private-static-field","public-decorated-field","protected-decorated-field","private-decorated-field","public-instance-field","protected-instance-field","private-instance-field","#private-instance-field","public-abstract-field","protected-abstract-field","public-field","protected-field","private-field","#private-field","static-field","instance-field","abstract-field","decorated-field","field","static-initialization","public-constructor","protected-constructor","private-constructor","constructor","public-static-get","protected-static-get","private-static-get","#private-static-get","public-decorated-get","protected-decorated-get","private-decorated-get","public-instance-get","protected-instance-get","private-instance-get","#private-instance-get","public-abstract-get","protected-abstract-get","public-get","protected-get","private-get","#private-get","static-get","instance-get","abstract-get","decorated-get","get","public-static-set","protected-static-set","private-static-set","#private-static-set","public-decorated-set","protected-decorated-set","private-decorated-set","public-instance-set","protected-instance-set","private-instance-set","#private-instance-set","public-abstract-set","protected-abstract-set","public-set","protected-set","private-set","#private-set","static-set","instance-set","abstract-set","decorated-set","set","public-static-method","protected-static-method","private-static-method","#private-static-method","public-decorated-method","protected-decorated-method","private-decorated-method","public-instance-method","protected-instance-method","private-instance-method","#private-instance-method","public-abstract-method","protected-abstract-method","public-method","protected-method","private-method","#private-method","static-method","instance-method","abstract-method","decorated-method","method"],"order":"alphabetically-case-insensitive"}}'
|
||||
```ts option='{"default":{"order":"alphabetically-case-insensitive"}}'
|
||||
interface Foo {
|
||||
B: x;
|
||||
a: x;
|
||||
@@ -885,7 +934,7 @@ interface Foo {
|
||||
|
||||
##### ✅ Correct
|
||||
|
||||
```ts option='{"default":{"memberTypes":["signature","call-signature","public-static-field","protected-static-field","private-static-field","#private-static-field","public-decorated-field","protected-decorated-field","private-decorated-field","public-instance-field","protected-instance-field","private-instance-field","#private-instance-field","public-abstract-field","protected-abstract-field","public-field","protected-field","private-field","#private-field","static-field","instance-field","abstract-field","decorated-field","field","static-initialization","public-constructor","protected-constructor","private-constructor","constructor","public-static-get","protected-static-get","private-static-get","#private-static-get","public-decorated-get","protected-decorated-get","private-decorated-get","public-instance-get","protected-instance-get","private-instance-get","#private-instance-get","public-abstract-get","protected-abstract-get","public-get","protected-get","private-get","#private-get","static-get","instance-get","abstract-get","decorated-get","get","public-static-set","protected-static-set","private-static-set","#private-static-set","public-decorated-set","protected-decorated-set","private-decorated-set","public-instance-set","protected-instance-set","private-instance-set","#private-instance-set","public-abstract-set","protected-abstract-set","public-set","protected-set","private-set","#private-set","static-set","instance-set","abstract-set","decorated-set","set","public-static-method","protected-static-method","private-static-method","#private-static-method","public-decorated-method","protected-decorated-method","private-decorated-method","public-instance-method","protected-instance-method","private-instance-method","#private-instance-method","public-abstract-method","protected-abstract-method","public-method","protected-method","private-method","#private-method","static-method","instance-method","abstract-method","decorated-method","method"],"order":"alphabetically-case-insensitive"}}'
|
||||
```ts option='{"default":{"order":"alphabetically-case-insensitive"}}'
|
||||
interface Foo {
|
||||
a: x;
|
||||
B: x;
|
||||
|
||||
14
node_modules/@typescript-eslint/eslint-plugin/package.json
generated
vendored
14
node_modules/@typescript-eslint/eslint-plugin/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typescript-eslint/eslint-plugin",
|
||||
"version": "6.19.1",
|
||||
"version": "6.20.0",
|
||||
"description": "TypeScript plugin for ESLint",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -57,10 +57,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.5.1",
|
||||
"@typescript-eslint/scope-manager": "6.19.1",
|
||||
"@typescript-eslint/type-utils": "6.19.1",
|
||||
"@typescript-eslint/utils": "6.19.1",
|
||||
"@typescript-eslint/visitor-keys": "6.19.1",
|
||||
"@typescript-eslint/scope-manager": "6.20.0",
|
||||
"@typescript-eslint/type-utils": "6.20.0",
|
||||
"@typescript-eslint/utils": "6.20.0",
|
||||
"@typescript-eslint/visitor-keys": "6.20.0",
|
||||
"debug": "^4.3.4",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.2.4",
|
||||
@@ -73,8 +73,8 @@
|
||||
"@types/debug": "*",
|
||||
"@types/marked": "*",
|
||||
"@types/natural-compare": "*",
|
||||
"@typescript-eslint/rule-schema-to-typescript-types": "6.19.1",
|
||||
"@typescript-eslint/rule-tester": "6.19.1",
|
||||
"@typescript-eslint/rule-schema-to-typescript-types": "6.20.0",
|
||||
"@typescript-eslint/rule-tester": "6.20.0",
|
||||
"ajv": "^6.12.6",
|
||||
"chalk": "^5.3.0",
|
||||
"cross-fetch": "*",
|
||||
|
||||
10
node_modules/@typescript-eslint/parser/package.json
generated
vendored
10
node_modules/@typescript-eslint/parser/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typescript-eslint/parser",
|
||||
"version": "6.19.1",
|
||||
"version": "6.20.0",
|
||||
"description": "An ESLint custom parser which leverages TypeScript ESTree",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -51,10 +51,10 @@
|
||||
"eslint": "^7.0.0 || ^8.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "6.19.1",
|
||||
"@typescript-eslint/types": "6.19.1",
|
||||
"@typescript-eslint/typescript-estree": "6.19.1",
|
||||
"@typescript-eslint/visitor-keys": "6.19.1",
|
||||
"@typescript-eslint/scope-manager": "6.20.0",
|
||||
"@typescript-eslint/types": "6.20.0",
|
||||
"@typescript-eslint/typescript-estree": "6.20.0",
|
||||
"@typescript-eslint/visitor-keys": "6.20.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
8
node_modules/@typescript-eslint/scope-manager/package.json
generated
vendored
8
node_modules/@typescript-eslint/scope-manager/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typescript-eslint/scope-manager",
|
||||
"version": "6.19.1",
|
||||
"version": "6.20.0",
|
||||
"description": "TypeScript scope analyser for ESLint",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -44,13 +44,13 @@
|
||||
"typecheck": "npx nx typecheck"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.19.1",
|
||||
"@typescript-eslint/visitor-keys": "6.19.1"
|
||||
"@typescript-eslint/types": "6.20.0",
|
||||
"@typescript-eslint/visitor-keys": "6.20.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@prettier/sync": "*",
|
||||
"@types/glob": "*",
|
||||
"@typescript-eslint/typescript-estree": "6.19.1",
|
||||
"@typescript-eslint/typescript-estree": "6.20.0",
|
||||
"glob": "*",
|
||||
"jest-specific-snapshot": "*",
|
||||
"make-dir": "*",
|
||||
|
||||
8
node_modules/@typescript-eslint/type-utils/package.json
generated
vendored
8
node_modules/@typescript-eslint/type-utils/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typescript-eslint/type-utils",
|
||||
"version": "6.19.1",
|
||||
"version": "6.20.0",
|
||||
"description": "Type utilities for working with TypeScript + ESLint together",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -45,13 +45,13 @@
|
||||
"typecheck": "tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/typescript-estree": "6.19.1",
|
||||
"@typescript-eslint/utils": "6.19.1",
|
||||
"@typescript-eslint/typescript-estree": "6.20.0",
|
||||
"@typescript-eslint/utils": "6.20.0",
|
||||
"debug": "^4.3.4",
|
||||
"ts-api-utils": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/parser": "6.19.1",
|
||||
"@typescript-eslint/parser": "6.20.0",
|
||||
"ajv": "^6.10.0",
|
||||
"downlevel-dts": "*",
|
||||
"jest": "29.7.0",
|
||||
|
||||
2
node_modules/@typescript-eslint/types/package.json
generated
vendored
2
node_modules/@typescript-eslint/types/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typescript-eslint/types",
|
||||
"version": "6.19.1",
|
||||
"version": "6.20.0",
|
||||
"description": "Types for the TypeScript-ESTree AST spec",
|
||||
"files": [
|
||||
"dist",
|
||||
|
||||
6
node_modules/@typescript-eslint/typescript-estree/package.json
generated
vendored
6
node_modules/@typescript-eslint/typescript-estree/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typescript-eslint/typescript-estree",
|
||||
"version": "6.19.1",
|
||||
"version": "6.20.0",
|
||||
"description": "A parser that converts TypeScript source code into an ESTree compatible form",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -52,8 +52,8 @@
|
||||
"typecheck": "tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.19.1",
|
||||
"@typescript-eslint/visitor-keys": "6.19.1",
|
||||
"@typescript-eslint/types": "6.20.0",
|
||||
"@typescript-eslint/visitor-keys": "6.20.0",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
|
||||
10
node_modules/@typescript-eslint/utils/package.json
generated
vendored
10
node_modules/@typescript-eslint/utils/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typescript-eslint/utils",
|
||||
"version": "6.19.1",
|
||||
"version": "6.20.0",
|
||||
"description": "Utilities for working with TypeScript + ESLint together",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -68,16 +68,16 @@
|
||||
"@eslint-community/eslint-utils": "^4.4.0",
|
||||
"@types/json-schema": "^7.0.12",
|
||||
"@types/semver": "^7.5.0",
|
||||
"@typescript-eslint/scope-manager": "6.19.1",
|
||||
"@typescript-eslint/types": "6.19.1",
|
||||
"@typescript-eslint/typescript-estree": "6.19.1",
|
||||
"@typescript-eslint/scope-manager": "6.20.0",
|
||||
"@typescript-eslint/types": "6.20.0",
|
||||
"@typescript-eslint/typescript-estree": "6.20.0",
|
||||
"semver": "^7.5.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^7.0.0 || ^8.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/parser": "6.19.1",
|
||||
"@typescript-eslint/parser": "6.20.0",
|
||||
"downlevel-dts": "*",
|
||||
"jest": "29.7.0",
|
||||
"prettier": "^3.0.3",
|
||||
|
||||
4
node_modules/@typescript-eslint/visitor-keys/package.json
generated
vendored
4
node_modules/@typescript-eslint/visitor-keys/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typescript-eslint/visitor-keys",
|
||||
"version": "6.19.1",
|
||||
"version": "6.20.0",
|
||||
"description": "Visitor keys used to help traverse the TypeScript-ESTree AST",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -45,7 +45,7 @@
|
||||
"typecheck": "tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.19.1",
|
||||
"@typescript-eslint/types": "6.20.0",
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
6
node_modules/nock/README.md
generated
vendored
6
node_modules/nock/README.md
generated
vendored
@@ -66,6 +66,7 @@ For instance, if a module performs HTTP requests to a CouchDB server or makes HT
|
||||
- [.pendingMocks()](#pendingmocks)
|
||||
- [.activeMocks()](#activemocks)
|
||||
- [.isActive()](#isactive)
|
||||
- [.clone()](#clone)
|
||||
- [Restoring](#restoring)
|
||||
- [Activating](#activating)
|
||||
- [Turning Nock Off (experimental!)](#turning-nock-off-experimental)
|
||||
@@ -89,6 +90,8 @@ For instance, if a module performs HTTP requests to a CouchDB server or makes HT
|
||||
- [Options](#options-1)
|
||||
- [Example](#example)
|
||||
- [Modes](#modes)
|
||||
- [Verifying recorded fixtures](#verifying-recorded-fixtures)
|
||||
- [Example](#example-1)
|
||||
- [Common issues](#common-issues)
|
||||
- [Axios](#axios)
|
||||
- [Memory issues with Jest](#memory-issues-with-jest)
|
||||
@@ -1693,6 +1696,9 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/all-contri
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Beretta1979"><img src="https://avatars.githubusercontent.com/u/10073962?v=4?s=100" width="100px;" alt="Sébastien Van Bruaene"/><br /><sub><b>Sébastien Van Bruaene</b></sub></a><br /><a href="https://github.com/nock/nock/commits?author=Beretta1979" title="Code">💻</a> <a href="https://github.com/nock/nock/commits?author=Beretta1979" title="Tests">⚠️</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Uzlopak"><img src="https://avatars.githubusercontent.com/u/5059100?v=4?s=100" width="100px;" alt="Aras Abbasi"/><br /><sub><b>Aras Abbasi</b></sub></a><br /><a href="https://github.com/nock/nock/commits?author=Uzlopak" title="Code">💻</a> <a href="https://github.com/nock/nock/commits?author=Uzlopak" title="Tests">⚠️</a> <a href="#maintenance-Uzlopak" title="Maintenance">🚧</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rsaryev"><img src="https://avatars.githubusercontent.com/u/70219513?v=4?s=100" width="100px;" alt="Saryev Rustam"/><br /><sub><b>Saryev Rustam</b></sub></a><br /><a href="https://github.com/nock/nock/commits?author=rsaryev" title="Code">💻</a> <a href="https://github.com/nock/nock/commits?author=rsaryev" title="Tests">⚠️</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
5
node_modules/nock/lib/common.js
generated
vendored
5
node_modules/nock/lib/common.js
generated
vendored
@@ -70,10 +70,7 @@ function overrideRequests(newRequest) {
|
||||
debug('- overriding request for', proto)
|
||||
|
||||
const moduleName = proto // 1 to 1 match of protocol and module is fortunate :)
|
||||
const module = {
|
||||
http: require('http'),
|
||||
https: require('https'),
|
||||
}[moduleName]
|
||||
const module = require(proto)
|
||||
const overriddenRequest = module.request
|
||||
const overriddenGet = module.get
|
||||
|
||||
|
||||
4
node_modules/nock/lib/intercept.js
generated
vendored
4
node_modules/nock/lib/intercept.js
generated
vendored
@@ -370,8 +370,6 @@ function activate() {
|
||||
throw new Error('Nock already active')
|
||||
}
|
||||
|
||||
overrideClientRequest()
|
||||
|
||||
// ----- Overriding http.request and https.request:
|
||||
|
||||
common.overrideRequests(function (proto, overriddenRequest, args) {
|
||||
@@ -435,6 +433,8 @@ function activate() {
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
overrideClientRequest()
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
6
node_modules/nock/package.json
generated
vendored
6
node_modules/nock/package.json
generated
vendored
@@ -7,7 +7,7 @@
|
||||
"testing",
|
||||
"isolation"
|
||||
],
|
||||
"version": "13.5.0",
|
||||
"version": "13.5.1",
|
||||
"author": "Pedro Teixeira <pedro.teixeira@gmail.com>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -41,6 +41,7 @@
|
||||
"eslint-plugin-promise": "^6.0.0",
|
||||
"form-data": "^4.0.0",
|
||||
"got": "^11.3.0",
|
||||
"jest": "^29.7.0",
|
||||
"mocha": "^9.1.3",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"nyc": "^15.0.0",
|
||||
@@ -60,7 +61,8 @@
|
||||
"lint:js:fix": "eslint --cache --cache-location './.cache/eslint' --fix '**/*.js'",
|
||||
"lint:ts": "dtslint --expectOnly types",
|
||||
"test": "nyc --reporter=lcov --reporter=text mocha --recursive tests",
|
||||
"test:coverage": "open coverage/lcov-report/index.html"
|
||||
"test:coverage": "open coverage/lcov-report/index.html",
|
||||
"test:jest": "jest tests_jest --detectLeaks"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
|
||||
6
node_modules/semver/README.md
generated
vendored
6
node_modules/semver/README.md
generated
vendored
@@ -529,6 +529,10 @@ tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
|
||||
`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
|
||||
any other overlapping SemVer tuple.
|
||||
|
||||
If the `options.includePrerelease` flag is set, then the `coerce` result will contain
|
||||
prerelease and build parts of a version. For example, `1.2.3.4-rc.1+rev.2`
|
||||
will preserve prerelease `rc.1` and build `rev.2` in the result.
|
||||
|
||||
### Clean
|
||||
|
||||
* `clean(version)`: Clean a string to be a valid semver if possible
|
||||
@@ -543,7 +547,7 @@ ex.
|
||||
* `s.clean(' = v 2.1.5-foo')`: `null`
|
||||
* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
|
||||
* `s.clean('=v2.1.5')`: `'2.1.5'`
|
||||
* `s.clean(' =v2.1.5')`: `2.1.5`
|
||||
* `s.clean(' =v2.1.5')`: `'2.1.5'`
|
||||
* `s.clean(' 2.1.5 ')`: `'2.1.5'`
|
||||
* `s.clean('~1.0.0')`: `null`
|
||||
|
||||
|
||||
18
node_modules/semver/functions/coerce.js
generated
vendored
18
node_modules/semver/functions/coerce.js
generated
vendored
@@ -19,34 +19,42 @@ const coerce = (version, options) => {
|
||||
|
||||
let match = null
|
||||
if (!options.rtl) {
|
||||
match = version.match(re[t.COERCE])
|
||||
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])
|
||||
} else {
|
||||
// Find the right-most coercible string that does not share
|
||||
// a terminus with a more left-ward coercible string.
|
||||
// Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
|
||||
// With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
|
||||
//
|
||||
// Walk through the string checking with a /g regexp
|
||||
// Manually set the index so as to pick up overlapping matches.
|
||||
// Stop when we get a match that ends at the string end, since no
|
||||
// coercible string can be more right-ward without the same terminus.
|
||||
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]
|
||||
let next
|
||||
while ((next = re[t.COERCERTL].exec(version)) &&
|
||||
while ((next = coerceRtlRegex.exec(version)) &&
|
||||
(!match || match.index + match[0].length !== version.length)
|
||||
) {
|
||||
if (!match ||
|
||||
next.index + next[0].length !== match.index + match[0].length) {
|
||||
match = next
|
||||
}
|
||||
re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
|
||||
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length
|
||||
}
|
||||
// leave it in a clean state
|
||||
re[t.COERCERTL].lastIndex = -1
|
||||
coerceRtlRegex.lastIndex = -1
|
||||
}
|
||||
|
||||
if (match === null) {
|
||||
return null
|
||||
}
|
||||
|
||||
return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
|
||||
const major = match[2]
|
||||
const minor = match[3] || '0'
|
||||
const patch = match[4] || '0'
|
||||
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''
|
||||
const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''
|
||||
|
||||
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)
|
||||
}
|
||||
module.exports = coerce
|
||||
|
||||
9
node_modules/semver/internal/re.js
generated
vendored
9
node_modules/semver/internal/re.js
generated
vendored
@@ -154,12 +154,17 @@ createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)
|
||||
|
||||
// Coercion.
|
||||
// Extract anything that could conceivably be a part of a valid semver
|
||||
createToken('COERCE', `${'(^|[^\\d])' +
|
||||
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
|
||||
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
|
||||
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
|
||||
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
|
||||
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
|
||||
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
|
||||
createToken('COERCEFULL', src[t.COERCEPLAIN] +
|
||||
`(?:${src[t.PRERELEASE]})?` +
|
||||
`(?:${src[t.BUILD]})?` +
|
||||
`(?:$|[^\\d])`)
|
||||
createToken('COERCERTL', src[t.COERCE], true)
|
||||
createToken('COERCERTLFULL', src[t.COERCEFULL], true)
|
||||
|
||||
// Tilde ranges.
|
||||
// Meaning is "reasonably at or greater than"
|
||||
|
||||
17
node_modules/semver/package.json
generated
vendored
17
node_modules/semver/package.json
generated
vendored
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "semver",
|
||||
"version": "7.5.4",
|
||||
"version": "7.6.0",
|
||||
"description": "The semantic version parser used by npm.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "tap",
|
||||
"snap": "tap",
|
||||
"lint": "eslint \"**/*.js\"",
|
||||
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
|
||||
"postlint": "template-oss-check",
|
||||
"lintfix": "npm run lint -- --fix",
|
||||
"posttest": "npm run lint",
|
||||
@@ -14,7 +14,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@npmcli/eslint-config": "^4.0.0",
|
||||
"@npmcli/template-oss": "4.17.0",
|
||||
"@npmcli/template-oss": "4.21.3",
|
||||
"tap": "^16.0.0"
|
||||
},
|
||||
"license": "ISC",
|
||||
@@ -53,17 +53,8 @@
|
||||
"author": "GitHub Inc.",
|
||||
"templateOSS": {
|
||||
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
||||
"version": "4.17.0",
|
||||
"version": "4.21.3",
|
||||
"engines": ">=10",
|
||||
"ciVersions": [
|
||||
"10.0.0",
|
||||
"10.x",
|
||||
"12.x",
|
||||
"14.x",
|
||||
"16.x",
|
||||
"18.x"
|
||||
],
|
||||
"npmSpec": "8",
|
||||
"distPaths": [
|
||||
"classes/",
|
||||
"functions/",
|
||||
|
||||
124
package-lock.json
generated
124
package-lock.json
generated
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"name": "codeql",
|
||||
"version": "3.23.2",
|
||||
"version": "3.24.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "codeql",
|
||||
"version": "3.23.2",
|
||||
"version": "3.24.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/artifact": "^1.1.2",
|
||||
"@actions/cache": "^3.2.3",
|
||||
"@actions/cache": "^3.2.4",
|
||||
"@actions/core": "^1.10.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/github": "^5.1.1",
|
||||
@@ -20,7 +20,7 @@
|
||||
"@octokit/plugin-retry": "^5.0.2",
|
||||
"@octokit/types": "^12.4.0",
|
||||
"@schemastore/package": "0.0.10",
|
||||
"@types/uuid": "^9.0.7",
|
||||
"@types/uuid": "^9.0.8",
|
||||
"adm-zip": "^0.5.10",
|
||||
"check-disk-space": "^3.4.0",
|
||||
"console-log-level": "^1.4.1",
|
||||
@@ -33,7 +33,7 @@
|
||||
"jsonschema": "1.4.1",
|
||||
"long": "^5.2.3",
|
||||
"path": "^0.12.7",
|
||||
"semver": "^7.5.4",
|
||||
"semver": "^7.6.0",
|
||||
"uuid": "^9.0.1",
|
||||
"zlib": "^1.0.5"
|
||||
},
|
||||
@@ -45,8 +45,8 @@
|
||||
"@types/node": "20.9.0",
|
||||
"@types/semver": "^7.5.6",
|
||||
"@types/sinon": "^17.0.3",
|
||||
"@typescript-eslint/eslint-plugin": "^6.19.1",
|
||||
"@typescript-eslint/parser": "^6.19.1",
|
||||
"@typescript-eslint/eslint-plugin": "^6.20.0",
|
||||
"@typescript-eslint/parser": "^6.20.0",
|
||||
"ava": "^5.3.1",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-import-resolver-typescript": "^3.6.1",
|
||||
@@ -55,7 +55,7 @@
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-no-async-foreach": "^0.1.1",
|
||||
"micromatch": "4.0.5",
|
||||
"nock": "^13.5.0",
|
||||
"nock": "^13.5.1",
|
||||
"removeNPMAbsolutePaths": "3.0.1",
|
||||
"sinon": "^17.0.1",
|
||||
"typescript": "^5.3.3"
|
||||
@@ -82,9 +82,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/cache": {
|
||||
"version": "3.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.2.3.tgz",
|
||||
"integrity": "sha512-m8KvmcD+JxSLOfNUXuBF2jL0Lp+co/Fhbf0NTt0M9lz61WnXRdqpIGrOvTRZmKIl+7HaHil6kGE3fkEfrKQCQA==",
|
||||
"version": "3.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.2.4.tgz",
|
||||
"integrity": "sha512-RuHnwfcDagtX+37s0ZWy7clbOfnZ7AlDJQ7k/9rzt2W4Gnwde3fa/qjSjVuz4vLcLIpc7fUob27CMrqiWZytYA==",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.0.1",
|
||||
@@ -1012,21 +1012,21 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@types/uuid": {
|
||||
"version": "9.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.7.tgz",
|
||||
"integrity": "sha512-WUtIVRUZ9i5dYXefDEAI7sh9/O7jGvHg7Df/5O/gtH3Yabe5odI3UWopVR1qbPXQtvOxWu3mM4XxlYeZtMWF4g=="
|
||||
"version": "9.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz",
|
||||
"integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA=="
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.19.1.tgz",
|
||||
"integrity": "sha512-roQScUGFruWod9CEyoV5KlCYrubC/fvG8/1zXuT0WTcxX87GnMMmnksMwSg99lo1xiKrBzw2icsJPMAw1OtKxg==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.20.0.tgz",
|
||||
"integrity": "sha512-fTwGQUnjhoYHeSF6m5pWNkzmDDdsKELYrOBxhjMrofPqCkoC2k3B2wvGHFxa1CTIqkEn88nlW1HVMztjo2K8Hg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.5.1",
|
||||
"@typescript-eslint/scope-manager": "6.19.1",
|
||||
"@typescript-eslint/type-utils": "6.19.1",
|
||||
"@typescript-eslint/utils": "6.19.1",
|
||||
"@typescript-eslint/visitor-keys": "6.19.1",
|
||||
"@typescript-eslint/scope-manager": "6.20.0",
|
||||
"@typescript-eslint/type-utils": "6.20.0",
|
||||
"@typescript-eslint/utils": "6.20.0",
|
||||
"@typescript-eslint/visitor-keys": "6.20.0",
|
||||
"debug": "^4.3.4",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.2.4",
|
||||
@@ -1052,15 +1052,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.19.1.tgz",
|
||||
"integrity": "sha512-WEfX22ziAh6pRE9jnbkkLGp/4RhTpffr2ZK5bJ18M8mIfA8A+k97U9ZyaXCEJRlmMHh7R9MJZWXp/r73DzINVQ==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.20.0.tgz",
|
||||
"integrity": "sha512-bYerPDF/H5v6V76MdMYhjwmwgMA+jlPVqjSDq2cRqMi8bP5sR3Z+RLOiOMad3nsnmDVmn2gAFCyNgh/dIrfP/w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "6.19.1",
|
||||
"@typescript-eslint/types": "6.19.1",
|
||||
"@typescript-eslint/typescript-estree": "6.19.1",
|
||||
"@typescript-eslint/visitor-keys": "6.19.1",
|
||||
"@typescript-eslint/scope-manager": "6.20.0",
|
||||
"@typescript-eslint/types": "6.20.0",
|
||||
"@typescript-eslint/typescript-estree": "6.20.0",
|
||||
"@typescript-eslint/visitor-keys": "6.20.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1080,13 +1080,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.19.1.tgz",
|
||||
"integrity": "sha512-4CdXYjKf6/6aKNMSly/BP4iCSOpvMmqtDzRtqFyyAae3z5kkqEjKndR5vDHL8rSuMIIWP8u4Mw4VxLyxZW6D5w==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.20.0.tgz",
|
||||
"integrity": "sha512-p4rvHQRDTI1tGGMDFQm+GtxP1ZHyAh64WANVoyEcNMpaTFn3ox/3CcgtIlELnRfKzSs/DwYlDccJEtr3O6qBvA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.19.1",
|
||||
"@typescript-eslint/visitor-keys": "6.19.1"
|
||||
"@typescript-eslint/types": "6.20.0",
|
||||
"@typescript-eslint/visitor-keys": "6.20.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
@@ -1097,13 +1097,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.19.1.tgz",
|
||||
"integrity": "sha512-0vdyld3ecfxJuddDjACUvlAeYNrHP/pDeQk2pWBR2ESeEzQhg52DF53AbI9QCBkYE23lgkhLCZNkHn2hEXXYIg==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.20.0.tgz",
|
||||
"integrity": "sha512-qnSobiJQb1F5JjN0YDRPHruQTrX7ICsmltXhkV536mp4idGAYrIyr47zF/JmkJtEcAVnIz4gUYJ7gOZa6SmN4g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/typescript-estree": "6.19.1",
|
||||
"@typescript-eslint/utils": "6.19.1",
|
||||
"@typescript-eslint/typescript-estree": "6.20.0",
|
||||
"@typescript-eslint/utils": "6.20.0",
|
||||
"debug": "^4.3.4",
|
||||
"ts-api-utils": "^1.0.1"
|
||||
},
|
||||
@@ -1124,9 +1124,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.1.tgz",
|
||||
"integrity": "sha512-6+bk6FEtBhvfYvpHsDgAL3uo4BfvnTnoge5LrrCj2eJN8g3IJdLTD4B/jK3Q6vo4Ql/Hoip9I8aB6fF+6RfDqg==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.20.0.tgz",
|
||||
"integrity": "sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
@@ -1137,13 +1137,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.1.tgz",
|
||||
"integrity": "sha512-aFdAxuhzBFRWhy+H20nYu19+Km+gFfwNO4TEqyszkMcgBDYQjmPJ61erHxuT2ESJXhlhrO7I5EFIlZ+qGR8oVA==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.20.0.tgz",
|
||||
"integrity": "sha512-RnRya9q5m6YYSpBN7IzKu9FmLcYtErkDkc8/dKv81I9QiLLtVBHrjz+Ev/crAqgMNW2FCsoZF4g2QUylMnJz+g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.19.1",
|
||||
"@typescript-eslint/visitor-keys": "6.19.1",
|
||||
"@typescript-eslint/types": "6.20.0",
|
||||
"@typescript-eslint/visitor-keys": "6.20.0",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
@@ -1189,17 +1189,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.19.1.tgz",
|
||||
"integrity": "sha512-JvjfEZuP5WoMqwh9SPAPDSHSg9FBHHGhjPugSRxu5jMfjvBpq5/sGTD+9M9aQ5sh6iJ8AY/Kk/oUYVEMAPwi7w==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.20.0.tgz",
|
||||
"integrity": "sha512-/EKuw+kRu2vAqCoDwDCBtDRU6CTKbUmwwI7SH7AashZ+W+7o8eiyy6V2cdOqN49KsTcASWsC5QeghYuRDTyOOg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.4.0",
|
||||
"@types/json-schema": "^7.0.12",
|
||||
"@types/semver": "^7.5.0",
|
||||
"@typescript-eslint/scope-manager": "6.19.1",
|
||||
"@typescript-eslint/types": "6.19.1",
|
||||
"@typescript-eslint/typescript-estree": "6.19.1",
|
||||
"@typescript-eslint/scope-manager": "6.20.0",
|
||||
"@typescript-eslint/types": "6.20.0",
|
||||
"@typescript-eslint/typescript-estree": "6.20.0",
|
||||
"semver": "^7.5.4"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1214,12 +1214,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "6.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.1.tgz",
|
||||
"integrity": "sha512-gkdtIO+xSO/SmI0W68DBg4u1KElmIUo3vXzgHyGPs6cxgB0sa3TlptRAAE0hUY1hM6FcDKEv7aIwiTGm76cXfQ==",
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz",
|
||||
"integrity": "sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.19.1",
|
||||
"@typescript-eslint/types": "6.20.0",
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
},
|
||||
"engines": {
|
||||
@@ -4621,9 +4621,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/nock": {
|
||||
"version": "13.5.0",
|
||||
"resolved": "https://registry.npmjs.org/nock/-/nock-13.5.0.tgz",
|
||||
"integrity": "sha512-9hc1eCS2HtOz+sE9W7JQw/tXJktg0zoPSu48s/pYe73e25JW9ywiowbqnUSd7iZPeVawLcVpPZeZS312fwSY+g==",
|
||||
"version": "13.5.1",
|
||||
"resolved": "https://registry.npmjs.org/nock/-/nock-13.5.1.tgz",
|
||||
"integrity": "sha512-+s7b73fzj5KnxbKH4Oaqz07tQ8degcMilU4rrmnKvI//b0JMBU4wEXFQ8zqr+3+L4eWSfU3H/UoIVGUV0tue1Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"debug": "^4.1.0",
|
||||
@@ -5496,9 +5496,9 @@
|
||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.5.4",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
||||
"version": "7.6.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",
|
||||
"integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
|
||||
14
package.json
14
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codeql",
|
||||
"version": "3.23.2",
|
||||
"version": "3.24.1",
|
||||
"private": true,
|
||||
"description": "CodeQL action",
|
||||
"scripts": {
|
||||
@@ -22,7 +22,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/artifact": "^1.1.2",
|
||||
"@actions/cache": "^3.2.3",
|
||||
"@actions/cache": "^3.2.4",
|
||||
"@actions/core": "^1.10.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/github": "^5.1.1",
|
||||
@@ -32,7 +32,7 @@
|
||||
"@octokit/plugin-retry": "^5.0.2",
|
||||
"@octokit/types": "^12.4.0",
|
||||
"@schemastore/package": "0.0.10",
|
||||
"@types/uuid": "^9.0.7",
|
||||
"@types/uuid": "^9.0.8",
|
||||
"adm-zip": "^0.5.10",
|
||||
"check-disk-space": "^3.4.0",
|
||||
"console-log-level": "^1.4.1",
|
||||
@@ -45,7 +45,7 @@
|
||||
"jsonschema": "1.4.1",
|
||||
"long": "^5.2.3",
|
||||
"path": "^0.12.7",
|
||||
"semver": "^7.5.4",
|
||||
"semver": "^7.6.0",
|
||||
"uuid": "^9.0.1",
|
||||
"zlib": "^1.0.5"
|
||||
},
|
||||
@@ -60,8 +60,8 @@
|
||||
"@types/node": "20.9.0",
|
||||
"@types/semver": "^7.5.6",
|
||||
"@types/sinon": "^17.0.3",
|
||||
"@typescript-eslint/eslint-plugin": "^6.19.1",
|
||||
"@typescript-eslint/parser": "^6.19.1",
|
||||
"@typescript-eslint/eslint-plugin": "^6.20.0",
|
||||
"@typescript-eslint/parser": "^6.20.0",
|
||||
"ava": "^5.3.1",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-import-resolver-typescript": "^3.6.1",
|
||||
@@ -70,7 +70,7 @@
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-no-async-foreach": "^0.1.1",
|
||||
"micromatch": "4.0.5",
|
||||
"nock": "^13.5.0",
|
||||
"nock": "^13.5.1",
|
||||
"removeNPMAbsolutePaths": "3.0.1",
|
||||
"sinon": "^17.0.1",
|
||||
"typescript": "^5.3.3"
|
||||
|
||||
24
pr-checks/checks/build-mode-none.yml
Normal file
24
pr-checks/checks/build-mode-none.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
name: "Build mode none"
|
||||
description: "An end-to-end integration test of a Java repository built using 'build-mode: none'"
|
||||
operatingSystems: ["ubuntu"]
|
||||
versions: ["latest", "nightly-latest"]
|
||||
steps:
|
||||
- uses: ./../action/init
|
||||
id: init
|
||||
with:
|
||||
build-mode: none
|
||||
db-location: "${{ runner.temp }}/customDbLocation"
|
||||
languages: java
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
|
||||
- name: Validate database build mode
|
||||
run: |
|
||||
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
|
||||
build_mode=$(yq eval '.buildMode' "$metadata_path")
|
||||
if [[ "$build_mode" != "none" ]]; then
|
||||
echo "Expected build mode to be 'none' but was $build_mode"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- uses: ./../action/autobuild
|
||||
- uses: ./../action/analyze
|
||||
@@ -1,5 +1,6 @@
|
||||
name: "Use a custom `checkout_path`"
|
||||
description: "Checks that a custom `checkout_path` will find the proper commit_oid"
|
||||
versions: ["latest"]
|
||||
steps:
|
||||
# This ensures we don't accidentally use the original checkout for any part of the test.
|
||||
- name: Delete original checkout
|
||||
@@ -22,7 +23,6 @@ steps:
|
||||
# it's enough to test one compiled language and one interpreted language
|
||||
languages: csharp,javascript
|
||||
source-root: x/y/z/some-path/tests/multi-language-repo
|
||||
debug: true
|
||||
|
||||
- name: Build code
|
||||
shell: bash
|
||||
|
||||
@@ -6,11 +6,15 @@ import * as sinon from "sinon";
|
||||
|
||||
import { runQueries } from "./analyze";
|
||||
import { setCodeQL } from "./codeql";
|
||||
import { Config } from "./config-utils";
|
||||
import { Feature } from "./feature-flags";
|
||||
import { Language } from "./languages";
|
||||
import { getRunnerLogger } from "./logging";
|
||||
import { setupTests, setupActionsVars, createFeatures } from "./testing-utils";
|
||||
import {
|
||||
setupTests,
|
||||
setupActionsVars,
|
||||
createFeatures,
|
||||
createTestConfig,
|
||||
} from "./testing-utils";
|
||||
import * as uploadLib from "./upload-lib";
|
||||
import * as util from "./util";
|
||||
|
||||
@@ -82,25 +86,11 @@ test("status report fields", async (t) => {
|
||||
databasePrintBaseline: async () => "",
|
||||
});
|
||||
|
||||
const config: Config = {
|
||||
const config = createTestConfig({
|
||||
languages: [language],
|
||||
originalUserInput: {},
|
||||
tempDir: tmpDir,
|
||||
codeQLCmd: "",
|
||||
gitHubVersion: {
|
||||
type: util.GitHubVariant.DOTCOM,
|
||||
} as util.GitHubVersion,
|
||||
dbLocation: path.resolve(tmpDir, "codeql_databases"),
|
||||
debugMode: false,
|
||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: {
|
||||
packsInputCombines: false,
|
||||
queriesInputCombines: false,
|
||||
},
|
||||
trapCaches: {},
|
||||
trapCacheDownloadTime: 0,
|
||||
};
|
||||
});
|
||||
fs.mkdirSync(util.getCodeQLDatabasePath(config, language), {
|
||||
recursive: true,
|
||||
});
|
||||
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
SAMPLE_DEFAULT_CLI_VERSION,
|
||||
mockBundleDownloadApi,
|
||||
makeVersionInfo,
|
||||
createTestConfig,
|
||||
} from "./testing-utils";
|
||||
import * as util from "./util";
|
||||
import { initializeEnvironment } from "./util";
|
||||
@@ -37,25 +38,9 @@ let stubConfig: Config;
|
||||
test.beforeEach(() => {
|
||||
initializeEnvironment("1.2.3");
|
||||
|
||||
stubConfig = {
|
||||
stubConfig = createTestConfig({
|
||||
languages: [Language.cpp],
|
||||
originalUserInput: {},
|
||||
tempDir: "",
|
||||
codeQLCmd: "",
|
||||
gitHubVersion: {
|
||||
type: util.GitHubVariant.DOTCOM,
|
||||
} as util.GitHubVersion,
|
||||
dbLocation: "",
|
||||
debugMode: false,
|
||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: {
|
||||
packsInputCombines: false,
|
||||
queriesInputCombines: false,
|
||||
},
|
||||
trapCaches: {},
|
||||
trapCacheDownloadTime: 0,
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
async function installIntoToolcache({
|
||||
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
import { isTracedLanguage, Language } from "./languages";
|
||||
import { Logger } from "./logging";
|
||||
import * as setupCodeql from "./setup-codeql";
|
||||
import { ToolsFeature, isSupportedToolsFeature } from "./tools-features";
|
||||
import * as util from "./util";
|
||||
import { wrapError } from "./util";
|
||||
|
||||
@@ -90,6 +91,10 @@ export interface CodeQL {
|
||||
* Print version information about CodeQL.
|
||||
*/
|
||||
printVersion(): Promise<void>;
|
||||
/**
|
||||
* Returns whether the CodeQL executable supports the specified feature.
|
||||
*/
|
||||
supportsFeature(feature: ToolsFeature): Promise<boolean>;
|
||||
/**
|
||||
* Run 'codeql database init --db-cluster'.
|
||||
*/
|
||||
@@ -452,17 +457,17 @@ function resolveFunction<T>(
|
||||
export function setCodeQL(partialCodeql: Partial<CodeQL>): CodeQL {
|
||||
cachedCodeQL = {
|
||||
getPath: resolveFunction(partialCodeql, "getPath", () => "/tmp/dummy-path"),
|
||||
getVersion: resolveFunction(
|
||||
partialCodeql,
|
||||
"getVersion",
|
||||
() =>
|
||||
new Promise((resolve) =>
|
||||
resolve({
|
||||
version: "1.0.0",
|
||||
}),
|
||||
),
|
||||
),
|
||||
getVersion: resolveFunction(partialCodeql, "getVersion", async () => ({
|
||||
version: "1.0.0",
|
||||
})),
|
||||
printVersion: resolveFunction(partialCodeql, "printVersion"),
|
||||
supportsFeature: resolveFunction(
|
||||
partialCodeql,
|
||||
"supportsFeature",
|
||||
async (feature) =>
|
||||
!!partialCodeql.getVersion &&
|
||||
isSupportedToolsFeature(await partialCodeql.getVersion(), feature),
|
||||
),
|
||||
databaseInitCluster: resolveFunction(partialCodeql, "databaseInitCluster"),
|
||||
runAutobuild: resolveFunction(partialCodeql, "runAutobuild"),
|
||||
extractScannedLanguage: resolveFunction(
|
||||
@@ -561,6 +566,9 @@ export async function getCodeQLForCmd(
|
||||
async printVersion() {
|
||||
await runTool(cmd, ["version", "--format=json"]);
|
||||
},
|
||||
async supportsFeature(feature: ToolsFeature) {
|
||||
return isSupportedToolsFeature(await this.getVersion(), feature);
|
||||
},
|
||||
async databaseInitCluster(
|
||||
config: Config,
|
||||
sourceRoot: string,
|
||||
@@ -589,6 +597,12 @@ export async function getCodeQLForCmd(
|
||||
extraArgs.push("--external-repository-token-stdin");
|
||||
}
|
||||
|
||||
if (
|
||||
config.buildMode !== undefined &&
|
||||
(await this.supportsFeature(ToolsFeature.BuildModeOption))
|
||||
) {
|
||||
extraArgs.push(`--build-mode=${config.buildMode}`);
|
||||
}
|
||||
if (
|
||||
qlconfigFile !== undefined &&
|
||||
(await util.codeQlVersionAbove(this, CODEQL_VERSION_INIT_WITH_QLCONFIG))
|
||||
|
||||
@@ -7,7 +7,12 @@ import * as yaml from "js-yaml";
|
||||
import * as sinon from "sinon";
|
||||
|
||||
import * as api from "./api-client";
|
||||
import { getCachedCodeQL, PackDownloadOutput, setCodeQL } from "./codeql";
|
||||
import {
|
||||
CodeQL,
|
||||
getCachedCodeQL,
|
||||
PackDownloadOutput,
|
||||
setCodeQL,
|
||||
} from "./codeql";
|
||||
import * as configUtils from "./config-utils";
|
||||
import { Language } from "./languages";
|
||||
import { getRunnerLogger } from "./logging";
|
||||
@@ -26,15 +31,42 @@ import {
|
||||
|
||||
setupTests(test);
|
||||
|
||||
const sampleApiDetails = {
|
||||
auth: "token",
|
||||
externalRepoAuth: "token",
|
||||
url: "https://github.example.com",
|
||||
apiURL: undefined,
|
||||
registriesAuthTokens: undefined,
|
||||
};
|
||||
const githubVersion = { type: GitHubVariant.DOTCOM } as GitHubVersion;
|
||||
|
||||
const gitHubVersion = { type: GitHubVariant.DOTCOM } as GitHubVersion;
|
||||
function createTestInitConfigInputs(
|
||||
overrides: Partial<configUtils.InitConfigInputs>,
|
||||
): configUtils.InitConfigInputs {
|
||||
return Object.assign(
|
||||
{},
|
||||
{
|
||||
languagesInput: undefined,
|
||||
queriesInput: undefined,
|
||||
packsInput: undefined,
|
||||
configFile: undefined,
|
||||
dbLocation: undefined,
|
||||
configInput: undefined,
|
||||
buildModeInput: undefined,
|
||||
trapCachingEnabled: false,
|
||||
debugMode: false,
|
||||
debugArtifactName: "",
|
||||
debugDatabaseName: "",
|
||||
repository: { owner: "github", repo: "example" },
|
||||
tempDir: "",
|
||||
codeql: {} as CodeQL,
|
||||
workspacePath: "",
|
||||
githubVersion,
|
||||
apiDetails: {
|
||||
auth: "token",
|
||||
externalRepoAuth: "token",
|
||||
url: "https://github.example.com",
|
||||
apiURL: undefined,
|
||||
registriesAuthTokens: undefined,
|
||||
},
|
||||
logger: getRunnerLogger(true),
|
||||
},
|
||||
overrides,
|
||||
);
|
||||
}
|
||||
|
||||
// Returns the filepath of the newly-created file
|
||||
function createConfigFile(inputFileContents: string, tmpDir: string): string {
|
||||
@@ -77,11 +109,11 @@ function mockListLanguages(languages: string[]) {
|
||||
}
|
||||
|
||||
test("load empty config", async (t) => {
|
||||
return await withTmpDir(async (tmpDir) => {
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
const logger = getRunnerLogger(true);
|
||||
const languages = "javascript,python";
|
||||
|
||||
const codeQL = setCodeQL({
|
||||
const codeql = setCodeQL({
|
||||
async resolveQueries() {
|
||||
return {
|
||||
byLanguage: {
|
||||
@@ -98,51 +130,34 @@ test("load empty config", async (t) => {
|
||||
});
|
||||
|
||||
const config = await configUtils.initConfig(
|
||||
languages,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
"",
|
||||
"",
|
||||
{ owner: "github", repo: "example" },
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
logger,
|
||||
createTestInitConfigInputs({
|
||||
languagesInput: languages,
|
||||
repository: { owner: "github", repo: "example" },
|
||||
tempDir,
|
||||
codeql,
|
||||
logger,
|
||||
}),
|
||||
);
|
||||
|
||||
t.deepEqual(
|
||||
config,
|
||||
await configUtils.getDefaultConfig(
|
||||
languages,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
"",
|
||||
"",
|
||||
{ owner: "github", repo: "example" },
|
||||
tmpDir,
|
||||
codeQL,
|
||||
gitHubVersion,
|
||||
logger,
|
||||
createTestInitConfigInputs({
|
||||
languagesInput: languages,
|
||||
tempDir,
|
||||
codeql,
|
||||
logger,
|
||||
}),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
test("loading config saves config", async (t) => {
|
||||
return await withTmpDir(async (tmpDir) => {
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
const logger = getRunnerLogger(true);
|
||||
|
||||
const codeQL = setCodeQL({
|
||||
const codeql = setCodeQL({
|
||||
async resolveQueries() {
|
||||
return {
|
||||
byLanguage: {
|
||||
@@ -159,36 +174,26 @@ test("loading config saves config", async (t) => {
|
||||
});
|
||||
|
||||
// Sanity check the saved config file does not already exist
|
||||
t.false(fs.existsSync(configUtils.getPathToParsedConfigFile(tmpDir)));
|
||||
t.false(fs.existsSync(configUtils.getPathToParsedConfigFile(tempDir)));
|
||||
|
||||
// Sanity check that getConfig returns undefined before we have called initConfig
|
||||
t.deepEqual(await configUtils.getConfig(tmpDir, logger), undefined);
|
||||
t.deepEqual(await configUtils.getConfig(tempDir, logger), undefined);
|
||||
|
||||
const config1 = await configUtils.initConfig(
|
||||
"javascript,python",
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
"",
|
||||
"",
|
||||
{ owner: "github", repo: "example" },
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
logger,
|
||||
createTestInitConfigInputs({
|
||||
languagesInput: "javascript,python",
|
||||
tempDir,
|
||||
codeql,
|
||||
workspacePath: tempDir,
|
||||
logger,
|
||||
}),
|
||||
);
|
||||
|
||||
// The saved config file should now exist
|
||||
t.true(fs.existsSync(configUtils.getPathToParsedConfigFile(tmpDir)));
|
||||
t.true(fs.existsSync(configUtils.getPathToParsedConfigFile(tempDir)));
|
||||
|
||||
// And that same newly-initialised config should now be returned by getConfig
|
||||
const config2 = await configUtils.getConfig(tmpDir, logger);
|
||||
const config2 = await configUtils.getConfig(tempDir, logger);
|
||||
t.not(config2, undefined);
|
||||
if (config2 !== undefined) {
|
||||
// removes properties assigned to undefined.
|
||||
@@ -199,26 +204,15 @@ test("loading config saves config", async (t) => {
|
||||
});
|
||||
|
||||
test("load input outside of workspace", async (t) => {
|
||||
return await withTmpDir(async (tmpDir) => {
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
try {
|
||||
await configUtils.initConfig(
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
"../input",
|
||||
undefined,
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
"",
|
||||
"",
|
||||
{ owner: "github", repo: "example" },
|
||||
tmpDir,
|
||||
getCachedCodeQL(),
|
||||
tmpDir,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true),
|
||||
createTestInitConfigInputs({
|
||||
configFile: "../input",
|
||||
tempDir,
|
||||
codeql: getCachedCodeQL(),
|
||||
workspacePath: tempDir,
|
||||
}),
|
||||
);
|
||||
throw new Error("initConfig did not throw error");
|
||||
} catch (err) {
|
||||
@@ -226,7 +220,7 @@ test("load input outside of workspace", async (t) => {
|
||||
err,
|
||||
new UserError(
|
||||
configUtils.getConfigFileOutsideWorkspaceErrorMessage(
|
||||
path.join(tmpDir, "../input"),
|
||||
path.join(tempDir, "../input"),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -235,29 +229,18 @@ test("load input outside of workspace", async (t) => {
|
||||
});
|
||||
|
||||
test("load non-local input with invalid repo syntax", async (t) => {
|
||||
return await withTmpDir(async (tmpDir) => {
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
// no filename given, just a repo
|
||||
const configFile = "octo-org/codeql-config@main";
|
||||
|
||||
try {
|
||||
await configUtils.initConfig(
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
configFile,
|
||||
undefined,
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
"",
|
||||
"",
|
||||
{ owner: "github", repo: "example" },
|
||||
tmpDir,
|
||||
getCachedCodeQL(),
|
||||
tmpDir,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true),
|
||||
createTestInitConfigInputs({
|
||||
configFile,
|
||||
tempDir,
|
||||
codeql: getCachedCodeQL(),
|
||||
workspacePath: tempDir,
|
||||
}),
|
||||
);
|
||||
throw new Error("initConfig did not throw error");
|
||||
} catch (err) {
|
||||
@@ -274,30 +257,20 @@ test("load non-local input with invalid repo syntax", async (t) => {
|
||||
});
|
||||
|
||||
test("load non-existent input", async (t) => {
|
||||
return await withTmpDir(async (tmpDir) => {
|
||||
const languages = "javascript";
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
const languagesInput = "javascript";
|
||||
const configFile = "input";
|
||||
t.false(fs.existsSync(path.join(tmpDir, configFile)));
|
||||
t.false(fs.existsSync(path.join(tempDir, configFile)));
|
||||
|
||||
try {
|
||||
await configUtils.initConfig(
|
||||
languages,
|
||||
undefined,
|
||||
undefined,
|
||||
configFile,
|
||||
undefined,
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
"",
|
||||
"",
|
||||
{ owner: "github", repo: "example" },
|
||||
tmpDir,
|
||||
getCachedCodeQL(),
|
||||
tmpDir,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true),
|
||||
createTestInitConfigInputs({
|
||||
languagesInput,
|
||||
configFile,
|
||||
tempDir,
|
||||
codeql: getCachedCodeQL(),
|
||||
workspacePath: tempDir,
|
||||
}),
|
||||
);
|
||||
throw new Error("initConfig did not throw error");
|
||||
} catch (err) {
|
||||
@@ -305,7 +278,7 @@ test("load non-existent input", async (t) => {
|
||||
err,
|
||||
new UserError(
|
||||
configUtils.getConfigFileDoesNotExistErrorMessage(
|
||||
path.join(tmpDir, "input"),
|
||||
path.join(tempDir, "input"),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -314,8 +287,8 @@ test("load non-existent input", async (t) => {
|
||||
});
|
||||
|
||||
test("load non-empty input", async (t) => {
|
||||
return await withTmpDir(async (tmpDir) => {
|
||||
const codeQL = setCodeQL({
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
const codeql = setCodeQL({
|
||||
async resolveQueries() {
|
||||
return {
|
||||
byLanguage: {
|
||||
@@ -345,11 +318,12 @@ test("load non-empty input", async (t) => {
|
||||
paths:
|
||||
- c/d`;
|
||||
|
||||
fs.mkdirSync(path.join(tmpDir, "foo"));
|
||||
fs.mkdirSync(path.join(tempDir, "foo"));
|
||||
|
||||
// And the config we expect it to parse to
|
||||
const expectedConfig: configUtils.Config = {
|
||||
languages: [Language.javascript],
|
||||
buildMode: "none",
|
||||
originalUserInput: {
|
||||
name: "my config",
|
||||
"disable-default-queries": true,
|
||||
@@ -357,10 +331,10 @@ test("load non-empty input", async (t) => {
|
||||
"paths-ignore": ["a", "b"],
|
||||
paths: ["c/d"],
|
||||
},
|
||||
tempDir: tmpDir,
|
||||
codeQLCmd: codeQL.getPath(),
|
||||
gitHubVersion,
|
||||
dbLocation: path.resolve(tmpDir, "codeql_databases"),
|
||||
tempDir,
|
||||
codeQLCmd: codeql.getPath(),
|
||||
gitHubVersion: githubVersion,
|
||||
dbLocation: path.resolve(tempDir, "codeql_databases"),
|
||||
debugMode: false,
|
||||
debugArtifactName: "my-artifact",
|
||||
debugDatabaseName: "my-db",
|
||||
@@ -369,27 +343,20 @@ test("load non-empty input", async (t) => {
|
||||
trapCacheDownloadTime: 0,
|
||||
};
|
||||
|
||||
const languages = "javascript";
|
||||
const configFilePath = createConfigFile(inputFileContents, tmpDir);
|
||||
const languagesInput = "javascript";
|
||||
const configFilePath = createConfigFile(inputFileContents, tempDir);
|
||||
|
||||
const actualConfig = await configUtils.initConfig(
|
||||
languages,
|
||||
undefined,
|
||||
undefined,
|
||||
configFilePath,
|
||||
undefined,
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
"my-artifact",
|
||||
"my-db",
|
||||
{ owner: "github", repo: "example" },
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true),
|
||||
createTestInitConfigInputs({
|
||||
languagesInput,
|
||||
buildModeInput: "none",
|
||||
configFile: configFilePath,
|
||||
debugArtifactName: "my-artifact",
|
||||
debugDatabaseName: "my-db",
|
||||
tempDir,
|
||||
codeql,
|
||||
workspacePath: tempDir,
|
||||
}),
|
||||
);
|
||||
|
||||
// Should exactly equal the object we constructed earlier
|
||||
@@ -417,15 +384,15 @@ function queriesToResolvedQueryForm(queries: string[]) {
|
||||
}
|
||||
|
||||
test("Using config input and file together, config input should be used.", async (t) => {
|
||||
return await withTmpDir(async (tmpDir) => {
|
||||
process.env["RUNNER_TEMP"] = tmpDir;
|
||||
process.env["GITHUB_WORKSPACE"] = tmpDir;
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
process.env["RUNNER_TEMP"] = tempDir;
|
||||
process.env["GITHUB_WORKSPACE"] = tempDir;
|
||||
|
||||
const inputFileContents = `
|
||||
name: my config
|
||||
queries:
|
||||
- uses: ./foo_file`;
|
||||
const configFilePath = createConfigFile(inputFileContents, tmpDir);
|
||||
const configFilePath = createConfigFile(inputFileContents, tempDir);
|
||||
|
||||
const configInput = `
|
||||
name: my config
|
||||
@@ -438,13 +405,13 @@ test("Using config input and file together, config input should be used.", async
|
||||
- c/d@1.2.3
|
||||
`;
|
||||
|
||||
fs.mkdirSync(path.join(tmpDir, "foo"));
|
||||
fs.mkdirSync(path.join(tempDir, "foo"));
|
||||
|
||||
const resolveQueriesArgs: Array<{
|
||||
queries: string[];
|
||||
extraSearchPath: string | undefined;
|
||||
}> = [];
|
||||
const codeQL = setCodeQL({
|
||||
const codeql = setCodeQL({
|
||||
async resolveQueries(
|
||||
queries: string[],
|
||||
extraSearchPath: string | undefined,
|
||||
@@ -458,26 +425,17 @@ test("Using config input and file together, config input should be used.", async
|
||||
});
|
||||
|
||||
// Only JS, python packs will be ignored
|
||||
const languages = "javascript";
|
||||
const languagesInput = "javascript";
|
||||
|
||||
const config = await configUtils.initConfig(
|
||||
languages,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
configFilePath,
|
||||
configInput,
|
||||
false,
|
||||
false,
|
||||
"",
|
||||
"",
|
||||
{ owner: "github", repo: "example" },
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true),
|
||||
createTestInitConfigInputs({
|
||||
languagesInput,
|
||||
configFile: configFilePath,
|
||||
configInput,
|
||||
tempDir,
|
||||
codeql,
|
||||
workspacePath: tempDir,
|
||||
}),
|
||||
);
|
||||
|
||||
t.deepEqual(config.originalUserInput, yaml.load(configInput));
|
||||
@@ -485,8 +443,8 @@ test("Using config input and file together, config input should be used.", async
|
||||
});
|
||||
|
||||
test("API client used when reading remote config", async (t) => {
|
||||
return await withTmpDir(async (tmpDir) => {
|
||||
const codeQL = setCodeQL({
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
const codeql = setCodeQL({
|
||||
async resolveQueries() {
|
||||
return {
|
||||
byLanguage: {
|
||||
@@ -521,59 +479,38 @@ test("API client used when reading remote config", async (t) => {
|
||||
const spyGetContents = mockGetContents(dummyResponse);
|
||||
|
||||
// Create checkout directory for remote queries repository
|
||||
fs.mkdirSync(path.join(tmpDir, "foo/bar/dev"), { recursive: true });
|
||||
fs.mkdirSync(path.join(tempDir, "foo/bar/dev"), { recursive: true });
|
||||
|
||||
const configFile = "octo-org/codeql-config/config.yaml@main";
|
||||
const languages = "javascript";
|
||||
const languagesInput = "javascript";
|
||||
|
||||
await configUtils.initConfig(
|
||||
languages,
|
||||
undefined,
|
||||
undefined,
|
||||
configFile,
|
||||
undefined,
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
"",
|
||||
"",
|
||||
{ owner: "github", repo: "example" },
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true),
|
||||
createTestInitConfigInputs({
|
||||
languagesInput,
|
||||
configFile,
|
||||
tempDir,
|
||||
codeql,
|
||||
workspacePath: tempDir,
|
||||
}),
|
||||
);
|
||||
t.assert(spyGetContents.called);
|
||||
});
|
||||
});
|
||||
|
||||
test("Remote config handles the case where a directory is provided", async (t) => {
|
||||
return await withTmpDir(async (tmpDir) => {
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
const dummyResponse = []; // directories are returned as arrays
|
||||
mockGetContents(dummyResponse);
|
||||
|
||||
const repoReference = "octo-org/codeql-config/config.yaml@main";
|
||||
try {
|
||||
await configUtils.initConfig(
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
repoReference,
|
||||
undefined,
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
"",
|
||||
"",
|
||||
{ owner: "github", repo: "example" },
|
||||
tmpDir,
|
||||
getCachedCodeQL(),
|
||||
tmpDir,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true),
|
||||
createTestInitConfigInputs({
|
||||
configFile: repoReference,
|
||||
tempDir,
|
||||
codeql: getCachedCodeQL(),
|
||||
workspacePath: tempDir,
|
||||
}),
|
||||
);
|
||||
throw new Error("initConfig did not throw error");
|
||||
} catch (err) {
|
||||
@@ -588,7 +525,7 @@ test("Remote config handles the case where a directory is provided", async (t) =
|
||||
});
|
||||
|
||||
test("Invalid format of remote config handled correctly", async (t) => {
|
||||
return await withTmpDir(async (tmpDir) => {
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
const dummyResponse = {
|
||||
// note no "content" property here
|
||||
};
|
||||
@@ -597,23 +534,12 @@ test("Invalid format of remote config handled correctly", async (t) => {
|
||||
const repoReference = "octo-org/codeql-config/config.yaml@main";
|
||||
try {
|
||||
await configUtils.initConfig(
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
repoReference,
|
||||
undefined,
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
"",
|
||||
"",
|
||||
{ owner: "github", repo: "example" },
|
||||
tmpDir,
|
||||
getCachedCodeQL(),
|
||||
tmpDir,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true),
|
||||
createTestInitConfigInputs({
|
||||
configFile: repoReference,
|
||||
tempDir,
|
||||
codeql: getCachedCodeQL(),
|
||||
workspacePath: tempDir,
|
||||
}),
|
||||
);
|
||||
throw new Error("initConfig did not throw error");
|
||||
} catch (err) {
|
||||
@@ -628,9 +554,9 @@ test("Invalid format of remote config handled correctly", async (t) => {
|
||||
});
|
||||
|
||||
test("No detected languages", async (t) => {
|
||||
return await withTmpDir(async (tmpDir) => {
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
mockListLanguages([]);
|
||||
const codeQL = setCodeQL({
|
||||
const codeql = setCodeQL({
|
||||
async resolveLanguages() {
|
||||
return {};
|
||||
},
|
||||
@@ -641,23 +567,11 @@ test("No detected languages", async (t) => {
|
||||
|
||||
try {
|
||||
await configUtils.initConfig(
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
"",
|
||||
"",
|
||||
{ owner: "github", repo: "example" },
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true),
|
||||
createTestInitConfigInputs({
|
||||
tempDir,
|
||||
codeql,
|
||||
workspacePath: tempDir,
|
||||
}),
|
||||
);
|
||||
throw new Error("initConfig did not throw error");
|
||||
} catch (err) {
|
||||
@@ -667,28 +581,17 @@ test("No detected languages", async (t) => {
|
||||
});
|
||||
|
||||
test("Unknown languages", async (t) => {
|
||||
return await withTmpDir(async (tmpDir) => {
|
||||
const languages = "rubbish,english";
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
const languagesInput = "rubbish,english";
|
||||
|
||||
try {
|
||||
await configUtils.initConfig(
|
||||
languages,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
"",
|
||||
"",
|
||||
{ owner: "github", repo: "example" },
|
||||
tmpDir,
|
||||
getCachedCodeQL(),
|
||||
tmpDir,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true),
|
||||
createTestInitConfigInputs({
|
||||
languagesInput,
|
||||
tempDir,
|
||||
codeql: getCachedCodeQL(),
|
||||
workspacePath: tempDir,
|
||||
}),
|
||||
);
|
||||
throw new Error("initConfig did not throw error");
|
||||
} catch (err) {
|
||||
|
||||
@@ -80,6 +80,10 @@ export interface Config {
|
||||
* Set of languages to run analysis for.
|
||||
*/
|
||||
languages: Language[];
|
||||
/**
|
||||
* Build mode, if set. Currently only a single build mode is supported per job.
|
||||
*/
|
||||
buildMode: string | undefined;
|
||||
/**
|
||||
* A unaltered copy of the original user input.
|
||||
* Mainly intended to be used for status reporting.
|
||||
@@ -391,49 +395,82 @@ export async function getRawLanguages(
|
||||
return { rawLanguages, autodetected };
|
||||
}
|
||||
|
||||
/** Inputs required to initialize a configuration. */
|
||||
export interface InitConfigInputs {
|
||||
languagesInput: string | undefined;
|
||||
queriesInput: string | undefined;
|
||||
packsInput: string | undefined;
|
||||
configFile: string | undefined;
|
||||
dbLocation: string | undefined;
|
||||
configInput: string | undefined;
|
||||
buildModeInput: string | undefined;
|
||||
trapCachingEnabled: boolean;
|
||||
debugMode: boolean;
|
||||
debugArtifactName: string;
|
||||
debugDatabaseName: string;
|
||||
repository: RepositoryNwo;
|
||||
tempDir: string;
|
||||
codeql: CodeQL;
|
||||
workspacePath: string;
|
||||
githubVersion: GitHubVersion;
|
||||
apiDetails: api.GitHubApiCombinedDetails;
|
||||
logger: Logger;
|
||||
}
|
||||
|
||||
type GetDefaultConfigInputs = Omit<
|
||||
InitConfigInputs,
|
||||
"configFile" | "configInput"
|
||||
>;
|
||||
|
||||
type LoadConfigInputs = Omit<InitConfigInputs, "configInput"> & {
|
||||
configFile: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the default config for when the user has not supplied one.
|
||||
*/
|
||||
export async function getDefaultConfig(
|
||||
languagesInput: string | undefined,
|
||||
rawQueriesInput: string | undefined,
|
||||
rawPacksInput: string | undefined,
|
||||
dbLocation: string | undefined,
|
||||
trapCachingEnabled: boolean,
|
||||
debugMode: boolean,
|
||||
debugArtifactName: string,
|
||||
debugDatabaseName: string,
|
||||
repository: RepositoryNwo,
|
||||
tempDir: string,
|
||||
codeQL: CodeQL,
|
||||
gitHubVersion: GitHubVersion,
|
||||
logger: Logger,
|
||||
): Promise<Config> {
|
||||
export async function getDefaultConfig({
|
||||
languagesInput,
|
||||
queriesInput,
|
||||
packsInput,
|
||||
buildModeInput,
|
||||
dbLocation,
|
||||
trapCachingEnabled,
|
||||
debugMode,
|
||||
debugArtifactName,
|
||||
debugDatabaseName,
|
||||
repository,
|
||||
tempDir,
|
||||
codeql,
|
||||
githubVersion,
|
||||
logger,
|
||||
}: GetDefaultConfigInputs): Promise<Config> {
|
||||
const languages = await getLanguages(
|
||||
codeQL,
|
||||
codeql,
|
||||
languagesInput,
|
||||
repository,
|
||||
logger,
|
||||
);
|
||||
const augmentationProperties = calculateAugmentation(
|
||||
rawPacksInput,
|
||||
rawQueriesInput,
|
||||
packsInput,
|
||||
queriesInput,
|
||||
languages,
|
||||
);
|
||||
|
||||
const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime(
|
||||
trapCachingEnabled,
|
||||
codeQL,
|
||||
codeql,
|
||||
languages,
|
||||
logger,
|
||||
);
|
||||
|
||||
return {
|
||||
languages,
|
||||
buildMode: buildModeInput,
|
||||
originalUserInput: {},
|
||||
tempDir,
|
||||
codeQLCmd: codeQL.getPath(),
|
||||
gitHubVersion,
|
||||
codeQLCmd: codeql.getPath(),
|
||||
gitHubVersion: githubVersion,
|
||||
dbLocation: dbLocationOrDefault(dbLocation, tempDir),
|
||||
debugMode,
|
||||
debugArtifactName,
|
||||
@@ -466,24 +503,25 @@ async function downloadCacheWithTime(
|
||||
/**
|
||||
* Load the config from the given file.
|
||||
*/
|
||||
async function loadConfig(
|
||||
languagesInput: string | undefined,
|
||||
rawQueriesInput: string | undefined,
|
||||
rawPacksInput: string | undefined,
|
||||
configFile: string,
|
||||
dbLocation: string | undefined,
|
||||
trapCachingEnabled: boolean,
|
||||
debugMode: boolean,
|
||||
debugArtifactName: string,
|
||||
debugDatabaseName: string,
|
||||
repository: RepositoryNwo,
|
||||
tempDir: string,
|
||||
codeQL: CodeQL,
|
||||
workspacePath: string,
|
||||
gitHubVersion: GitHubVersion,
|
||||
apiDetails: api.GitHubApiCombinedDetails,
|
||||
logger: Logger,
|
||||
): Promise<Config> {
|
||||
async function loadConfig({
|
||||
languagesInput,
|
||||
queriesInput,
|
||||
packsInput,
|
||||
buildModeInput,
|
||||
configFile,
|
||||
dbLocation,
|
||||
trapCachingEnabled,
|
||||
debugMode,
|
||||
debugArtifactName,
|
||||
debugDatabaseName,
|
||||
repository,
|
||||
tempDir,
|
||||
codeql,
|
||||
workspacePath,
|
||||
githubVersion,
|
||||
apiDetails,
|
||||
logger,
|
||||
}: LoadConfigInputs): Promise<Config> {
|
||||
let parsedYAML: UserConfig;
|
||||
|
||||
if (isLocal(configFile)) {
|
||||
@@ -495,31 +533,32 @@ async function loadConfig(
|
||||
}
|
||||
|
||||
const languages = await getLanguages(
|
||||
codeQL,
|
||||
codeql,
|
||||
languagesInput,
|
||||
repository,
|
||||
logger,
|
||||
);
|
||||
|
||||
const augmentationProperties = calculateAugmentation(
|
||||
rawPacksInput,
|
||||
rawQueriesInput,
|
||||
packsInput,
|
||||
queriesInput,
|
||||
languages,
|
||||
);
|
||||
|
||||
const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime(
|
||||
trapCachingEnabled,
|
||||
codeQL,
|
||||
codeql,
|
||||
languages,
|
||||
logger,
|
||||
);
|
||||
|
||||
return {
|
||||
languages,
|
||||
buildMode: buildModeInput,
|
||||
originalUserInput: parsedYAML,
|
||||
tempDir,
|
||||
codeQLCmd: codeQL.getPath(),
|
||||
gitHubVersion,
|
||||
codeQLCmd: codeql.getPath(),
|
||||
gitHubVersion: githubVersion,
|
||||
dbLocation: dbLocationOrDefault(dbLocation, tempDir),
|
||||
debugMode,
|
||||
debugArtifactName,
|
||||
@@ -765,76 +804,33 @@ function dbLocationOrDefault(
|
||||
* This will parse the config from the user input if present, or generate
|
||||
* a default config. The parsed config is then stored to a known location.
|
||||
*/
|
||||
export async function initConfig(
|
||||
languagesInput: string | undefined,
|
||||
queriesInput: string | undefined,
|
||||
packsInput: string | undefined,
|
||||
configFile: string | undefined,
|
||||
dbLocation: string | undefined,
|
||||
configInput: string | undefined,
|
||||
trapCachingEnabled: boolean,
|
||||
debugMode: boolean,
|
||||
debugArtifactName: string,
|
||||
debugDatabaseName: string,
|
||||
repository: RepositoryNwo,
|
||||
tempDir: string,
|
||||
codeQL: CodeQL,
|
||||
workspacePath: string,
|
||||
gitHubVersion: GitHubVersion,
|
||||
apiDetails: api.GitHubApiCombinedDetails,
|
||||
logger: Logger,
|
||||
): Promise<Config> {
|
||||
export async function initConfig(inputs: InitConfigInputs): Promise<Config> {
|
||||
let config: Config;
|
||||
|
||||
const { logger, workspacePath } = inputs;
|
||||
|
||||
// if configInput is set, it takes precedence over configFile
|
||||
if (configInput) {
|
||||
if (configFile) {
|
||||
if (inputs.configInput) {
|
||||
if (inputs.configFile) {
|
||||
logger.warning(
|
||||
`Both a config file and config input were provided. Ignoring config file.`,
|
||||
);
|
||||
}
|
||||
configFile = path.resolve(workspacePath, "user-config-from-action.yml");
|
||||
fs.writeFileSync(configFile, configInput);
|
||||
logger.debug(`Using config from action input: ${configFile}`);
|
||||
inputs.configFile = path.resolve(
|
||||
workspacePath,
|
||||
"user-config-from-action.yml",
|
||||
);
|
||||
fs.writeFileSync(inputs.configFile, inputs.configInput);
|
||||
logger.debug(`Using config from action input: ${inputs.configFile}`);
|
||||
}
|
||||
|
||||
// If no config file was provided create an empty one
|
||||
if (!configFile) {
|
||||
if (!inputs.configFile) {
|
||||
logger.debug("No configuration file was provided");
|
||||
config = await getDefaultConfig(
|
||||
languagesInput,
|
||||
queriesInput,
|
||||
packsInput,
|
||||
dbLocation,
|
||||
trapCachingEnabled,
|
||||
debugMode,
|
||||
debugArtifactName,
|
||||
debugDatabaseName,
|
||||
repository,
|
||||
tempDir,
|
||||
codeQL,
|
||||
gitHubVersion,
|
||||
logger,
|
||||
);
|
||||
config = await getDefaultConfig(inputs);
|
||||
} else {
|
||||
config = await loadConfig(
|
||||
languagesInput,
|
||||
queriesInput,
|
||||
packsInput,
|
||||
configFile,
|
||||
dbLocation,
|
||||
trapCachingEnabled,
|
||||
debugMode,
|
||||
debugArtifactName,
|
||||
debugDatabaseName,
|
||||
repository,
|
||||
tempDir,
|
||||
codeQL,
|
||||
workspacePath,
|
||||
gitHubVersion,
|
||||
apiDetails,
|
||||
logger,
|
||||
);
|
||||
// Convince the type checker that inputs.configFile is defined.
|
||||
config = await loadConfig({ ...inputs, configFile: inputs.configFile });
|
||||
}
|
||||
|
||||
// Save the config so we can easily access it again in the future
|
||||
|
||||
@@ -8,19 +8,18 @@ import * as actionsUtil from "./actions-util";
|
||||
import { GitHubApiDetails } from "./api-client";
|
||||
import * as apiClient from "./api-client";
|
||||
import { setCodeQL } from "./codeql";
|
||||
import { Config, defaultAugmentationProperties } from "./config-utils";
|
||||
import { Config } from "./config-utils";
|
||||
import { uploadDatabases } from "./database-upload";
|
||||
import { Language } from "./languages";
|
||||
import { RepositoryNwo } from "./repository";
|
||||
import {
|
||||
createTestConfig,
|
||||
getRecordingLogger,
|
||||
LoggedMessage,
|
||||
setupActionsVars,
|
||||
setupTests,
|
||||
} from "./testing-utils";
|
||||
import {
|
||||
DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
DEFAULT_DEBUG_DATABASE_NAME,
|
||||
GitHubVariant,
|
||||
HTTPError,
|
||||
initializeEnvironment,
|
||||
@@ -41,20 +40,10 @@ const testApiDetails: GitHubApiDetails = {
|
||||
};
|
||||
|
||||
function getTestConfig(tmpDir: string): Config {
|
||||
return {
|
||||
return createTestConfig({
|
||||
languages: [Language.javascript],
|
||||
originalUserInput: {},
|
||||
tempDir: tmpDir,
|
||||
codeQLCmd: "foo",
|
||||
gitHubVersion: { type: GitHubVariant.DOTCOM },
|
||||
dbLocation: tmpDir,
|
||||
debugMode: false,
|
||||
debugArtifactName: DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: defaultAugmentationProperties,
|
||||
trapCaches: {},
|
||||
trapCacheDownloadTime: 0,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
async function mockHttpRequests(databaseUploadStatusCode: number) {
|
||||
|
||||
@@ -105,7 +105,7 @@ export const featureConfig: Record<
|
||||
// here!
|
||||
envVar: "CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION",
|
||||
minimumVersion: "2.16.0",
|
||||
defaultValue: false,
|
||||
defaultValue: true,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ import {
|
||||
getActionsStatus,
|
||||
sendStatusReport,
|
||||
} from "./status-report";
|
||||
import { ToolsFeature, isSupportedToolsFeature } from "./tools-features";
|
||||
import { ToolsFeature } from "./tools-features";
|
||||
import { getTotalCacheSize } from "./trap-caching";
|
||||
import {
|
||||
checkDiskUsage,
|
||||
@@ -265,29 +265,32 @@ async function run() {
|
||||
}
|
||||
core.endGroup();
|
||||
|
||||
config = await initConfig(
|
||||
getOptionalInput("languages"),
|
||||
getOptionalInput("queries"),
|
||||
getOptionalInput("packs"),
|
||||
getOptionalInput("config-file"),
|
||||
getOptionalInput("db-location"),
|
||||
getOptionalInput("config"),
|
||||
getTrapCachingEnabled(),
|
||||
config = await initConfig({
|
||||
languagesInput: getOptionalInput("languages"),
|
||||
queriesInput: getOptionalInput("queries"),
|
||||
packsInput: getOptionalInput("packs"),
|
||||
buildModeInput: getOptionalInput("build-mode"),
|
||||
configFile: getOptionalInput("config-file"),
|
||||
dbLocation: getOptionalInput("db-location"),
|
||||
configInput: getOptionalInput("config"),
|
||||
trapCachingEnabled: getTrapCachingEnabled(),
|
||||
// Debug mode is enabled if:
|
||||
// - The `init` Action is passed `debug: true`.
|
||||
// - Actions step debugging is enabled (e.g. by [enabling debug logging for a rerun](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs#re-running-all-the-jobs-in-a-workflow),
|
||||
// or by setting the `ACTIONS_STEP_DEBUG` secret to `true`).
|
||||
getOptionalInput("debug") === "true" || core.isDebug(),
|
||||
getOptionalInput("debug-artifact-name") || DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
getOptionalInput("debug-database-name") || DEFAULT_DEBUG_DATABASE_NAME,
|
||||
repositoryNwo,
|
||||
getTemporaryDirectory(),
|
||||
debugMode: getOptionalInput("debug") === "true" || core.isDebug(),
|
||||
debugArtifactName:
|
||||
getOptionalInput("debug-artifact-name") || DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName:
|
||||
getOptionalInput("debug-database-name") || DEFAULT_DEBUG_DATABASE_NAME,
|
||||
repository: repositoryNwo,
|
||||
tempDir: getTemporaryDirectory(),
|
||||
codeql,
|
||||
getRequiredEnvParam("GITHUB_WORKSPACE"),
|
||||
gitHubVersion,
|
||||
workspacePath: getRequiredEnvParam("GITHUB_WORKSPACE"),
|
||||
githubVersion: gitHubVersion,
|
||||
apiDetails,
|
||||
logger,
|
||||
);
|
||||
});
|
||||
|
||||
await checkInstallPython311(config.languages, codeql);
|
||||
|
||||
@@ -325,9 +328,6 @@ async function run() {
|
||||
}
|
||||
|
||||
try {
|
||||
// Query CLI for supported features
|
||||
const versionInfo = await codeql.getVersion();
|
||||
|
||||
// Forward Go flags
|
||||
const goFlags = process.env["GOFLAGS"];
|
||||
if (goFlags) {
|
||||
@@ -351,10 +351,9 @@ async function run() {
|
||||
// typically dynamically linked, this provides a suitable entry point for the CodeQL tracer.
|
||||
if (
|
||||
fileOutput.includes("statically linked") &&
|
||||
!isSupportedToolsFeature(
|
||||
versionInfo,
|
||||
!(await codeql.supportsFeature(
|
||||
ToolsFeature.IndirectTracingSupportsStaticBinaries,
|
||||
)
|
||||
))
|
||||
) {
|
||||
try {
|
||||
logger.debug(`Applying static binary workaround for Go`);
|
||||
|
||||
42
src/init.ts
42
src/init.ts
@@ -10,7 +10,6 @@ import * as configUtils from "./config-utils";
|
||||
import { CodeQLDefaultVersionInfo } from "./feature-flags";
|
||||
import { Language, isScannedLanguage } from "./languages";
|
||||
import { Logger } from "./logging";
|
||||
import { RepositoryNwo } from "./repository";
|
||||
import { ToolsSource } from "./setup-codeql";
|
||||
import { TracerConfig, getCombinedTracerConfig } from "./tracer-config";
|
||||
import * as util from "./util";
|
||||
@@ -45,44 +44,11 @@ export async function initCodeQL(
|
||||
}
|
||||
|
||||
export async function initConfig(
|
||||
languagesInput: string | undefined,
|
||||
queriesInput: string | undefined,
|
||||
packsInput: string | undefined,
|
||||
configFile: string | undefined,
|
||||
dbLocation: string | undefined,
|
||||
configInput: string | undefined,
|
||||
trapCachingEnabled: boolean,
|
||||
debugMode: boolean,
|
||||
debugArtifactName: string,
|
||||
debugDatabaseName: string,
|
||||
repository: RepositoryNwo,
|
||||
tempDir: string,
|
||||
codeQL: CodeQL,
|
||||
workspacePath: string,
|
||||
gitHubVersion: util.GitHubVersion,
|
||||
apiDetails: GitHubApiCombinedDetails,
|
||||
logger: Logger,
|
||||
inputs: configUtils.InitConfigInputs,
|
||||
): Promise<configUtils.Config> {
|
||||
const logger = inputs.logger;
|
||||
logger.startGroup("Load language configuration");
|
||||
const config = await configUtils.initConfig(
|
||||
languagesInput,
|
||||
queriesInput,
|
||||
packsInput,
|
||||
configFile,
|
||||
dbLocation,
|
||||
configInput,
|
||||
trapCachingEnabled,
|
||||
debugMode,
|
||||
debugArtifactName,
|
||||
debugDatabaseName,
|
||||
repository,
|
||||
tempDir,
|
||||
codeQL,
|
||||
workspacePath,
|
||||
gitHubVersion,
|
||||
apiDetails,
|
||||
logger,
|
||||
);
|
||||
const config = await configUtils.initConfig(inputs);
|
||||
printPathFiltersWarning(config, logger);
|
||||
logger.endGroup();
|
||||
return config;
|
||||
@@ -124,7 +90,7 @@ export async function runInit(
|
||||
} catch (e) {
|
||||
throw processError(e);
|
||||
}
|
||||
return await getCombinedTracerConfig(await codeql.getVersion(), config);
|
||||
return await getCombinedTracerConfig(codeql, config);
|
||||
}
|
||||
|
||||
export function printPathFiltersWarning(
|
||||
|
||||
@@ -96,7 +96,7 @@ export interface StatusReportBase {
|
||||
/** Action runner hardware architecture (context runner.arch). */
|
||||
runner_arch?: string;
|
||||
/** Available disk space on the runner, in bytes. */
|
||||
runner_available_disk_space_bytes: number;
|
||||
runner_available_disk_space_bytes?: number;
|
||||
/**
|
||||
* Version of the runner image, for workflows running on GitHub-hosted runners. Absent otherwise.
|
||||
*/
|
||||
@@ -106,7 +106,7 @@ export interface StatusReportBase {
|
||||
/** Action runner operating system release (x.y.z from os.release()). */
|
||||
runner_os_release?: string;
|
||||
/** Total disk space on the runner, in bytes. */
|
||||
runner_total_disk_space_bytes: number;
|
||||
runner_total_disk_space_bytes?: number;
|
||||
/** Time the first action started. Normally the init action. */
|
||||
started_at: string;
|
||||
/** State this action is currently in. */
|
||||
@@ -192,7 +192,7 @@ export async function createStatusReportBase(
|
||||
actionName: ActionName,
|
||||
status: ActionStatus,
|
||||
actionStartedAt: Date,
|
||||
diskInfo: DiskUsage,
|
||||
diskInfo: DiskUsage | undefined,
|
||||
cause?: string,
|
||||
exception?: string,
|
||||
): Promise<StatusReportBase> {
|
||||
@@ -230,9 +230,7 @@ export async function createStatusReportBase(
|
||||
job_name: jobName,
|
||||
job_run_uuid: jobRunUUID,
|
||||
ref,
|
||||
runner_available_disk_space_bytes: diskInfo.numAvailableBytes,
|
||||
runner_os: runnerOs,
|
||||
runner_total_disk_space_bytes: diskInfo.numTotalBytes,
|
||||
started_at: workflowStartedAt,
|
||||
status,
|
||||
testing_environment: testingEnvironment,
|
||||
@@ -241,6 +239,11 @@ export async function createStatusReportBase(
|
||||
workflow_run_id: workflowRunID,
|
||||
};
|
||||
|
||||
if (diskInfo) {
|
||||
statusReport.runner_available_disk_space_bytes = diskInfo.numAvailableBytes;
|
||||
statusReport.runner_total_disk_space_bytes = diskInfo.numTotalBytes;
|
||||
}
|
||||
|
||||
// Add optional parameters
|
||||
if (cause) {
|
||||
statusReport.cause = cause;
|
||||
|
||||
@@ -8,14 +8,21 @@ import * as sinon from "sinon";
|
||||
|
||||
import * as apiClient from "./api-client";
|
||||
import { GitHubApiDetails } from "./api-client";
|
||||
import * as CodeQL from "./codeql";
|
||||
import * as codeql from "./codeql";
|
||||
import { Config } from "./config-utils";
|
||||
import {
|
||||
CodeQLDefaultVersionInfo,
|
||||
Feature,
|
||||
FeatureEnablement,
|
||||
} from "./feature-flags";
|
||||
import { Logger } from "./logging";
|
||||
import { HTTPError } from "./util";
|
||||
import {
|
||||
DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
DEFAULT_DEBUG_DATABASE_NAME,
|
||||
GitHubVariant,
|
||||
GitHubVersion,
|
||||
HTTPError,
|
||||
} from "./util";
|
||||
|
||||
export const SAMPLE_DOTCOM_API_DETAILS = {
|
||||
auth: "token",
|
||||
@@ -73,7 +80,7 @@ export function setupTests(test: TestFn<any>) {
|
||||
typedTest.beforeEach((t) => {
|
||||
// Set an empty CodeQL object so that all method calls will fail
|
||||
// unless the test explicitly sets one up.
|
||||
CodeQL.setCodeQL({});
|
||||
codeql.setCodeQL({});
|
||||
|
||||
// Replace stdout and stderr so we can record output during tests
|
||||
t.context.testOutput = "";
|
||||
@@ -214,7 +221,7 @@ export function mockLanguagesInRepo(languages: string[]) {
|
||||
export const makeVersionInfo = (
|
||||
version: string,
|
||||
features?: { [name: string]: boolean },
|
||||
): CodeQL.VersionInfo => ({
|
||||
): codeql.VersionInfo => ({
|
||||
version,
|
||||
features,
|
||||
});
|
||||
@@ -223,11 +230,11 @@ export function mockCodeQLVersion(
|
||||
version: string,
|
||||
features?: { [name: string]: boolean },
|
||||
) {
|
||||
return {
|
||||
return codeql.setCodeQL({
|
||||
async getVersion() {
|
||||
return makeVersionInfo(version, features);
|
||||
},
|
||||
} as CodeQL.CodeQL;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -291,3 +298,30 @@ export function mockBundleDownloadApi({
|
||||
|
||||
return `${baseUrl}${relativeUrl}`;
|
||||
}
|
||||
|
||||
export function createTestConfig(overrides: Partial<Config>): Config {
|
||||
return Object.assign(
|
||||
{},
|
||||
{
|
||||
languages: [],
|
||||
buildMode: undefined,
|
||||
originalUserInput: {},
|
||||
tempDir: "",
|
||||
codeQLCmd: "",
|
||||
gitHubVersion: {
|
||||
type: GitHubVariant.DOTCOM,
|
||||
} as GitHubVersion,
|
||||
dbLocation: "",
|
||||
debugMode: false,
|
||||
debugArtifactName: DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: {
|
||||
packsInputCombines: false,
|
||||
queriesInputCombines: false,
|
||||
},
|
||||
trapCaches: {},
|
||||
trapCacheDownloadTime: 0,
|
||||
},
|
||||
overrides,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { VersionInfo } from "./codeql";
|
||||
import type { VersionInfo } from "./codeql";
|
||||
|
||||
export enum ToolsFeature {
|
||||
BuildModeOption = "buildModeOption",
|
||||
IndirectTracingSupportsStaticBinaries = "indirectTracingSupportsStaticBinaries",
|
||||
SetsCodeqlRunnerEnvVar = "setsCodeqlRunnerEnvVar",
|
||||
}
|
||||
|
||||
@@ -5,27 +5,22 @@ import test from "ava";
|
||||
|
||||
import * as configUtils from "./config-utils";
|
||||
import { Language } from "./languages";
|
||||
import { makeVersionInfo, setupTests } from "./testing-utils";
|
||||
import {
|
||||
createTestConfig,
|
||||
mockCodeQLVersion,
|
||||
setupTests,
|
||||
} from "./testing-utils";
|
||||
import { getCombinedTracerConfig } from "./tracer-config";
|
||||
import * as util from "./util";
|
||||
|
||||
setupTests(test);
|
||||
|
||||
function getTestConfig(tmpDir: string): configUtils.Config {
|
||||
return {
|
||||
function getTestConfig(tempDir: string): configUtils.Config {
|
||||
return createTestConfig({
|
||||
languages: [Language.java],
|
||||
originalUserInput: {},
|
||||
tempDir: tmpDir,
|
||||
codeQLCmd: "",
|
||||
gitHubVersion: { type: util.GitHubVariant.DOTCOM } as util.GitHubVersion,
|
||||
dbLocation: path.resolve(tmpDir, "codeql_databases"),
|
||||
debugMode: false,
|
||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: configUtils.defaultAugmentationProperties,
|
||||
trapCaches: {},
|
||||
trapCacheDownloadTime: 0,
|
||||
};
|
||||
tempDir,
|
||||
dbLocation: path.resolve(tempDir, "codeql_databases"),
|
||||
});
|
||||
}
|
||||
|
||||
test("getCombinedTracerConfig - return undefined when no languages are traced languages", async (t) => {
|
||||
@@ -34,7 +29,7 @@ test("getCombinedTracerConfig - return undefined when no languages are traced la
|
||||
// No traced languages
|
||||
config.languages = [Language.javascript, Language.python];
|
||||
t.deepEqual(
|
||||
await getCombinedTracerConfig(makeVersionInfo("1.0.0"), config),
|
||||
await getCombinedTracerConfig(mockCodeQLVersion("1.0.0"), config),
|
||||
undefined,
|
||||
);
|
||||
});
|
||||
@@ -70,7 +65,7 @@ test("getCombinedTracerConfig - with start-tracing.json environment file", async
|
||||
fs.writeFileSync(startTracingJson, JSON.stringify(startTracingEnv));
|
||||
|
||||
const result = await getCombinedTracerConfig(
|
||||
makeVersionInfo("1.0.0"),
|
||||
mockCodeQLVersion("1.0.0"),
|
||||
config,
|
||||
);
|
||||
t.notDeepEqual(result, undefined);
|
||||
@@ -130,7 +125,7 @@ test("getCombinedTracerConfig - with SetsCodeqlRunnerEnvVar feature enabled in C
|
||||
fs.writeFileSync(startTracingJson, JSON.stringify(startTracingEnv));
|
||||
|
||||
const result = await getCombinedTracerConfig(
|
||||
makeVersionInfo("1.0.0", { setsCodeqlRunnerEnvVar: true }),
|
||||
mockCodeQLVersion("1.0.0", { setsCodeqlRunnerEnvVar: true }),
|
||||
config,
|
||||
);
|
||||
t.notDeepEqual(result, undefined);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
|
||||
import { VersionInfo } from "./codeql";
|
||||
import { CodeQL } from "./codeql";
|
||||
import * as configUtils from "./config-utils";
|
||||
import { isTracedLanguage } from "./languages";
|
||||
import { ToolsFeature, isSupportedToolsFeature } from "./tools-features";
|
||||
import { ToolsFeature } from "./tools-features";
|
||||
|
||||
export type TracerConfig = {
|
||||
env: { [key: string]: string };
|
||||
@@ -61,7 +61,7 @@ export async function getTracerConfigForCluster(
|
||||
}
|
||||
|
||||
export async function getCombinedTracerConfig(
|
||||
versionInfo: VersionInfo,
|
||||
codeql: CodeQL,
|
||||
config: configUtils.Config,
|
||||
): Promise<TracerConfig | undefined> {
|
||||
// Abort if there are no traced languages as there's nothing to do
|
||||
@@ -74,9 +74,7 @@ export async function getCombinedTracerConfig(
|
||||
|
||||
// If the CLI doesn't yet support setting the CODEQL_RUNNER environment variable to
|
||||
// the runner executable path, we set it here in the Action.
|
||||
if (
|
||||
!isSupportedToolsFeature(versionInfo, ToolsFeature.SetsCodeqlRunnerEnvVar)
|
||||
) {
|
||||
if (!(await codeql.supportsFeature(ToolsFeature.SetsCodeqlRunnerEnvVar))) {
|
||||
// On MacOS when System Integrity Protection is enabled, it's necessary to prefix
|
||||
// the build command with the runner executable for indirect tracing, so we expose
|
||||
// it here via the CODEQL_RUNNER environment variable.
|
||||
|
||||
@@ -12,9 +12,9 @@ import {
|
||||
getTrapCachingExtractorConfigArgsForLang,
|
||||
} from "./codeql";
|
||||
import * as configUtils from "./config-utils";
|
||||
import { Config } from "./config-utils";
|
||||
import { Language } from "./languages";
|
||||
import {
|
||||
createTestConfig,
|
||||
getRecordingLogger,
|
||||
makeVersionInfo,
|
||||
setupTests,
|
||||
@@ -69,49 +69,23 @@ const stubCodeql = setCodeQL({
|
||||
},
|
||||
});
|
||||
|
||||
const testConfigWithoutTmpDir: Config = {
|
||||
const testConfigWithoutTmpDir = createTestConfig({
|
||||
languages: [Language.javascript, Language.cpp],
|
||||
originalUserInput: {},
|
||||
tempDir: "",
|
||||
codeQLCmd: "",
|
||||
gitHubVersion: {
|
||||
type: util.GitHubVariant.DOTCOM,
|
||||
} as util.GitHubVersion,
|
||||
dbLocation: "",
|
||||
debugMode: false,
|
||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: {
|
||||
packsInputCombines: false,
|
||||
queriesInputCombines: false,
|
||||
},
|
||||
trapCaches: {
|
||||
javascript: "/some/cache/dir",
|
||||
},
|
||||
trapCacheDownloadTime: 0,
|
||||
};
|
||||
});
|
||||
|
||||
function getTestConfigWithTempDir(tmpDir: string): configUtils.Config {
|
||||
return {
|
||||
function getTestConfigWithTempDir(tempDir: string): configUtils.Config {
|
||||
return createTestConfig({
|
||||
languages: [Language.javascript, Language.ruby],
|
||||
originalUserInput: {},
|
||||
tempDir: tmpDir,
|
||||
codeQLCmd: "",
|
||||
gitHubVersion: { type: util.GitHubVariant.DOTCOM } as util.GitHubVersion,
|
||||
dbLocation: path.resolve(tmpDir, "codeql_databases"),
|
||||
debugMode: false,
|
||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: {
|
||||
packsInputCombines: false,
|
||||
queriesInputCombines: false,
|
||||
},
|
||||
tempDir,
|
||||
dbLocation: path.resolve(tempDir, "codeql_databases"),
|
||||
trapCaches: {
|
||||
javascript: path.resolve(tmpDir, "jsCache"),
|
||||
ruby: path.resolve(tmpDir, "rubyCache"),
|
||||
javascript: path.resolve(tempDir, "jsCache"),
|
||||
ruby: path.resolve(tempDir, "rubyCache"),
|
||||
},
|
||||
trapCacheDownloadTime: 0,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
test("check flags for JS, analyzing default branch", async (t) => {
|
||||
|
||||
47
src/util.ts
47
src/util.ts
@@ -1011,26 +1011,37 @@ export interface DiskUsage {
|
||||
numTotalBytes: number;
|
||||
}
|
||||
|
||||
export async function checkDiskUsage(logger?: Logger): Promise<DiskUsage> {
|
||||
const diskUsage = await checkDiskSpace(
|
||||
getRequiredEnvParam("GITHUB_WORKSPACE"),
|
||||
);
|
||||
const gbInBytes = 1024 * 1024 * 1024;
|
||||
if (logger && diskUsage.free < 2 * gbInBytes) {
|
||||
const message =
|
||||
"The Actions runner is running low on disk space " +
|
||||
`(${(diskUsage.free / gbInBytes).toPrecision(4)} GB available).`;
|
||||
if (process.env[EnvVar.HAS_WARNED_ABOUT_DISK_SPACE] !== "true") {
|
||||
logger.warning(message);
|
||||
} else {
|
||||
logger.debug(message);
|
||||
export async function checkDiskUsage(
|
||||
logger?: Logger,
|
||||
): Promise<DiskUsage | undefined> {
|
||||
try {
|
||||
const diskUsage = await checkDiskSpace(
|
||||
getRequiredEnvParam("GITHUB_WORKSPACE"),
|
||||
);
|
||||
const gbInBytes = 1024 * 1024 * 1024;
|
||||
if (logger && diskUsage.free < 2 * gbInBytes) {
|
||||
const message =
|
||||
"The Actions runner is running low on disk space " +
|
||||
`(${(diskUsage.free / gbInBytes).toPrecision(4)} GB available).`;
|
||||
if (process.env[EnvVar.HAS_WARNED_ABOUT_DISK_SPACE] !== "true") {
|
||||
logger.warning(message);
|
||||
} else {
|
||||
logger.debug(message);
|
||||
}
|
||||
core.exportVariable(EnvVar.HAS_WARNED_ABOUT_DISK_SPACE, "true");
|
||||
}
|
||||
core.exportVariable(EnvVar.HAS_WARNED_ABOUT_DISK_SPACE, "true");
|
||||
return {
|
||||
numAvailableBytes: diskUsage.free,
|
||||
numTotalBytes: diskUsage.size,
|
||||
};
|
||||
} catch (error) {
|
||||
if (logger) {
|
||||
logger.warning(
|
||||
`Failed to check available disk space: ${getErrorMessage(error)}`,
|
||||
);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
numAvailableBytes: diskUsage.free,
|
||||
numTotalBytes: diskUsage.size,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,10 +14,10 @@ inputs:
|
||||
required: false
|
||||
default: ${{ github.workspace }}
|
||||
ref:
|
||||
description: "The ref where results will be uploaded. If not provided, the Action will use the GITHUB_REF environment variable. If provided, the sha input must be provided as well. This input is not available in pull requests from forks."
|
||||
description: "The ref where results will be uploaded. If not provided, the Action will use the GITHUB_REF environment variable. If provided, the sha input must be provided as well. This input is ignored for pull requests from forks."
|
||||
required: false
|
||||
sha:
|
||||
description: "The sha of the HEAD of the ref where results will be uploaded. If not provided, the Action will use the GITHUB_SHA environment variable. If provided, the ref input must be provided as well. This input is not available in pull requests from forks."
|
||||
description: "The sha of the HEAD of the ref where results will be uploaded. If not provided, the Action will use the GITHUB_SHA environment variable. If provided, the ref input must be provided as well. This input is ignored for pull requests from forks."
|
||||
required: false
|
||||
token:
|
||||
default: ${{ github.token }}
|
||||
|
||||
Reference in New Issue
Block a user