Repository: softlayer/softlayer-python

Issue:
update Release build
the release build seems to be using old/deprecated things.
https://github.com/softlayer/softlayer-python/actions/runs/6165335378

![image](https://github.com/softlayer/softlayer-python/assets/7408017/2841f4c1-8182-4736-8347-6495f0011066)


Comments:

Patch:
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 19d4bd81..adc5408b 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -39,11 +39,11 @@ jobs:
 
     steps:
     - name: Checkout repository
-      uses: actions/checkout@v2
+      uses: actions/checkout@v4
 
     # Initializes the CodeQL tools for scanning.
     - name: Initialize CodeQL
-      uses: github/codeql-action/init@v1
+      uses: github/codeql-action/init@v2
       with:
         languages: ${{ matrix.language }}
         # If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,7 +54,7 @@ jobs:
     # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
     # If this step fails, then you should remove it and run the build manually (see below)
     - name: Autobuild
-      uses: github/codeql-action/autobuild@v1
+      uses: github/codeql-action/autobuild@v2
 
     # ℹ️ Command-line programs to run using the OS shell.
     # 📚 https://git.io/JvXDl
@@ -68,4 +68,4 @@ jobs:
     #   make release
 
     - name: Perform CodeQL Analysis
-      uses: github/codeql-action/analyze@v1
+      uses: github/codeql-action/analyze@v2
diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml
index d307fd93..f0935473 100644
--- a/.github/workflows/documentation.yml
+++ b/.github/workflows/documentation.yml
@@ -10,12 +10,12 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: [3.8]
+        python-version: [3.11]
 
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v4
     - name: Set up Python ${{ matrix.python-version }}
-      uses: actions/setup-python@v1
+      uses: actions/setup-python@v4
       with:
         python-version: ${{ matrix.python-version }}
     - name: Install dependencies
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index f307200d..95afeced 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,3 +1,6 @@
+# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
+# Trusted Publisher stuff: https://docs.pypi.org/trusted-publishers/adding-a-publisher/
+
 name: Release to PyPi
 
 on:
@@ -8,12 +11,17 @@ jobs:
   build-n-publish:
     name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
     runs-on: ubuntu-latest
+    environment:
+      name: pypi
+      url: https://pypi.org/project/SoftLayer/
+    permissions:
+      id-token: write
     steps:
-    - uses: actions/checkout@master
-    - name: Set up Python 3.8
-      uses: actions/setup-python@v2
+    - uses: actions/checkout@v4
+    - name: Set up Python 3.11
+      uses: actions/setup-python@v4
       with:
-        python-version: 3.8
+        python-version: 3.11
     - name: Install pypa/build
       run: >-
         python -m
@@ -28,10 +36,6 @@ jobs:
         --wheel
         --outdir dist/
         .
-    - name: Publish 📦 to Test PyPI
+    - name: 📦 to PyPI
       uses: pypa/gh-action-pypi-publish@release/v1
-      with:
-        user: __token__
-        password: ${{ secrets.CGALLO_PYPI }}
-        repository_url: https://upload.pypi.org/legacy/
 
diff --git a/SoftLayer/CLI/file/cancel.py b/SoftLayer/CLI/file/cancel.py
index 34077fbb..9837f9fa 100644
--- a/SoftLayer/CLI/file/cancel.py
+++ b/SoftLayer/CLI/file/cancel.py
@@ -16,14 +16,21 @@
               is_flag=True,
               help="Cancels the file storage volume immediately instead "
                    "of on the billing anniversary")
+@click.option('--force', default=False, is_flag=True, help="Force modify")
 @environment.pass_env
-def cli(env, volume_id, reason, immediate):
-    """Cancel an existing file storage volume."""
+def cli(env, volume_id, reason, immediate, force):
+    """Cancel an existing file storage volume.
+
+    EXAMPLE::
+        slcli file volume-cancel 12345678 --immediate -f
+        This command cancels volume with ID 12345678 immediately and without asking for confirmation.
+    """
 
     file_storage_manager = SoftLayer.FileStorageManager(env.client)
 
-    if not (env.skip_confirmations or formatting.no_going_back(volume_id)):
-        raise exceptions.CLIAbort('Aborted')
+    if not force:
+        if not (env.skip_confirmations or formatting.no_going_back(volume_id)):
+            raise exceptions.CLIAbort('Aborted.')
 
     cancelled = file_storage_manager.cancel_file_volume(volume_id,
                                                         reason, immediate)
diff --git a/SoftLayer/CLI/file/duplicate.py b/SoftLayer/CLI/file/duplicate.py
index b8b5983b..50c7c6ea 100644
--- a/SoftLayer/CLI/file/duplicate.py
+++ b/SoftLayer/CLI/file/duplicate.py
@@ -5,6 +5,7 @@
 import SoftLayer
 from SoftLayer.CLI import environment
 from SoftLayer.CLI import exceptions
+from SoftLayer.CLI import formatting
 
 
 CONTEXT_SETTINGS = {'token_normalize_func': lambda x: x.upper()}
@@ -58,11 +59,17 @@
               show_default=True,
               help='Whether or not this duplicate will be a dependent duplicate'
                    'of the origin volume.')
+@click.option('--force', default=False, is_flag=True, help="Force modify")
 @environment.pass_env
 def cli(env, origin_volume_id, origin_snapshot_id, duplicate_size,
         duplicate_iops, duplicate_tier, duplicate_snapshot_size, billing,
-        dependent_duplicate):
-    """Order a duplicate file storage volume."""
+        dependent_duplicate, force):
+    """Order a duplicate file storage volume.
+
+    EXAMPLE::
+        slcli file volume-duplicate 12345678
+        This command shows order a new volume by duplicating the volume with ID 12345678.
+    """
     file_manager = SoftLayer.FileStorageManager(env.client)
 
     hourly_billing_flag = False
@@ -72,6 +79,11 @@ def cli(env, origin_volume_id, origin_snapshot_id, duplicate_size,
     if duplicate_tier is not None:
         duplicate_tier = float(duplicate_tier)
 
+    if not force:
+        if not (env.skip_confirmations or formatting.confirm("This action will incur charges on your account."
+                                                             "Continue?")):
+            raise exceptions.CLIAbort('Aborted.')
+
     try:
         order = file_manager.order_duplicate_volume(
             origin_volume_id,
diff --git a/SoftLayer/CLI/file/limit.py b/SoftLayer/CLI/file/limit.py
index e0243ddc..1437578c 100644
--- a/SoftLayer/CLI/file/limit.py
+++ b/SoftLayer/CLI/file/limit.py
@@ -18,7 +18,12 @@
 @click.option('--datacenter', '-d', help='Filter by datacenter')
 @environment.pass_env
 def cli(env, sortby, datacenter):
-    """List number of block storage volumes limit per datacenter."""
+    """List number of block storage volumes limit per datacenter.
+
+    EXAMPLE:
+        slcli file volume-limits
+        This command lists the storage limits per datacenter for this account.
+    """
     file_manager = SoftLayer.FileStorageManager(env.client)
     file_volumes = file_manager.list_file_volume_limit()
 


Test patch:
diff --git a/.github/workflows/test_pypi_release.yml b/.github/workflows/test_pypi_release.yml
index 12443d25..70245307 100644
--- a/.github/workflows/test_pypi_release.yml
+++ b/.github/workflows/test_pypi_release.yml
@@ -1,21 +1,27 @@
 # https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
+# Trusted Publisher stuff: https://docs.pypi.org/trusted-publishers/adding-a-publisher/
 
-name: Publish 📦 to TestPyPI
+name: TEST Publish 📦 to TestPyPI
 
 on:
   push:
-    branches: [test-pypi ]
+    branches: [test-pypi]
 
 jobs:
   build-n-publish:
-    name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
+    name: TEST Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
     runs-on: ubuntu-latest
+    environment:
+      name: pypi-test
+      url: https://test.pypi.org/project/SoftLayer/
+    permissions:
+      id-token: write
     steps:
     - uses: actions/checkout@master
-    - name: Set up Python 3.8
-      uses: actions/setup-python@v2
+    - name: Set up Python 3.11
+      uses: actions/setup-python@v4
       with:
-        python-version: 3.8
+        python-version: 3.11
     - name: Install pypa/build
       run: >-
         python -m
@@ -31,7 +37,6 @@ jobs:
         --outdir dist/
         .
     - name: Publish 📦 to Test PyPI
-      uses: pypa/gh-action-pypi-publish@master
+      uses: pypa/gh-action-pypi-publish@release/v1
       with:
-        password: ${{ secrets.CGALLO_TEST_PYPI }}
-        repository_url: https://test.pypi.org/legacy/
\ No newline at end of file
+        repository-url: https://test.pypi.org/legacy/
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index a9827899..9b079350 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -13,9 +13,9 @@ jobs:
         python-version: [3.7,3.8,3.9,'3.10',3.11]
 
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v4
     - name: Set up Python ${{ matrix.python-version }}
-      uses: actions/setup-python@v1
+      uses: actions/setup-python@v4
       with:
         python-version: ${{ matrix.python-version }}
     - name: Install dependencies
@@ -27,9 +27,9 @@ jobs:
   coverage:
     runs-on: ubuntu-latest
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v4
     - name: Set up Python
-      uses: actions/setup-python@v1
+      uses: actions/setup-python@v4
       with:
         python-version: 3.9
     - name: Install dependencies
@@ -41,9 +41,9 @@ jobs:
   analysis:
     runs-on: ubuntu-latest
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v4
     - name: Set up Python
-      uses: actions/setup-python@v1
+      uses: actions/setup-python@v4
       with:
         python-version: 3.9
     - name: Install dependencies
diff --git a/tests/CLI/modules/file_tests.py b/tests/CLI/modules/file_tests.py
index a1749e7f..5aafbbee 100644
--- a/tests/CLI/modules/file_tests.py
+++ b/tests/CLI/modules/file_tests.py
@@ -850,3 +850,17 @@ def test_file_snapshot_cancel_force(self, confirm_mock):
         result = self.run_command(['file', 'snapshot-cancel', '4917309'])
         self.assertEqual(2, result.exit_code)
         self.assertEqual('Aborted.', result.exception.message)
+
+    @mock.patch('SoftLayer.CLI.formatting.confirm')
+    def test_file_volume_cancel_force(self, confirm_mock):
+        confirm_mock.return_value = False
+        result = self.run_command(['file', 'volume-cancel', '1234'])
+        self.assertEqual(2, result.exit_code)
+        self.assertEqual('Aborted.', result.exception.message)
+
+    @mock.patch('SoftLayer.CLI.formatting.confirm')
+    def test_file_volume_duplicate_force(self, confirm_mock):
+        confirm_mock.return_value = False
+        result = self.run_command(['file', 'volume-duplicate', '100'])
+        self.assertEqual(2, result.exit_code)
+        self.assertEqual('Aborted.', result.exception.message)