Skip to content

Commit

Permalink
Remove legacy spec resolution logic
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarber-akamai committed Oct 23, 2024
1 parent dddc940 commit ec9733f
Show file tree
Hide file tree
Showing 41 changed files with 98 additions and 996 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag linode/cli:$(date +%s) --build-arg="github_token=$GITHUB_TOKEN"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: docker build . --file Dockerfile --tag linode/cli:$(date +%s)
2 changes: 0 additions & 2 deletions .github/workflows/e2e-suite-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ jobs:

- name: Install the CLI
run: make install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: make INTEGRATION_TEST_PATH="${{ inputs.test_path }}" testint
env:
Expand Down
70 changes: 1 addition & 69 deletions .github/workflows/e2e-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
- dev

jobs:
integration_tests:
integration-tests:
name: Run integration tests on Ubuntu
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' && inputs.sha != '' || github.event_name == 'push' || github.event_name == 'pull_request'
Expand Down Expand Up @@ -101,8 +101,6 @@ jobs:
- name: Install Package
run: make install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set LINODE_CLI_TOKEN
run: |
Expand Down Expand Up @@ -167,69 +165,3 @@ jobs:
conclusion: process.env.conclusion
});
return result;
notify-slack:
runs-on: ubuntu-latest
needs: [integration_tests]
if: always() && github.repository == 'linode/linode-cli' # Run even if integration tests fail and only on main repository

steps:
- name: Notify Slack
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:"
}
},
{
"type": "divider"
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Build Result:*\n${{ needs.integration_tests.result == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}"
},
{
"type": "mrkdwn",
"text": "*Branch:*\n`${{ github.ref_name }}`"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
},
{
"type": "mrkdwn",
"text": "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
}
]
},
{
"type": "divider"
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
77 changes: 2 additions & 75 deletions .github/workflows/nightly-smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,16 @@ on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
sha:
description: 'Commit SHA to test'
required: false
default: ''
type: string

jobs:
smoke_tests:
if: github.repository == 'linode/linode-cli' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'
ref: ${{ github.event.inputs.sha || github.ref }}
ref: dev

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -34,73 +25,9 @@ jobs:

- name: Install Linode CLI
run: make install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run smoke tests
id: smoke_tests
run: |
make smoketest
env:
LINODE_CLI_TOKEN: ${{ secrets.LINODE_TOKEN }}

- name: Notify Slack
if: always() && github.repository == 'linode/linode-cli' # Run even if integration tests fail and only on main repository
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:"
}
},
{
"type": "divider"
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Build Result:*\n${{ steps.smoke_tests.outcome == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}"
},
{
"type": "mrkdwn",
"text": "*Branch:*\n`${{ github.ref_name }}`"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
},
{
"type": "mrkdwn",
"text": "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
}
]
},
{
"type": "divider"
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/publish-oci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,3 @@ jobs:
tags: linode/cli:${{ steps.cli_version.outputs.result }},linode/cli:latest
build-args: |
linode_cli_version=${{ steps.cli_version.outputs.result }}
github_token=${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
- name: Build the package
run: make build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LINODE_CLI_VERSION: ${{ github.event.release.tag_name }}

- name: Publish the release artifacts to PyPI
Expand Down
74 changes: 0 additions & 74 deletions .github/workflows/remote-release-trigger.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ jobs:

- name: Install Package
run: make install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run the unit test suite
run: make test
Expand Down Expand Up @@ -59,8 +57,6 @@ jobs:
shell: pwsh
run: |
make install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run the unit test suite
run: make test
3 changes: 1 addition & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,7 @@ disable=raw-checker-failed,
duplicate-code,
too-few-public-methods,
too-many-instance-attributes,
use-symbolic-message-instead,
too-many-positional-arguments
use-symbolic-message-instead

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ FROM python:3.11-slim AS builder

ARG linode_cli_version

ARG github_token

WORKDIR /src

RUN apt-get update && \
Expand All @@ -13,7 +11,7 @@ COPY . .

RUN make requirements

RUN LINODE_CLI_VERSION=$linode_cli_version GITHUB_TOKEN=$github_token make build
RUN LINODE_CLI_VERSION=$linode_cli_version make build

FROM python:3.11-slim

Expand Down
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Makefile for more convenient building of the Linode CLI and its baked content
#

# The URL of the raw OpenAPI spec to build linode-cli with.
# TODO: Uncomment once spec is available in the akamai-apis repository.
# SPEC := https://raw.githubusercontent.com/akamai/akamai-apis/main/apis/linode-api/v4/openapi.json
SPEC := https://raw.githubusercontent.com/linode/linode-api-docs/development/openapi.yaml

# Test-related arguments
MODULE :=
TEST_CASE_COMMAND :=
Expand All @@ -11,11 +16,6 @@ ifdef TEST_CASE
TEST_CASE_COMMAND = -k $(TEST_CASE)
endif

SPEC_VERSION ?= latest
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
Expand Down Expand Up @@ -67,12 +67,9 @@ clean:
rm -rf dist linode_cli.egg-info build

.PHONY: testunit
testunit: export LINODE_CLI_TEST_MODE = 1
testunit:
@mkdir -p /tmp/linode/.config
@orig_xdg_config_home=$${XDG_CONFIG_HOME:-}; \
export LINODE_CLI_TEST_MODE=1 XDG_CONFIG_HOME=/tmp/linode/.config; \
pytest -v tests/unit; \
export XDG_CONFIG_HOME=$$orig_xdg_config_home
pytest -v tests/unit

.PHONY: testint
testint:
Expand Down
Loading

0 comments on commit ec9733f

Please sign in to comment.