Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v5.49.0 #606

Merged
merged 25 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
287d6c5
fix: Support specifying arrays nested in complex lists as JSON (#577)
lgarber-akamai Feb 14, 2024
65bc15f
new: Address breaking change in MDS plugin `sshkeys` command (#579)
lgarber-akamai Feb 14, 2024
df37368
Add `SKIP_BAKE` Argument to `bake` Target in Makefile (#580)
zliang-akamai Feb 15, 2024
cef8240
new: Support specifying complex list arguments as JSON (#578)
lgarber-akamai Feb 16, 2024
8b2e3c1
new: Add API spec version to User-Agent; add User-Agent to metadata p…
lgarber-akamai Mar 4, 2024
fd54db0
Merge branch 'main' into dev
jriddle-linode Mar 5, 2024
5f5bf72
doc: Add development guide to wiki (#586)
lgarber-akamai Mar 13, 2024
fc013da
new: Improve generated command help page formatting using Rich (#585)
lgarber-akamai Mar 13, 2024
f106959
Move listing functions of the obj plugin to its own files (#587)
zliang-akamai Mar 13, 2024
5866451
fix: Resolve help page error for list commands with non-standard name…
lgarber-akamai Mar 14, 2024
e96e70c
doc: Clarify how list argument differentiates objects (#590)
yec-akamai Mar 20, 2024
01c4e2f
Integration test (#589)
vshanthe Mar 29, 2024
96e9f97
build(deps-dev): bump requests-mock from 1.11.0 to 1.12.1 (#595)
dependabot[bot] Apr 1, 2024
a3cf252
ref: Drop `version` script; consolidate version logic in setup.py (#594)
lgarber-akamai Apr 3, 2024
5716fcd
Add `--debug` option to metadata plugin (#592)
zliang-akamai Apr 8, 2024
47535fd
ci: update labels and release drafter (#596)
jriddle-linode Apr 9, 2024
70dfe44
ref: Improve maintainability of `colors.py` (#598)
lgarber-akamai Apr 9, 2024
d05821a
ref: Refactor the `configuration` package for maintainability (#597)
lgarber-akamai Apr 10, 2024
98cc51c
ref: Refactor `plugins/__init__.py` for maintainability (#599)
lgarber-akamai Apr 12, 2024
9f7ebc8
test: Update outdated backup test and address test warnings messages …
ykim-akamai Apr 12, 2024
7ebdb7c
ref: Refactor `baked/operation.py` (#601)
yec-akamai Apr 17, 2024
f41b131
ref: Move build configuration from `setup.py` to `pyproject.toml`; ap…
lgarber-akamai Apr 26, 2024
88f0104
new: update pyenv to use environment name (#603)
jriddle-linode Apr 29, 2024
feecb3a
Add test integration (#593)
vshanthe Apr 30, 2024
77b7e8c
Resolve all merge conflicts to main
ykim-akamai May 1, 2024
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body:
attributes:
label: CLI Version
description: What version of linode-cli are you running? `linode-cli -v`
placeholder: linode-cli 5.24.0 Built off spec version 4.138.0
placeholder: linode-cli 5.24.0 Built from spec version 4.138.0
validations:
required: true
- type: textarea
Expand Down
14 changes: 14 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# PR Labels
- name: new-feature
description: for new features in the changelog.
color: 225fee
Expand All @@ -13,6 +14,9 @@
- name: documentation
description: for updates to the documentation in the changelog.
color: d3e1e6
- name: dependencies
description: dependency updates usually from dependabot
color: 5c9dff
- name: testing
description: for updates to the testing suite in the changelog.
color: 933ac9
Expand All @@ -22,3 +26,13 @@
- name: ignore-for-release
description: PRs you do not want to render in the changelog
color: 7b8eac
- name: do-not-merge
description: PRs that should not be merged until the commented issue is resolved
color: eb1515
# Issue Labels
- name: enhancement
description: issues that request a enhancement
color: 22ee47
- name: bug
description: issues that report a bug
color: ed8e21
4 changes: 2 additions & 2 deletions .github/workflows/e2e-suite-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
python-version: '3.x'

- name: Install Python deps
run: pip install -r requirements.txt -r requirements-dev.txt wheel boto3
run: pip install .[dev,obj]

- name: Install the CLI
run: make install
Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
python-version: '3.x'

- name: Install Python deps
run: pip install -r requirements.txt -r requirements-dev.txt wheel boto3
run: pip install .[obj,dev]

- name: Install the CLI
run: make install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: pip install certifi -U

- name: Install deps
run: pip install -r requirements.txt -r requirements-dev.txt
run: pip install .[obj,dev]

- name: Install Package
run: make install
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: labeler

on:
push:
branches:
- 'main'
paths:
- '.github/labels.yml'
- '.github/workflows/labeler.yml'
pull_request:
paths:
- '.github/labels.yml'
- '.github/workflows/labeler.yml'

jobs:
labeler:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Run Labeler
uses: crazy-max/ghaction-github-labeler@de749cf181958193cb7debf1a9c5bb28922f3e1b
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: .github/labels.yml
dry-run: ${{ github.event_name == 'pull_request' }}
exclude: |
help*
*issue
2 changes: 1 addition & 1 deletion .github/workflows/nightly-smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
python-version: '3.x'

- name: Install Python deps
run: pip install -r requirements.txt -r requirements-dev.txt wheel boto3
run: pip install .[obj,dev]

- name: Install Linode CLI
run: make install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,18 @@ jobs:
# This is necessary as we want to ensure that version tags
# are properly formatted before passing them into the
# DockerFile.
- name: Get CLI version
run: |
export CLI_VERSION=$(./version)
echo "CLI_VERSION=$CLI_VERSION" >> $GITHUB_OUTPUT
env:
LINODE_CLI_VERSION: ${{ github.event.release.tag_name }}
- uses: actions/github-script@v7
id: cli_version
with:
script: |
let tag_name = '${{ github.event.release.tag_name }}';

if (tag_name.startsWith("v")) {
tag_name = tag_name.slice(1);
}

return tag_name;
result-encoding: string

- name: Build and push to DockerHub
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # [email protected]
Expand All @@ -49,7 +54,7 @@ jobs:
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: linode/cli:${{ steps.cli_version.outputs.CLI_VERSION }},linode/cli:latest
tags: linode/cli:${{ steps.cli_version.outputs.result }},linode/cli:latest
build-args: |
linode_cli_version=${{ steps.cli_version.outputs.CLI_VERSION }}
linode_cli_version=${{ steps.cli_version.outputs.result }}
github_token=${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: install boto3
run: pip3 install boto3
- name: install dependencies
run: pip3 install -r requirements-dev.txt -r requirements.txt
run: pip install .[obj,dev]

- name: run linter
run: make lint
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: pip install certifi -U

- name: Install deps
run: pip install -r requirements.txt -r requirements-dev.txt
run: pip install .[dev]

- name: Install Package
run: make install
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
run: pip install certifi -U

- name: Install deps
run: pip install -r requirements.txt -r requirements-dev.txt
run: pip install .[dev]

- name: Install Package
shell: pwsh
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
linode-cli
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ ARG github_token

WORKDIR /src

COPY requirements.txt .

RUN apt-get update && \
apt-get install -y make git && \
pip3 install -r requirements.txt && \
pip3 install build
apt-get install -y make git

COPY . .

RUN make requirements

RUN LINODE_CLI_VERSION=$linode_cli_version GITHUB_TOKEN=$github_token make build

FROM python:3.11-slim
Expand Down
4 changes: 0 additions & 4 deletions Jenkinsfile

This file was deleted.

3 changes: 0 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
include linodecli/data-3
include linodecli/oauth-landing-page.html
include linode-cli.sh
include baked_version
include requirements.txt
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Makefile for more convenient building of the Linode CLI and its baked content
#
INTEGRATION_TEST_PATH :=
MODULE :=
TEST_CASE_COMMAND :=

ifdef TEST_CASE
Expand All @@ -14,6 +14,11 @@ ifndef SPEC
override SPEC = $(shell ./resolve_spec_url ${SPEC_VERSION})
endif

# Version-related variables
VERSION_FILE := ./linodecli/version.py
VERSION_MODULE_DOCSTRING ?= \"\"\"\nThe version of the Linode CLI.\n\"\"\"\n\n
LINODE_CLI_VERSION ?= "0.0.0.dev"

.PHONY: install
install: check-prerequisites requirements build
pip3 install --force dist/*.whl
Expand All @@ -27,13 +32,17 @@ else
cp data-3 linodecli/
endif

.PHONY: create-version
create-version:
@printf "${VERSION_MODULE_DOCSTRING}__version__ = \"${LINODE_CLI_VERSION}\"\n" > $(VERSION_FILE)

.PHONY: build
build: clean bake
build: clean create-version bake
python3 -m build --wheel --sdist

.PHONY: requirements
requirements:
pip3 install -r requirements.txt -r requirements-dev.txt
pip3 install --upgrade .[dev,obj]

.PHONY: lint
lint: build
Expand Down Expand Up @@ -62,7 +71,7 @@ testunit:

.PHONY: testint
testint:
pytest tests/integration/${INTEGRATION_TEST_PATH} ${TEST_CASE_COMMAND} --disable-warnings
pytest tests/integration/${MODULE} ${TEST_CASE_COMMAND}

.PHONY: testall
testall:
Expand All @@ -89,4 +98,4 @@ format: black isort autoflake

@PHONEY: smoketest
smoketest:
pytest -m smoke tests/integration --disable-warnings
pytest -m smoke tests/integration
23 changes: 7 additions & 16 deletions linodecli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,20 @@
from linodecli import plugins

from .arg_helpers import (
action_help,
bake_command,
help_with_ops,
register_args,
register_plugin,
remove_plugin,
)
from .cli import CLI
from .completion import bake_completions, get_completions
from .completion import get_completions
from .configuration import ENV_TOKEN_NAME
from .help_pages import print_help_action, print_help_default
from .helpers import handle_url_overrides
from .output import OutputMode
from .version import __version__

# this might not be installed at the time of building
try:
VERSION = version("linode-cli")
except:
VERSION = "building"
VERSION = __version__

BASE_URL = "https://api.linode.com/v4"

Expand Down Expand Up @@ -113,7 +109,7 @@ def main(): # pylint: disable=too-many-branches,too-many-statements
if not parsed.command:
# print version info and exit - but only if no command was given
print(f"linode-cli {VERSION}")
print(f"Built off spec version {cli.spec_version}")
print(f"Built from spec version {cli.spec_version}")
sys.exit(0)
else:
# something else might want to parse version
Expand Down Expand Up @@ -155,7 +151,7 @@ def main(): # pylint: disable=too-many-branches,too-many-statements
# handle a help for the CLI
if parsed.command is None or (parsed.command is None and parsed.help):
parser.print_help()
help_with_ops(cli.ops, cli.config)
print_help_default(cli.ops, cli.config)
sys.exit(0)

# configure
Expand Down Expand Up @@ -209,11 +205,6 @@ def main(): # pylint: disable=too-many-branches,too-many-statements
cli.config.remove_user(parsed.action)
sys.exit(0)

# special command to bake shell completion script
if parsed.command == "bake-bash":
bake_completions(cli.ops)
sys.exit(0)

# check for plugin invocation
if parsed.command not in cli.ops and parsed.command in plugins.available(
cli.config
Expand Down Expand Up @@ -257,6 +248,6 @@ def main(): # pylint: disable=too-many-branches,too-many-statements

if parsed.command is not None and parsed.action is not None:
if parsed.help:
action_help(cli, parsed.command, parsed.action)
print_help_action(cli, parsed.command, parsed.action)
sys.exit(0)
cli.handle_command(parsed.command, parsed.action, args)
Loading
Loading