Skip to content

Commit f62c0b1

Browse files
Remove resolve_spec_url; remove GITHUB_TOKEN from workflows and Dockerfile
Add logic to load from JSON; point SPEC at prospective URL
1 parent dc85a95 commit f62c0b1

18 files changed

Lines changed: 337 additions & 112 deletions

.github/workflows/docker-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v3
1717
- name: Build the Docker image
18-
run: docker build . --file Dockerfile --tag linode/cli:$(date +%s) --build-arg="github_token=$GITHUB_TOKEN"
18+
run: docker build . --file Dockerfile --tag linode/cli:$(date +%s)
1919
env:
2020
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/e2e-suite-pr.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ jobs:
7272

7373
- name: Install the CLI
7474
run: make install
75-
env:
76-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7775

7876
- run: make INTEGRATION_TEST_PATH="${{ inputs.test_path }}" testint
7977
if: ${{ steps.validate-tests.outputs.match == '' }}
@@ -162,8 +160,6 @@ jobs:
162160

163161
- name: Install the CLI
164162
run: make install
165-
env:
166-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
167163

168164
- run: make INTEGRATION_TEST_PATH="${{ inputs.test_path }}" testint
169165
env:

.github/workflows/e2e-suite.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ jobs:
5858
5959
- name: Install Package
6060
run: make install
61-
env:
62-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6361

6462
- name: Set LINODE_CLI_TOKEN
6563
run: |

.github/workflows/nightly-smoke-tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ jobs:
2525

2626
- name: Install Linode CLI
2727
run: make install
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3028

3129
- name: Run smoke tests
3230
run: |

.github/workflows/publish-oci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,3 @@ jobs:
5757
tags: linode/cli:${{ steps.cli_version.outputs.result }},linode/cli:latest
5858
build-args: |
5959
linode_cli_version=${{ steps.cli_version.outputs.result }}
60-
github_token=${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish-pypi.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
- name: Build the package
3131
run: make build
3232
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3433
LINODE_CLI_VERSION: ${{ github.event.release.tag_name }}
3534

3635
- name: Publish the release artifacts to PyPI

.github/workflows/unit-tests.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ jobs:
2929

3030
- name: Install Package
3131
run: make install
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3432

3533
- name: Run the unit test suite
3634
run: make test
@@ -59,8 +57,6 @@ jobs:
5957
shell: pwsh
6058
run: |
6159
make install
62-
env:
63-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6460
6561
- name: Run the unit test suite
6662
run: make test

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM python:3.11-slim AS builder
22

33
ARG linode_cli_version
4-
ARG github_token
54

65
WORKDIR /src
76

@@ -12,7 +11,7 @@ COPY . .
1211

1312
RUN make requirements
1413

15-
RUN LINODE_CLI_VERSION=$linode_cli_version GITHUB_TOKEN=$github_token make build
14+
RUN LINODE_CLI_VERSION=$linode_cli_version make build
1615

1716
FROM python:3.11-slim
1817

Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#
22
# Makefile for more convenient building of the Linode CLI and its baked content
33
#
4+
5+
# The URL of the raw OpenAPI spec to build linode-cli with.
6+
# TODO: Uncomment before merging
7+
# SPEC := https://raw.githubusercontent.com/akamai/akamai-apis/main/apis/linode-api/v4/openapi.json
8+
SPEC := https://gist.githubusercontent.com/lgarber-akamai/1c84a451231195d63e990a89f45788fc/raw/3d4c6c677c06bd28d90ec6dd994c7305da0839af/openapi-new.json
9+
10+
# Test-related arguments
411
MODULE :=
512
TEST_CASE_COMMAND :=
613
TEST_ARGS :=
@@ -9,12 +16,6 @@ ifdef TEST_CASE
916
TEST_CASE_COMMAND = -k $(TEST_CASE)
1017
endif
1118

12-
13-
SPEC_VERSION ?= latest
14-
ifndef SPEC
15-
override SPEC = $(shell ./resolve_spec_url ${SPEC_VERSION})
16-
endif
17-
1819
# Version-related variables
1920
VERSION_FILE := ./linodecli/version.py
2021
VERSION_MODULE_DOCSTRING ?= \"\"\"\nThe version of the Linode CLI.\n\"\"\"\n\n

linodecli/__init__.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@
1515
from linodecli import plugins
1616
from linodecli.exit_codes import ExitCodes
1717

18-
from .arg_helpers import (
19-
bake_command,
20-
register_args,
21-
register_plugin,
22-
remove_plugin,
23-
)
18+
from .arg_helpers import register_args, register_plugin, remove_plugin
2419
from .cli import CLI
2520
from .completion import get_completions
2621
from .configuration import ENV_TOKEN_NAME
@@ -102,7 +97,7 @@ def main(): # pylint: disable=too-many-branches,too-many-statements
10297
if parsed.action is None:
10398
print("No spec provided, cannot bake")
10499
sys.exit(ExitCodes.ARGUMENT_ERROR)
105-
bake_command(cli, parsed.action)
100+
cli.bake(parsed.action)
106101
sys.exit(ExitCodes.SUCCESS)
107102
elif cli.ops is None:
108103
# if not spec was found and we weren't baking, we're doomed

0 commit comments

Comments
 (0)