-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(telemetry): opt-out telemetry and fixing sentry dsn provisioning (…
…#3056) closes #3041 Signed-off-by: Rogério Peixoto <[email protected]>
- Loading branch information
1 parent
6fae892
commit 429f218
Showing
20 changed files
with
220 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,82 +9,83 @@ jobs: | |
name: integration-tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@master | ||
- name: Cache Docker layers | ||
uses: actions/[email protected] | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.ref }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx-${{ github.ref }} | ||
- name: Get short SHA | ||
run: echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-8)" >> $GITHUB_ENV | ||
- name: Build | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
load: true | ||
context: ./ | ||
file: ./Dockerfile | ||
builder: ${{ steps.buildx.outputs.name }} | ||
push: false | ||
tags: kics:${{ github.sha }} | ||
build-args: | | ||
VERSION=${GITHUB_SHA_SHORT} | ||
COMMIT=${GITHUB_SHA} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} | ||
- name: Run docker image and generate results.json | ||
run: | | ||
docker run -v ${PWD}/assets/queries:/path \ | ||
-e SENTRY_DSN=${{secrets.SENTRY_DSN}} \ | ||
kics:${{ github.sha }} scan --silent --ignore-on-exit "results" --log-level DEBUG --log-file --log-path "/path/info.log" -p "/path" -o "/path/results.json" | ||
- name: Archive test logs | ||
uses: actions/upload-artifact@v2 | ||
if: always() | ||
with: | ||
name: integration-logs-${{ github.event.pull_request.head.sha }} | ||
path: assets/queries/info.log | ||
- name: Display results | ||
run: | | ||
cat ${PWD}/assets/queries/results.json | ||
- name: Archive test results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: integration-results-${{ github.event.pull_request.head.sha }} | ||
path: assets/queries/results.json | ||
- name: Assert results.json | ||
run: | | ||
set -eo pipefail | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@master | ||
- name: Cache Docker layers | ||
uses: actions/[email protected] | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.ref }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx-${{ github.ref }} | ||
- name: Get short SHA | ||
run: echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-8)" >> $GITHUB_ENV | ||
- name: Build | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
load: true | ||
context: ./ | ||
file: ./Dockerfile | ||
builder: ${{ steps.buildx.outputs.name }} | ||
push: false | ||
tags: kics:${{ github.sha }} | ||
build-args: | | ||
VERSION=${GITHUB_SHA_SHORT} | ||
COMMIT=${GITHUB_SHA} | ||
SENTRY_DSN=${{ secrets.SENTRY_DSN }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} | ||
- name: Run docker image and generate results.json | ||
run: | | ||
docker run -v ${PWD}/assets/queries:/path \ | ||
-e SENTRY_DSN=${{secrets.SENTRY_DSN}} \ | ||
kics:${{ github.sha }} scan --silent --ignore-on-exit "results" --log-level DEBUG --log-file --log-path "/path/info.log" -p "/path" -o "/path/results.json" | ||
- name: Archive test logs | ||
uses: actions/upload-artifact@v2 | ||
if: always() | ||
with: | ||
name: integration-logs-${{ github.event.pull_request.head.sha }} | ||
path: assets/queries/info.log | ||
- name: Display results | ||
run: | | ||
cat ${PWD}/assets/queries/results.json | ||
- name: Archive test results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: integration-results-${{ github.event.pull_request.head.sha }} | ||
path: assets/queries/results.json | ||
- name: Assert results.json | ||
run: | | ||
set -eo pipefail | ||
COUNT=$(jq '.queries_total' ${PWD}/assets/queries/results.json) | ||
echo "Assert queries_total > 0 in results.json :: ${COUNT}" | ||
echo $COUNT | xargs -i{} test {} -gt 0 | ||
COUNT=$(jq '.queries_total' ${PWD}/assets/queries/results.json) | ||
echo "Assert queries_total > 0 in results.json :: ${COUNT}" | ||
echo $COUNT | xargs -i{} test {} -gt 0 | ||
COUNT=$(jq '.total_counter' ${PWD}/assets/queries/results.json) | ||
echo "Assert total_counter > 0 in results.json :: ${COUNT}" | ||
echo $COUNT | xargs -i{} test {} -gt 0 | ||
COUNT=$(jq '.total_counter' ${PWD}/assets/queries/results.json) | ||
echo "Assert total_counter > 0 in results.json :: ${COUNT}" | ||
echo $COUNT | xargs -i{} test {} -gt 0 | ||
COUNT=$(jq '.files_scanned' ${PWD}/assets/queries/results.json) | ||
echo "Assert files_scanned > 0 in results.json :: ${COUNT}" | ||
echo $COUNT | xargs -i{} test {} -gt 0 | ||
COUNT=$(jq '.files_scanned' ${PWD}/assets/queries/results.json) | ||
echo "Assert files_scanned > 0 in results.json :: ${COUNT}" | ||
echo $COUNT | xargs -i{} test {} -gt 0 | ||
COUNT=$(jq '.queries_failed_to_execute' ${PWD}/assets/queries/results.json) | ||
echo "Assert queries_failed_to_execute == 0 in results.json :: ${COUNT}" | ||
echo $COUNT | xargs -i{} test {} -eq 0 | ||
COUNT=$(jq '.queries_failed_to_execute' ${PWD}/assets/queries/results.json) | ||
echo "Assert queries_failed_to_execute == 0 in results.json :: ${COUNT}" | ||
echo $COUNT | xargs -i{} test {} -eq 0 | ||
COUNT=$(jq '.files_failed_to_scan' ${PWD}/assets/queries/results.json) | ||
echo "Assert files_failed_to_scan == 0 in results.json :: ${COUNT}" | ||
echo $COUNT | xargs -i{} test {} -eq 0 | ||
COUNT=$(jq '.files_failed_to_scan' ${PWD}/assets/queries/results.json) | ||
echo "Assert files_failed_to_scan == 0 in results.json :: ${COUNT}" | ||
echo $COUNT | xargs -i{} test {} -eq 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,7 @@ jobs: | |
args: release --rm-dist --snapshot --skip-validate --config="./.goreleaser-nightly.yml" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | ||
- name: delete release | ||
uses: dev-drprasad/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.