Skip to content

Commit 8866311

Browse files
Merge branch 'dev' into proj/parent-child
2 parents 886c194 + 55aadbb commit 8866311

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1578
-286
lines changed

.github/labels.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# PR Labels
2+
- name: new-feature
3+
description: for new features in the changelog.
4+
color: 225fee
5+
- name: improvement
6+
description: for improvements in existing functionality in the changelog.
7+
color: 22ee47
8+
- name: repo-ci-improvement
9+
description: for improvements in the repository or CI workflow in the changelog.
10+
color: c922ee
11+
- name: bugfix
12+
description: for any bug fixes in the changelog.
13+
color: ed8e21
14+
- name: documentation
15+
description: for updates to the documentation in the changelog.
16+
color: d3e1e6
17+
- name: dependencies
18+
description: dependency updates usually from dependabot
19+
color: 5c9dff
20+
- name: testing
21+
description: for updates to the testing suite in the changelog.
22+
color: 933ac9
23+
- name: breaking-change
24+
description: for breaking changes in the changelog.
25+
color: ff0000
26+
- name: ignore-for-release
27+
description: PRs you do not want to render in the changelog
28+
color: 7b8eac
29+
- name: do-not-merge
30+
description: PRs that should not be merged until the commented issue is resolved
31+
color: eb1515
32+
# Issue Labels
33+
- name: enhancement
34+
description: issues that request a enhancement
35+
color: 22ee47
36+
- name: bug
37+
description: issues that report a bug
38+
color: ed8e21

.github/release-drafter.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- ignore-for-release
5+
categories:
6+
- title: ⚠️ Breaking Change
7+
labels:
8+
- breaking-change
9+
- title: 🐛 Bug Fixes
10+
labels:
11+
- bugfix
12+
- title: 🚀 New Features
13+
labels:
14+
- new-feature
15+
- title: 💡 Improvements
16+
labels:
17+
- improvement
18+
- title: 🧪 Testing Improvements
19+
labels:
20+
- testing
21+
- title: ⚙️ Repo/CI Improvements
22+
labels:
23+
- repo-ci-improvement
24+
- title: 📖 Documentation
25+
labels:
26+
- documentation
27+
- title: 📦 Dependency Updates
28+
labels:
29+
- dependencies
30+
- title: Other Changes
31+
labels:
32+
- "*"

.github/workflows/e2e-test.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Integration Tests
2+
3+
on:
4+
workflow_dispatch: null
5+
push:
6+
branches:
7+
- main
8+
- dev
9+
10+
jobs:
11+
integration-tests:
12+
runs-on: ubuntu-latest
13+
env:
14+
EXIT_STATUS: 0
15+
steps:
16+
- name: Clone Repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
submodules: 'recursive'
21+
22+
- name: Setup Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.x'
26+
27+
- name: Install Python deps
28+
run: pip install -U setuptools wheel boto3 certifi
29+
30+
- name: Install Python SDK
31+
run: make dev-install
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Run Integration tests
36+
run: |
37+
timestamp=$(date +'%Y%m%d%H%M')
38+
report_filename="${timestamp}_sdk_test_report.xml"
39+
make testint TEST_ARGS="--junitxml=${report_filename}"
40+
env:
41+
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}
42+
43+
- name: Upload test results
44+
if: always()
45+
run: |
46+
filename=$(ls | grep -E '^[0-9]{12}_sdk_test_report\.xml$')
47+
python tod_scripts/add_to_xml_test_report.py \
48+
--branch_name "${GITHUB_REF#refs/*/}" \
49+
--gha_run_id "$GITHUB_RUN_ID" \
50+
--gha_run_number "$GITHUB_RUN_NUMBER" \
51+
--xmlfile "${filename}"
52+
sync
53+
python3 tod_scripts/test_report_upload_script.py "${filename}"
54+
env:
55+
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
56+
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}

.github/workflows/labeler.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: labeler
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
paths:
8+
- '.github/labels.yml'
9+
- '.github/workflows/labeler.yml'
10+
pull_request:
11+
paths:
12+
- '.github/labels.yml'
13+
- '.github/workflows/labeler.yml'
14+
15+
jobs:
16+
labeler:
17+
runs-on: ubuntu-latest
18+
steps:
19+
-
20+
name: Checkout
21+
uses: actions/checkout@v4
22+
-
23+
name: Run Labeler
24+
uses: crazy-max/ghaction-github-labeler@de749cf181958193cb7debf1a9c5bb28922f3e1b
25+
with:
26+
github-token: ${{ secrets.GITHUB_TOKEN }}
27+
yaml-file: .github/labels.yml
28+
dry-run: ${{ github.event_name == 'pull_request' }}
29+
exclude: |
30+
help*
31+
*issue
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release Ansible cross repository test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types: [opened] # Workflow will only be executed when PR is opened to main branch
8+
workflow_dispatch: # Manual trigger
9+
10+
11+
jobs:
12+
ansible_integration_test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout linode_api4 repository
16+
uses: actions/checkout@v4
17+
18+
- name: update packages
19+
run: sudo apt-get update -y
20+
21+
- name: install make
22+
run: sudo apt-get install -y build-essential
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: '3.10'
28+
29+
- name: checkout repo
30+
uses: actions/checkout@v3
31+
with:
32+
repository: linode/ansible_linode
33+
path: .ansible/collections/ansible_collections/linode/cloud
34+
35+
- name: install dependencies
36+
run: |
37+
cd .ansible/collections/ansible_collections/linode/cloud
38+
pip install -r requirements.txt -r requirements-dev.txt --upgrade-strategy only-if-needed
39+
40+
- name: install ansible dependencies
41+
run: ansible-galaxy collection install amazon.aws:==6.0.1
42+
43+
- name: install collection
44+
run: |
45+
cd .ansible/collections/ansible_collections/linode/cloud
46+
make install
47+
48+
- name: Install linode_api4 # Need to install from source after all ansible dependencies have been installed
49+
run: make install
50+
51+
- name: replace existing keys
52+
run: |
53+
cd .ansible/collections/ansible_collections/linode/cloud
54+
rm -rf ~/.ansible/test && mkdir -p ~/.ansible/test && ssh-keygen -m PEM -q -t rsa -N '' -f ~/.ansible/test/id_rsa
55+
56+
- name: Run Ansible Tests
57+
run: |
58+
cd .ansible/collections/ansible_collections/linode/cloud
59+
make testall
60+
env:
61+
LINODE_API_TOKEN: ${{ secrets.LINODE_TOKEN }}

.github/workflows/release-drafter.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8.10
1+
linode_api4-python

.readthedocs.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Read the Docs configuration file for Sphinx projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
version: 2
5+
build:
6+
os: ubuntu-lts-latest
7+
tools:
8+
python: latest
9+
sphinx:
10+
configuration: docs/conf.py
11+
python:
12+
install:
13+
- method: pip
14+
path: .
15+
extra_requirements:
16+
- doc

Makefile

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
PYTHON ?= python3
22

3-
INTEGRATION_TEST_PATH :=
43
TEST_CASE_COMMAND :=
5-
MODEL_COMMAND :=
4+
TEST_SUITE :=
5+
TEST_ARGS :=
66

77
LINODE_SDK_VERSION ?= "0.0.0.dev"
88
VERSION_MODULE_DOCSTRING ?= \"\"\"\nThe version of this linode_api4 package.\n\"\"\"\n\n
99
VERSION_FILE := ./linode_api4/version.py
1010

1111
ifdef TEST_CASE
12-
TEST_CASE_COMMAND = -k $(TEST_CASE)
12+
TEST_CASE_COMMAND = -k $(TEST_CASE)
1313
endif
1414

15-
ifdef TEST_MODEL
16-
MODEL_COMMAND = models/$(TEST_MODEL)
15+
ifdef TEST_SUITE
16+
ifneq ($(TEST_SUITE),linode_client)
17+
ifneq ($(TEST_SUITE),login_client)
18+
TEST_COMMAND = models/$(TEST_SUITE)
19+
else
20+
TEST_COMMAND = login_client
21+
endif
22+
else
23+
TEST_COMMAND = linode_client
24+
endif
1725
endif
1826

1927
.PHONY: clean
@@ -67,12 +75,12 @@ lint: build
6775

6876
.PHONY: testint
6977
testint:
70-
$(PYTHON) -m pytest test/integration/${INTEGRATION_TEST_PATH}${MODEL_COMMAND} ${TEST_CASE_COMMAND}
78+
$(PYTHON) -m pytest test/integration/${TEST_COMMAND} ${TEST_CASE_COMMAND} ${TEST_ARGS}
7179

7280
.PHONY: testunit
7381
testunit:
7482
$(PYTHON) -m pytest test/unit
7583

7684
.PHONY: smoketest
7785
smoketest:
78-
$(PYTHON) -m pytest -m smoke test/integration --disable-warnings
86+
$(PYTHON) -m pytest -m smoke test/integration

README.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,10 @@ Run the tests locally using the make command. Run the entire test suite using co
150150

151151
make testint
152152

153-
To run a specific package, use environment variable `INTEGRATION_TEST_PATH` with `testint` command::
153+
To run a specific package/suite, use the environment variable `TEST_SUITE` using directory names in `integration/...` folder ::
154154

155-
make INTEGRATION_TEST_PATH="linode_client" testint
156-
157-
To run a specific model test suite, set the environment variable `TEST_MODEL` using file name in `integration/models`::
158-
159-
make TEST_MODEL="test_account.py" testint
155+
make TEST_SUITE="account" testint // Runs tests in `integration/models/account` directory
156+
make TEST_SUITE="linode_client" testint // Runs tests in `integration/linode_client` directory
160157

161158
Lastly to run a specific test case use environment variable `TEST_CASE` with `testint` command::
162159

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# -- Project information -----------------------------------------------------
2121

2222
project = 'linode_api4'
23-
copyright = '2023, Linode'
23+
copyright = '2024, Akamai Technologies Inc.'
2424
author = 'Linode'
2525

2626
# The short X.Y version

docs/linode_api4/linode_client.rst

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@ Includes methods for managing your account.
6161
:members:
6262
:special-members:
6363

64+
BetaGroup
65+
^^^^^^^^^
66+
67+
Includes methods for enrolling in beta programs.
68+
69+
.. autoclass:: linode_api4.linode_client.BetaGroup
70+
:members:
71+
:special-members:
72+
6473
DatabaseGroup
6574
^^^^^^^^^^^^^
6675

@@ -98,7 +107,7 @@ accessing and working with associated features.
98107
:members:
99108
:special-members:
100109

101-
LKE Group
110+
LKEGroup
102111
^^^^^^^^^
103112

104113
Includes methods for interacting with Linode Kubernetes Engine.
@@ -199,3 +208,12 @@ Includes methods for managing Linode Volumes.
199208
.. autoclass:: linode_api4.linode_client.VolumeGroup
200209
:members:
201210
:special-members:
211+
212+
VPCGroup
213+
^^^^^^^^
214+
215+
Includes methods for managing Linode VPCs.
216+
217+
.. autoclass:: linode_api4.linode_client.VPCGroup
218+
:members:
219+
:special-members:

0 commit comments

Comments
 (0)