Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/e2e-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/remote-release-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
1 change: 1 addition & 0 deletions linodecli/arg_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion linodecli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]}"
)

Expand Down
7 changes: 3 additions & 4 deletions linodecli/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Contains any code relevant to generating/updating shell completions for linode-cli
"""

from string import Template

from openapi3 import OpenAPI
Expand Down Expand Up @@ -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(
Expand Down
14 changes: 5 additions & 9 deletions linodecli/configuration/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: ")
Expand Down Expand Up @@ -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)

Expand All @@ -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,
)
Expand Down
6 changes: 2 additions & 4 deletions linodecli/configuration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ":
Expand Down
1 change: 1 addition & 0 deletions linodecli/plugins/obj/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
CLI Plugin for handling OBJ
"""

import getpass
import os
import re
Expand Down
2 changes: 1 addition & 1 deletion resolve_spec_url
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_api_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Unit tests for linodecli.api_request
"""

import contextlib
import io
import json
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Unit tests for linodecli.configuration
"""

import argparse
import contextlib
import io
Expand Down
2 changes: 1 addition & 1 deletion wiki/development/Development - Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion wiki/development/Development - Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading