You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2026/09/14 11:14:34 UTC

(pulsar) 02/03: [improve][ci] Configure SSH access action default and update Upterm (#26575)

This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-4.2
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit 678ab800ec8901b195de7df158cb84a6c5d4c128
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Mon Sep 14 10:11:32 2026 +0300

    [improve][ci] Configure SSH access action default and update Upterm (#26575)
    
    (cherry picked from commit b214a36d6831bc3db4cc99169887ee133771b58e)
---
 .github/actions/ssh-access/action.yml  | 31 +++++++++++++++++++++++++++----
 .github/workflows/pulsar-ci-flaky.yaml |  1 +
 .github/workflows/pulsar-ci.yaml       |  1 +
 3 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/.github/actions/ssh-access/action.yml b/.github/actions/ssh-access/action.yml
index 89f9b74e6040..11c10ceb3d7e 100644
--- a/.github/actions/ssh-access/action.yml
+++ b/.github/actions/ssh-access/action.yml
@@ -17,6 +17,13 @@
 # under the License.
 #
 
+# CI_ENABLE_SSH=true or false explicitly enables or disables both start and wait.
+# In particular, false disables SSH even for public repositories.
+# Without an override, public workflow repositories are enabled; private, internal,
+# and unknown visibility are disabled. The calling workflows map the repository
+# variable CI_ENABLE_SSH into the environment; job/step environment overrides win.
+# Callers still control when this action runs and which GitHub users' keys are allowed.
+
 name: ssh access
 description: Sets up SSH access to build VM with upterm
 inputs:
@@ -47,27 +54,43 @@ inputs:
 runs:
   using: composite
   steps:
-    - run: |
+    - name: Configure SSH access
+      env:
+        SSH_ACCESS_ENABLED: ${{ env.CI_ENABLE_SSH || (github.event.repository.visibility == 'public' && 'true' || 'false') }}
+      run: |
+        case "$SSH_ACCESS_ENABLED" in
+          false)
+            echo "SSH access is disabled. Set CI_ENABLE_SSH=true to enable it."
+            exit 0
+            ;;
+          true) ;;
+          *)
+            echo "::error::CI_ENABLE_SSH must be true or false."
+            exit 1
+            ;;
+        esac
         if [[ "${{ inputs.action }}" == "start" ]]; then
             echo "::group::Installing upterm & tmux"
             if [[ "$OSTYPE" == "linux-gnu"* ]]; then
                 # install upterm
-                curl -sL https://github.com/owenthereal/upterm/releases/download/v0.20.0/upterm_linux_amd64.tar.gz | tar zxvf - -C /tmp upterm && sudo install /tmp/upterm /usr/local/bin/ && rm -rf /tmp/upterm
+                curl -fsSL https://github.com/owenthereal/upterm/releases/download/v0.27.0/upterm_linux_amd64.tar.gz | tar zxvf - -C /tmp upterm && sudo install /tmp/upterm /usr/local/bin/ && rm -rf /tmp/upterm
 
                 # install tmux if it's not present
                 if ! command -v tmux &>/dev/null; then
                     sudo apt-get -y install tmux
                 fi
             elif [[ "$OSTYPE" == "darwin"* ]]; then
-                brew install --cask owenthereal/upterm/upterm
+                # Fully qualifying the cask grants trust to this item; suppress installation prompts in CI.
+                HOMEBREW_NO_ASK=1 brew install --cask owenthereal/upterm/upterm
                 # install tmux if it's not present
                 if ! command -v tmux &>/dev/null; then
-                    brew install tmux
+                    HOMEBREW_NO_ASK=1 brew install tmux
                 fi
             else
                 echo "Unsupported $OSTYPE"
                 exit 0
             fi
+            upterm version
             echo '::endgroup::'
             echo "::group::Configuring ssh and ssh keys"
             # generate ssh key
diff --git a/.github/workflows/pulsar-ci-flaky.yaml b/.github/workflows/pulsar-ci-flaky.yaml
index 9d53232df852..696a0ef50278 100644
--- a/.github/workflows/pulsar-ci-flaky.yaml
+++ b/.github/workflows/pulsar-ci-flaky.yaml
@@ -76,6 +76,7 @@ concurrency:
   cancel-in-progress: true
 
 env:
+  CI_ENABLE_SSH: ${{ vars.CI_ENABLE_SSH }}
   MAVEN_OPTS: -Xss1500k -Xmx2048m -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:GCLockerRetryAllocationCount=100 -Daether.connector.http.reuseConnections=false -Daether.connector.requestTimeout=60000 -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true -Dmaven.wagon.http.serviceUnavailableRetryStrategy.class=standard -Dmaven. [...]
   # defines the retention period for the intermediate build artifacts needed for rerunning a failed build job
   # it's possible to rerun individual failed jobs when the build artifacts are available
diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml
index 9a450abaa459..26eb626ec059 100644
--- a/.github/workflows/pulsar-ci.yaml
+++ b/.github/workflows/pulsar-ci.yaml
@@ -84,6 +84,7 @@ concurrency:
   cancel-in-progress: true
 
 env:
+  CI_ENABLE_SSH: ${{ vars.CI_ENABLE_SSH }}
   MAVEN_OPTS: -Xss1500k -Xmx2048m -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:GCLockerRetryAllocationCount=100 -Daether.connector.http.reuseConnections=false -Daether.connector.requestTimeout=60000 -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true -Dmaven.wagon.http.serviceUnavailableRetryStrategy.class=standard -Dmaven. [...]
   # defines the retention period for the intermediate build artifacts needed for rerunning a failed build job
   # it's possible to rerun individual failed jobs when the build artifacts are available