Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incompatibility between direct tracing in the autobuild Action and specifying a custom working directory #2328

Merged
merged 8 commits into from
Jun 13, 2024
1 change: 0 additions & 1 deletion .github/actions/query-filter-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ runs:
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
upload-database: false
upload: never
env:
CODEQL_ACTION_TEST_MODE: "true"
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/__all-platform-bundle.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .github/workflows/__analyze-ref-input.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .github/workflows/__autobuild-action.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .github/workflows/__go-custom-queries.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .github/workflows/__go-indirect-tracing-workaround.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .github/workflows/__go-tracing-autobuilder.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .github/workflows/__go-tracing-custom-build-steps.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .github/workflows/__go-tracing-legacy-workflow.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .github/workflows/__javascript-source-root.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .github/workflows/__test-autobuild-working-dir.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .github/workflows/__test-local-codeql.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .github/workflows/__test-proxy.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .github/workflows/__upload-ref-sha-input.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .github/workflows/__with-checkout-path.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .github/workflows/expected-queries-runs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ jobs:
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
upload-database: false
upload: never

- name: Check Sarif
uses: ./../action/.github/actions/check-sarif
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/python312-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:

jobs:
test-setup-python-scripts:
env:
CODEQL_ACTION_TEST_MODE: true
timeout-minutes: 45
runs-on: windows-latest

Expand All @@ -37,6 +39,3 @@ jobs:

- name: Analyze
uses: ./../action/analyze
with:
upload: false
upload-database: false
2 changes: 0 additions & 2 deletions .github/workflows/test-codeql-bundle-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,5 @@ jobs:
shell: bash
run: ./build.sh
- uses: ./../action/analyze
with:
upload-database: false
env:
CODEQL_ACTION_TEST_MODE: true
4 changes: 4 additions & 0 deletions lib/database-upload.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/database-upload.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pr-checks/checks/all-platform-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ steps:
shell: bash
run: ./build.sh
- uses: ./../action/analyze
with:
upload-database: false
1 change: 0 additions & 1 deletion pr-checks/checks/analyze-ref-input.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ steps:
run: ./build.sh
- uses: ./../action/analyze
with:
upload-database: false
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
2 changes: 0 additions & 2 deletions pr-checks/checks/autobuild-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ steps:
CORECLR_PROFILER: ""
CORECLR_PROFILER_PATH_64: ""
- uses: ./../action/analyze
with:
upload-database: false
- name: Check database
shell: bash
run: |
Expand Down
2 changes: 0 additions & 2 deletions pr-checks/checks/go-custom-queries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ steps:
shell: bash
run: ./build.sh
- uses: ./../action/analyze
with:
upload-database: false
2 changes: 0 additions & 2 deletions pr-checks/checks/go-indirect-tracing-workaround.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ steps:
shell: bash
run: go build main.go
- uses: ./../action/analyze
with:
upload-database: false
- shell: bash
run: |
if [[ -z "${CODEQL_ACTION_GO_BINARY}" ]]; then
Expand Down
2 changes: 0 additions & 2 deletions pr-checks/checks/go-tracing-autobuilder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ steps:
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/autobuild
- uses: ./../action/analyze
with:
upload-database: false
- shell: bash
run: |
if [[ "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" != true ]]; then
Expand Down
2 changes: 0 additions & 2 deletions pr-checks/checks/go-tracing-custom-build-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ steps:
shell: bash
run: go build main.go
- uses: ./../action/analyze
with:
upload-database: false
- shell: bash
run: |
# Once we start running Bash 4.2 in all environments, we can replace the
Expand Down
2 changes: 0 additions & 2 deletions pr-checks/checks/go-tracing-legacy-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ steps:
languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:
upload-database: false
- shell: bash
run: |
cd "$RUNNER_TEMP/codeql_databases"
Expand Down
2 changes: 0 additions & 2 deletions pr-checks/checks/javascript-source-root.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ steps:
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:
upload-database: false
skip-queries: true
upload: never
- name: Assert database exists
shell: bash
run: |
Expand Down
2 changes: 0 additions & 2 deletions pr-checks/checks/test-autobuild-working-dir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ steps:
with:
working-directory: autobuild-dir
- uses: ./../action/analyze
with:
upload-database: false
- name: Check database
shell: bash
run: |
Expand Down
2 changes: 0 additions & 2 deletions pr-checks/checks/test-local-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ steps:
shell: bash
run: ./build.sh
- uses: ./../action/analyze
with:
upload-database: false
2 changes: 0 additions & 2 deletions pr-checks/checks/test-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ steps:
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:
upload-database: false
2 changes: 0 additions & 2 deletions pr-checks/checks/upload-ref-sha-input.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ steps:
run: ./build.sh
- uses: ./../action/analyze
with:
upload-database: false
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
upload: never
- uses: ./../action/upload-sarif
with:
ref: 'refs/heads/main'
Expand Down
2 changes: 0 additions & 2 deletions pr-checks/checks/with-checkout-path.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ steps:
checkout_path: x/y/z/some-path/tests/multi-language-repo
ref: v1.1.0
sha: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6
upload: never
upload-database: false

- uses: ./../action/upload-sarif
with:
Expand Down
5 changes: 5 additions & 0 deletions src/database-upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export async function uploadDatabases(
return;
}

if (util.isInTestMode()) {
logger.debug("In test mode. Skipping database upload.");
return;
}
henrymercer marked this conversation as resolved.
Show resolved Hide resolved

// Do nothing when not running against github.com
if (
config.gitHubVersion.type !== util.GitHubVariant.DOTCOM &&
Expand Down
Loading