Skip to content

Commit 8266293

Browse files
authored
Merge pull request puppetlabs#3294 from donoghuc/disable-analytics
(maint) Turn off analytics submissions
2 parents 4b30c39 + fbb2c52 commit 8266293

File tree

8 files changed

+22
-18
lines changed

8 files changed

+22
-18
lines changed

.github/actions/docker_setup/action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ runs:
66
- name: Bring up containers
77
shell: bash
88
run: |
9+
sudo apt install docker-compose
910
docker-compose -f spec/docker-compose.yml build --parallel
1011
docker-compose -f spec/docker-compose.yml up -d

.github/actions/sudo_setup/action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ runs:
66
- name: Bring up containers
77
shell: bash
88
run: |
9+
sudo apt install docker-compose
910
docker-compose -f spec/docker-compose.yml build --parallel
1011
docker-compose -f spec/docker-compose.yml up -d
1112
- name: Create non-sudo user

.github/workflows/docs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ jobs:
3535
- name: Run DITA
3636
uses: dita-ot/dita-ot-action@master
3737
with:
38+
dita-ot-version: 4.1.2
3839
build: dita -i documentation/bolt.ditamap -o out -f html5 --processing-mode=strict

documentation/analytics.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Analytics
22

33
Bolt collects data about how you use it to help the Bolt team make decisions
4-
about how to improve it. You can opt out of providing this data.
4+
about how to improve it. You can opt out of providing this data. Analytics is
5+
disabled by default.
56

67
## Opt out of data collection
78

@@ -12,7 +13,7 @@ or by setting an environment variable.
1213

1314
To disable data collection, set `analytics: false` in your [configuration
1415
file](configuring_bolt.md). This option is supported in the system-wide,
15-
user-level, and project configuration files.
16+
user-level, and project configuration files. `false` is the default value.
1617

1718
```yaml
1819
# bolt-defaults.yaml

documentation/bolt_installing.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Installing Bolt
22

3-
> Bolt automatically collects data about how you use it. If you want to opt
4-
> out of providing this data, you can do so. For more information, see
5-
> [Opt out of data collection](analytics.md#opt-out-of-data-collection).
6-
73
Packaged versions of Bolt are available for several Linux distributions, macOS,
84
and Microsoft Windows.
95

lib/bolt/config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def initialize(project, config_data, overrides = {})
169169
@config_files = []
170170

171171
default_data = {
172-
'analytics' => true,
172+
'analytics' => false,
173173
'apply-settings' => {},
174174
'color' => true,
175175
'compile-concurrency' => Etc.nprocessors,

lib/bolt/shell/powershell/snippets.rb

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,25 @@ def run_script(arguments, script_path)
5555
}
5656
#{build_arg_list}
5757
58-
switch -regex ( Get-ExecutionPolicy )
58+
try
5959
{
60-
'^AllSigned'
60+
switch -regex ( Get-ExecutionPolicy )
6161
{
62-
if ((Get-AuthenticodeSignature -File "#{script_path}").Status -ne 'Valid') {
63-
$Host.UI.WriteErrorLine("Error: Target host Powershell ExecutionPolicy is set to ${_} and script '#{script_path}' does not contain a valid signature.")
62+
'^AllSigned'
63+
{
64+
if ((Get-AuthenticodeSignature -File "#{script_path}").Status -ne 'Valid') {
65+
$Host.UI.WriteErrorLine("Error: Target host Powershell ExecutionPolicy is set to ${_} and script '#{script_path}' does not contain a valid signature.")
66+
exit 1;
67+
}
68+
}
69+
'^Restricted'
70+
{
71+
$Host.UI.WriteErrorLine("Error: Target host Powershell ExecutionPolicy is set to ${_} which denies running any scripts on the target.")
6472
exit 1;
6573
}
6674
}
67-
'^Restricted'
68-
{
69-
$Host.UI.WriteErrorLine("Error: Target host Powershell ExecutionPolicy is set to ${_} which denies running any scripts on the target.")
70-
exit 1;
71-
}
7275
}
76+
catch {}
7377
7478
if([string]::IsNullOrEmpty($invokeArgs.ScriptBlock)){
7579
$Host.UI.WriteErrorLine("Error: Failed to obtain scriptblock from '#{script_path}'. Running scripts might be disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170");

spec/unit/config_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@
377377
end
378378

379379
context 'analytics' do
380-
it 'defaults to enabled' do
381-
expect(config.analytics).to eq(true)
380+
it 'defaults to disabled' do
381+
expect(config.analytics).to eq(false)
382382
end
383383

384384
it 'overrides a true value with false' do

0 commit comments

Comments
 (0)