Skip to content

Commit b75c9f7

Browse files
authored
Makes telemetry enabled by default (#936)
1 parent b6efcf5 commit b75c9f7

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

Changelog.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# FOSSA CLI Changelog
22

3+
## v3.3.0
4+
- Telemetry: CLI collects telemetry by default. ([#936](https://github.com/fossas/fossa-cli/pull/936))
5+
6+
Read more about telemetry: https://github.com/fossas/fossa-cli/blob/master/docs/telemetry.md. To opt-out of telemetry, provide `FOSSA_TELEMETRY_SCOPE` environment variable with value of: `off` in your shell prior to running fossa.
7+
38
## v3.2.17
49
- Archive upload: Fix a bug when trying to tar to a filename that already exists. ([#927](https://github.com/fossas/fossa-cli/pull/927))
510
- Npm: Supports lockfile v3. ([#932](https://github.com/fossas/fossa-cli/pull/932))

install-latest.ps1

+4-5
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,18 @@ Write-Host "Notice"
8383
Write-Host "------"
8484
Write-Host ""
8585
Write-Host "FOSSA collects warnings, errors, and usage data to improve"
86-
Write-Host "the FOSSA CLI and your experience. The CLI DOES NOT collect"
87-
Write-Host "telemetry by default, but this will change in future!"
86+
Write-Host "the FOSSA CLI and your experience."
87+
Write-Host ""
88+
Write-Host "Read more: https://github.com/fossas/fossa-cli/blob/master/docs/telemetry.md"
8889
Write-Host ""
8990
Write-Host "If you want to prevent any telemetry data from being sent to"
90-
Write-Host "the server when a future version of fossa-cli enables telemetry"
91-
Write-Host "by default, you can pre-emptively opt out of telemetry by setting"
91+
Write-Host "the server, you can opt out of telemetry by setting"
9292
Write-Host "FOSSA_TELEMETRY_SCOPE environment variable to 'off' in your shell."
9393
Write-Host ""
9494
Write-Host "For example:"
9595
Write-Host " `$env:FOSSA_TELEMETRY_SCOPE=off"
9696
Write-Host " fossa analyze"
9797
Write-Host ""
98-
Write-Host "Read more: https://github.com/fossas/fossa-cli/blob/master/docs/telemetry.md"
9998
Write-Host ""
10099
Write-Host "Get started by running: fossa.exe --help"
101100
Write-Host "Running fossa.exe --version"

install-latest.sh

+4-5
Original file line numberDiff line numberDiff line change
@@ -382,18 +382,17 @@ print_telemetry_disclaimer() {
382382
log_info "------"
383383
log_info ""
384384
log_info "FOSSA collects warnings, errors, and usage data to improve"
385-
log_info "the FOSSA CLI and your experience. The CLI DOES NOT collect"
386-
log_info "telemetry by default, but this will change in future!"
385+
log_info "the FOSSA CLI and your experience."
386+
log_info ""
387+
log_info "Read more: https://github.com/fossas/fossa-cli/blob/master/docs/telemetry.md"
387388
log_info ""
388389
log_info "If you want to prevent any telemetry data from being sent to"
389-
log_info "the server when a future version of fossa-cli enables telemetry"
390-
log_info "by default, you can pre-emptively opt out of telemetry by setting"
390+
log_info "the server, you can opt out of telemetry by setting"
391391
log_info "FOSSA_TELEMETRY_SCOPE environment variable to 'off' in your shell."
392392
log_info ""
393393
log_info "For example:"
394394
log_info " FOSSA_TELEMETRY_SCOPE=off fossa analyze"
395395
log_info ""
396-
log_info "Read more: https://github.com/fossas/fossa-cli/blob/master/docs/telemetry.md"
397396
log_info ""
398397
}
399398

src/App/Fossa/Config/Common.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ collectAPIMetadata cfgfile cliMeta = maybe cliMeta (mergeFileCmdMetadata cliMeta
272272

273273
collectTelemetrySink :: (Has (Lift IO) sig m, Has Diagnostics sig m) => Maybe ConfigFile -> EnvVars -> Maybe CommonOpts -> m (Maybe TelemetrySink)
274274
collectTelemetrySink maybeConfigFile envvars maybeOpts = do
275-
let defaultScope = NoTelemetry
275+
let defaultScope = FullTelemetry
276276
-- Precedence is
277277
-- (1) command line
278278
-- (2) environment variable

test/App/Fossa/Configuration/TelemetryConfigSpec.hs

+5-1
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,14 @@ spec :: Spec
7878
spec = do
7979
describe "telemetry configuration" $ do
8080
-- This needs to be updated when default telemetry model moves to opt-out.
81-
it' "by default telemetry sink is nothing" $ do
81+
it' "by default telemetry sink set to nothing, if api key is not provided" $ do
8282
sink <- collectTelemetrySink noConfig defaultEnvVars noOpts
8383
sink `shouldBe'` Nothing
8484

85+
it' "by default telemetry sink set to full telemetry" $ do
86+
sink <- collectTelemetrySink noConfig defaultEnvVars (Just defaultCommonOpts{optAPIKey = Just mockApiKeyRaw})
87+
sink `shouldBe'` Just (TelemetrySinkToEndpoint (ApiOpts Nothing mockApiKey defaultApiPollDelay))
88+
8589
describe "command opts" $ do
8690
it' "should set sink to nothing, when off scope is provided via command opts" $ do
8791
sink <-

0 commit comments

Comments
 (0)