diff --git a/.github/workflows/e2e-suite.yml b/.github/workflows/e2e-suite.yml index fa5581798..7cae500dc 100644 --- a/.github/workflows/e2e-suite.yml +++ b/.github/workflows/e2e-suite.yml @@ -127,7 +127,7 @@ jobs: - name: Upload Test Report as Artifact if: always() - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: test-report-file if-no-files-found: ignore @@ -243,7 +243,7 @@ jobs: submodules: 'recursive' - name: Download test report - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: name: test-report-file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 77e26ca66..009472d7b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,10 +39,10 @@ jobs: run: make requirements - name: Set up QEMU - uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # pin@v3.6.0 + uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # pin@v3.7.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # pin@v3.11.1 + uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # pin@v3.12.0 - name: Login to Docker Hub uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # pin@v3.6.0 diff --git a/.github/workflows/remote-release-trigger.yml b/.github/workflows/remote-release-trigger.yml index 2dfb75c2c..75a5da592 100644 --- a/.github/workflows/remote-release-trigger.yml +++ b/.github/workflows/remote-release-trigger.yml @@ -66,7 +66,7 @@ jobs: commit_sha: ${{ steps.calculate_head_sha.outputs.commit_sha }} - name: Release - uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # pin@v2.4.1 + uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # pin@v2.5.0 with: target_commitish: 'main' token: ${{ steps.generate_token.outputs.token }} diff --git a/README.md b/README.md index 0db85368b..ef5e786c0 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Visit the [Wiki](../../wiki/Installation) for more information. ## Contributing -This CLI is generated from the [OpenAPI specification for Linode's API](https://github.com/linode/linode-api-docs). As +This CLI is generated from the [OpenAPI specification for Linode's API](https://github.com/linode/linode-api-openapi). As such, many changes are made directly to the spec. Please follow the [Contributing Guidelines](https://github.com/linode/linode-cli/blob/main/CONTRIBUTING.md) when making a contribution. diff --git a/linodecli/arg_helpers.py b/linodecli/arg_helpers.py index 2f5f1b70c..2a6d7c9a0 100644 --- a/linodecli/arg_helpers.py +++ b/linodecli/arg_helpers.py @@ -4,6 +4,7 @@ This module defines argument parsing, plugin registration, and plugin removal functionalities for the Linode CLI. """ + import sys from argparse import ArgumentParser from configparser import ConfigParser diff --git a/linodecli/cli.py b/linodecli/cli.py index 718b619a4..419b5e06e 100644 --- a/linodecli/cli.py +++ b/linodecli/cli.py @@ -286,7 +286,7 @@ def user_agent(self) -> str: """ return ( f"linode-cli/{self.version} " - f"linode-api-docs/{self.spec_version} " + f"linode-api-openapi/{self.spec_version} " f"python/{version_info[0]}.{version_info[1]}.{version_info[2]}" ) diff --git a/linodecli/completion.py b/linodecli/completion.py index 6a402eecf..e95acd961 100644 --- a/linodecli/completion.py +++ b/linodecli/completion.py @@ -2,6 +2,7 @@ """ Contains any code relevant to generating/updating shell completions for linode-cli """ + from string import Template from openapi3 import OpenAPI @@ -93,12 +94,10 @@ def get_bash_completions(ops): complete -F _linode_cli lin""" ) - command_template = Template( - """$command) + command_template = Template("""$command) COMPREPLY=( $(compgen -W "$actions --help" -- ${cur}) ) return 0 - ;;""" - ) + ;;""") command_blocks = [ command_template.safe_substitute( diff --git a/linodecli/configuration/auth.py b/linodecli/configuration/auth.py index a7e23b39d..1b633c7bb 100644 --- a/linodecli/configuration/auth.py +++ b/linodecli/configuration/auth.py @@ -214,13 +214,11 @@ def _get_token_terminal(base_url: str) -> Tuple[str, str]: :returns: A tuple containing the user's username and token. :rtype: Tuple[str, str] """ - print( - f""" + print(f""" First, we need a Personal Access Token. To get one, please visit {TOKEN_GENERATION_URL} and click "Create a Personal Access Token". The CLI needs access to everything -on your account to work correctly.""" - ) +on your account to work correctly.""") while True: token = input("Personal Access Token: ") @@ -329,15 +327,13 @@ def log_message(self, form, *args): # pylint: disable=arguments-differ # figure out the URL to direct the user to and print out the prompt # pylint: disable-next=line-too-long url = f"https://login.linode.com/oauth/authorize?client_id={OAUTH_CLIENT_ID}&response_type=token&scopes=*&redirect_uri=http://localhost:{serv.server_address[1]}" - print( - f"""A browser should open directing you to this URL to authenticate: + print(f"""A browser should open directing you to this URL to authenticate: {url} If you are not automatically directed there, please copy/paste the link into your browser to continue.. -""" - ) +""") webbrowser.open(url) @@ -348,7 +344,7 @@ def log_message(self, form, *args): # pylint: disable=arguments-differ except KeyboardInterrupt: print( "\nGiving up. If you couldn't get web authentication to work, please " - "try token using a token by invoking with `linode-cli configure --token`, " + "try using a token by invoking with `linode-cli configure --token`, " "and open an issue at https://github.com/linode/linode-cli", file=sys.stderr, ) diff --git a/linodecli/configuration/helpers.py b/linodecli/configuration/helpers.py index a0398e2b3..35be04047 100644 --- a/linodecli/configuration/helpers.py +++ b/linodecli/configuration/helpers.py @@ -97,11 +97,9 @@ def _check_browsers() -> bool: # pylint: disable-next=protected-access if not KNOWN_GOOD_BROWSERS.intersection(webbrowser._tryorder): - print( - """ + print(""" This tool defaults to web-based authentication, -however no known-working browsers were found.""" - ) +however no known-working browsers were found.""") while True: r = input("Try it anyway? [y/N]: ") if r.lower() in "yn ": diff --git a/linodecli/plugins/obj/__init__.py b/linodecli/plugins/obj/__init__.py index 2d5761340..6952487f9 100644 --- a/linodecli/plugins/obj/__init__.py +++ b/linodecli/plugins/obj/__init__.py @@ -2,6 +2,7 @@ """ CLI Plugin for handling OBJ """ + import getpass import os import re diff --git a/resolve_spec_url b/resolve_spec_url index 60ae216fb..7487e2ef3 100755 --- a/resolve_spec_url +++ b/resolve_spec_url @@ -7,7 +7,7 @@ import sys import requests -LINODE_DOCS_REPO = "linode/linode-api-docs" +LINODE_DOCS_REPO = "linode/linode-api-openapi" def get_latest_tag(): diff --git a/tests/unit/test_api_request.py b/tests/unit/test_api_request.py index a222d60db..1afa699ce 100644 --- a/tests/unit/test_api_request.py +++ b/tests/unit/test_api_request.py @@ -2,6 +2,7 @@ """ Unit tests for linodecli.api_request """ + import contextlib import io import json diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py index 3ce0f8788..961a62121 100644 --- a/tests/unit/test_cli.py +++ b/tests/unit/test_cli.py @@ -79,7 +79,7 @@ def test_find_operation( def test_user_agent(self, mock_cli: CLI): assert re.compile( - r"linode-cli/[0-9]+\.[0-9]+\.[0-9]+ linode-api-docs/[0-9]+\.[0-9]+\.[0-9]+ python/[0-9]+\.[0-9]+\.[0-9]+" + r"linode-cli/[0-9]+\.[0-9]+\.[0-9]+ linode-api-openapi/[0-9]+\.[0-9]+\.[0-9]+ python/[0-9]+\.[0-9]+\.[0-9]+" ).match(mock_cli.user_agent) def test_load_openapi_spec_json(self): diff --git a/tests/unit/test_configuration.py b/tests/unit/test_configuration.py index 14b704d0c..409250330 100644 --- a/tests/unit/test_configuration.py +++ b/tests/unit/test_configuration.py @@ -2,6 +2,7 @@ """ Unit tests for linodecli.configuration """ + import argparse import contextlib import io diff --git a/wiki/development/Development - Overview.md b/wiki/development/Development - Overview.md index a354103f7..555b668aa 100644 --- a/wiki/development/Development - Overview.md +++ b/wiki/development/Development - Overview.md @@ -3,7 +3,7 @@ The following section outlines the core functions of the Linode CLI. ## OpenAPI Specification Parsing Most Linode CLI commands (excluding [plugin commands](https://github.com/linode/linode-cli/tree/dev/linodecli/plugins)) -are generated dynamically at build-time from the [Linode OpenAPI Specification](https://github.com/linode/linode-api-docs), +are generated dynamically at build-time from the [Linode OpenAPI Specification](https://github.com/linode/linode-api-openapi), which is also used to generate the [official Linode API documentation](https://www.linode.com/docs/api/). Each OpenAPI spec endpoint method is parsed into an `OpenAPIOperation` object. diff --git a/wiki/development/Development - Setup.md b/wiki/development/Development - Setup.md index bf667fcbe..7293620ce 100644 --- a/wiki/development/Development - Setup.md +++ b/wiki/development/Development - Setup.md @@ -73,7 +73,7 @@ This can be achieved using the `SPEC` Makefile argument, for example: ```bash # Download the OpenAPI spec -curl -o openapi.yaml https://raw.githubusercontent.com/linode/linode-api-docs/development/openapi.yaml +curl -o openapi.json https://raw.githubusercontent.com/linode/linode-api-openapi/main/openapi.json # Many arbitrary changes to the spec