From b2018dff05b10c29a380bf71606830d6339c47b7 Mon Sep 17 00:00:00 2001 From: donoghuc Date: Tue, 2 Apr 2024 14:30:58 -0700 Subject: [PATCH 1/4] (maint) Turn off analytics submissions Collecting analytics is now turned off by default. !removal * **Stop collecting bolt analytics** ([#3293](#3293)) Bolt no longer collects analytics by default. --- documentation/analytics.md | 5 +++-- documentation/bolt_installing.md | 4 ---- lib/bolt/config.rb | 2 +- spec/unit/config_spec.rb | 4 ++-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/documentation/analytics.md b/documentation/analytics.md index a288ce2a1e..f45ff1d998 100644 --- a/documentation/analytics.md +++ b/documentation/analytics.md @@ -1,7 +1,8 @@ # Analytics Bolt collects data about how you use it to help the Bolt team make decisions -about how to improve it. You can opt out of providing this data. +about how to improve it. You can opt out of providing this data. Analytics is +disabled by default. ## Opt out of data collection @@ -12,7 +13,7 @@ or by setting an environment variable. To disable data collection, set `analytics: false` in your [configuration file](configuring_bolt.md). This option is supported in the system-wide, -user-level, and project configuration files. +user-level, and project configuration files. `false` is the default value. ```yaml # bolt-defaults.yaml diff --git a/documentation/bolt_installing.md b/documentation/bolt_installing.md index 1f98912f5e..516b55d0b4 100644 --- a/documentation/bolt_installing.md +++ b/documentation/bolt_installing.md @@ -1,9 +1,5 @@ # Installing Bolt -> Bolt automatically collects data about how you use it. If you want to opt -> out of providing this data, you can do so. For more information, see -> [Opt out of data collection](analytics.md#opt-out-of-data-collection). - Packaged versions of Bolt are available for several Linux distributions, macOS, and Microsoft Windows. diff --git a/lib/bolt/config.rb b/lib/bolt/config.rb index 385708c335..05d0964a75 100644 --- a/lib/bolt/config.rb +++ b/lib/bolt/config.rb @@ -169,7 +169,7 @@ def initialize(project, config_data, overrides = {}) @config_files = [] default_data = { - 'analytics' => true, + 'analytics' => false, 'apply-settings' => {}, 'color' => true, 'compile-concurrency' => Etc.nprocessors, diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb index eb1f4a8b08..c9b8fc99b3 100644 --- a/spec/unit/config_spec.rb +++ b/spec/unit/config_spec.rb @@ -377,8 +377,8 @@ end context 'analytics' do - it 'defaults to enabled' do - expect(config.analytics).to eq(true) + it 'defaults to disabled' do + expect(config.analytics).to eq(false) end it 'overrides a true value with false' do From 665d0902e20a347cf03eb1a82e40eb15f44e66ce Mon Sep 17 00:00:00 2001 From: donoghuc Date: Tue, 2 Apr 2024 15:42:18 -0700 Subject: [PATCH 2/4] (maint) Ensure docker-compose is installed on test runners Docker-compose does not appear to be installed on ubuntu-latest runners. Ensure it is installed before bringing up test cluster. --- .github/actions/docker_setup/action.yaml | 1 + .github/actions/sudo_setup/action.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/actions/docker_setup/action.yaml b/.github/actions/docker_setup/action.yaml index 7001b06127..fd36aa3107 100644 --- a/.github/actions/docker_setup/action.yaml +++ b/.github/actions/docker_setup/action.yaml @@ -6,5 +6,6 @@ runs: - name: Bring up containers shell: bash run: | + sudo apt install docker-compose docker-compose -f spec/docker-compose.yml build --parallel docker-compose -f spec/docker-compose.yml up -d diff --git a/.github/actions/sudo_setup/action.yaml b/.github/actions/sudo_setup/action.yaml index 5723fd8190..b520e82004 100644 --- a/.github/actions/sudo_setup/action.yaml +++ b/.github/actions/sudo_setup/action.yaml @@ -6,6 +6,7 @@ runs: - name: Bring up containers shell: bash run: | + sudo apt install docker-compose docker-compose -f spec/docker-compose.yml build --parallel docker-compose -f spec/docker-compose.yml up -d - name: Create non-sudo user From 19ee965f64de576ce98aea56aef55efe57061299 Mon Sep 17 00:00:00 2001 From: donoghuc Date: Tue, 2 Apr 2024 15:52:25 -0700 Subject: [PATCH 3/4] (maint) Pin back dita-ot image This is the last release that passes for building bolt docs. Pin to that version while we evaluate how to remain compatible with latest. --- .github/workflows/docs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 3c08a4c4b7..7265cec901 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -35,4 +35,5 @@ jobs: - name: Run DITA uses: dita-ot/dita-ot-action@master with: + dita-ot-version: 4.1.2 build: dita -i documentation/bolt.ditamap -o out -f html5 --processing-mode=strict From fbb2c52b9ac1562c064145ff63be366f49586deb Mon Sep 17 00:00:00 2001 From: donoghuc Date: Wed, 3 Apr 2024 09:06:25 -0700 Subject: [PATCH 4/4] (maint) Do not error when Execution Policy cannot be determined We attempt to compute Execution Policy in order to provide a nice error message for some cases. We are seeing failures in some cases to compute this value. In the case the execution policy cannot be determined we still want to be able to attempt to run the action. This commit handles errors when execution policy cannot be determined. --- lib/bolt/shell/powershell/snippets.rb | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/bolt/shell/powershell/snippets.rb b/lib/bolt/shell/powershell/snippets.rb index 6cd35e9fe2..7f7cf6d6ab 100644 --- a/lib/bolt/shell/powershell/snippets.rb +++ b/lib/bolt/shell/powershell/snippets.rb @@ -55,21 +55,25 @@ def run_script(arguments, script_path) } #{build_arg_list} - switch -regex ( Get-ExecutionPolicy ) + try { - '^AllSigned' + switch -regex ( Get-ExecutionPolicy ) { - if ((Get-AuthenticodeSignature -File "#{script_path}").Status -ne 'Valid') { - $Host.UI.WriteErrorLine("Error: Target host Powershell ExecutionPolicy is set to ${_} and script '#{script_path}' does not contain a valid signature.") + '^AllSigned' + { + if ((Get-AuthenticodeSignature -File "#{script_path}").Status -ne 'Valid') { + $Host.UI.WriteErrorLine("Error: Target host Powershell ExecutionPolicy is set to ${_} and script '#{script_path}' does not contain a valid signature.") + exit 1; + } + } + '^Restricted' + { + $Host.UI.WriteErrorLine("Error: Target host Powershell ExecutionPolicy is set to ${_} which denies running any scripts on the target.") exit 1; } } - '^Restricted' - { - $Host.UI.WriteErrorLine("Error: Target host Powershell ExecutionPolicy is set to ${_} which denies running any scripts on the target.") - exit 1; - } } + catch {} if([string]::IsNullOrEmpty($invokeArgs.ScriptBlock)){ $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");