Skip to content

Commit

Permalink
fix: changing disable crash report variable name
Browse files Browse the repository at this point in the history
Signed-off-by: Rogério Peixoto <[email protected]>
  • Loading branch information
rogeriopeixotocx committed Jul 17, 2021
1 parent 1921aa2 commit 4bee853
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/go-ci-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ jobs:
- name: Run docker image and generate results.json
run: |
docker run -v ${PWD}/assets/queries:/path \
kics:${{ github.sha }} scan --silent --ignore-on-exit "results" --log-level DEBUG --log-file --log-path "/path/info.log" -p "/path" -o "/path/"
kics:${{ github.sha }} scan \
--silent \
--ignore-on-exit "results" \
--log-level DEBUG \
--log-path "/path/info.log" \
-p "/path" \
-o "/path/"
- name: Archive test logs
uses: actions/upload-artifact@v2
if: always()
Expand Down
8 changes: 4 additions & 4 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ You can only enable one profiler at a time, CPU or MEM.

📝 Please note that execution time may be impacted by enabling performance profiler due to sampling

## Disable Telemetry
## Disable Crash Report

You can disable KICS telemetry with `KICS_COLLECT_TELEMETRY` environment variable set to `0` or `false` e.g:
You can disable KICS crash report to [sentry.io](https://sentry.io) with `DISABLE_CRASH_REPORT` environment variable set to `0` or `false` e.g:

```sh
KICS_COLLECT_TELEMETRY=0 ./bin/kics version
# 'KICS telemetry disabled' message should appear in the logs
DISABLE_CRASH_REPORT=0 ./bin/kics version
# 'KICS crash report disabled' message should appear in the logs
```
10 changes: 5 additions & 5 deletions internal/console/kics.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func initialize(rootCmd *cobra.Command) error {
func Execute() error {
zerolog.SetGlobalLevel(zerolog.InfoLevel)

enableTelemetry()
enableCrashReport()

rootCmd := NewKICSCmd()

Expand All @@ -128,9 +128,9 @@ func Execute() error {
return nil
}

func enableTelemetry() {
enableTelemetry, found := os.LookupEnv("KICS_COLLECT_TELEMETRY")
if found && (enableTelemetry == "0" || enableTelemetry == "false") {
func enableCrashReport() {
enableCrashReport, found := os.LookupEnv("DISABLE_CRASH_REPORT")
if found && (enableCrashReport == "0" || enableCrashReport == "false") {
initSentry("")
} else {
initSentry(constants.SentryDSN)
Expand All @@ -140,7 +140,7 @@ func enableTelemetry() {
func initSentry(dsn string) {
var err error
if dsn == "" {
warnings = append(warnings, "KICS telemetry disabled")
warnings = append(warnings, "KICS crash report disabled")
err = sentry.Init(sentry.ClientOptions{
Release: constants.GetRelease(),
})
Expand Down
2 changes: 1 addition & 1 deletion internal/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const (
// MaxInteger - max possible integer in golang
MaxInteger = math.MaxInt64

// SentryRefreshRate - sentry telemetry refresh rate
// SentryRefreshRate - sentry crash report refresh rate
SentryRefreshRate = 2
)

Expand Down

0 comments on commit 4bee853

Please sign in to comment.