Skip to content

Commit 74d80f7

Browse files
authored
Merge branch 'dev' into proj/nb-front-end-ip-in-vpc
2 parents 5cca11f + f16d5e8 commit 74d80f7

11 files changed

Lines changed: 107 additions & 17 deletions

File tree

.github/labels.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
- name: security
3030
description: for security fixes and improvements in the changelog.
3131
color: AA1111
32+
- name: community-contribution
33+
description: contributions from the community.
34+
color: 22ee47
35+
- name: hotfix
36+
description: urgent fixes for production issues.
37+
color: ff0000
3238
- name: ignore-for-release
3339
description: PRs you do not want to render in the changelog
3440
color: 7b8eac

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
uses: actions/checkout@v7
4646

4747
- name: setup python 3
48-
uses: actions/setup-python@v6
48+
uses: actions/setup-python@v7
4949
with:
5050
python-version: '3.x'
5151

@@ -62,7 +62,7 @@ jobs:
6262
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
6363
steps:
6464
- uses: actions/checkout@v7
65-
- uses: actions/setup-python@v6
65+
- uses: actions/setup-python@v7
6666
with:
6767
python-version: ${{ matrix.python-version }}
6868
- name: Run tests

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9797

9898
- name: Setup Python
99-
uses: actions/setup-python@v6
99+
uses: actions/setup-python@v7
100100
with:
101101
python-version: '3.x'
102102

@@ -196,7 +196,7 @@ jobs:
196196

197197
steps:
198198
- name: Set up Python
199-
uses: actions/setup-python@v6
199+
uses: actions/setup-python@v7
200200
with:
201201
python-version: '3.x'
202202

.github/workflows/e2e-test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
submodules: 'recursive'
8888

8989
- name: Setup Python
90-
uses: actions/setup-python@v6
90+
uses: actions/setup-python@v7
9191
with:
9292
python-version: ${{ inputs.run-eol-python-version == 'true' && env.EOL_PYTHON_VERSION || inputs.python-version || env.DEFAULT_PYTHON_VERSION }}
9393

@@ -161,7 +161,7 @@ jobs:
161161

162162
steps:
163163
- name: Set up Python
164-
uses: actions/setup-python@v6
164+
uses: actions/setup-python@v7
165165
with:
166166
python-version: '3.x'
167167

@@ -210,7 +210,7 @@ jobs:
210210
name: test-report-file
211211

212212
- name: Set up Python
213-
uses: actions/setup-python@v6
213+
uses: actions/setup-python@v7
214214
with:
215215
python-version: '3.x'
216216

@@ -253,7 +253,7 @@ jobs:
253253
steps:
254254
- name: Notify Slack
255255
id: main_message
256-
uses: slackapi/slack-github-action@v3
256+
uses: slackapi/slack-github-action@v4
257257
with:
258258
method: chat.postMessage
259259
token: ${{ secrets.SLACK_BOT_TOKEN }}
@@ -285,7 +285,7 @@ jobs:
285285
286286
- name: Test summary thread
287287
if: success()
288-
uses: slackapi/slack-github-action@v3
288+
uses: slackapi/slack-github-action@v4
289289
with:
290290
method: chat.postMessage
291291
token: ${{ secrets.SLACK_BOT_TOKEN }}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
ref: dev
2525

2626
- name: Set up Python
27-
uses: actions/setup-python@v6
27+
uses: actions/setup-python@v7
2828
with:
2929
python-version: '3.x'
3030

@@ -45,7 +45,7 @@ jobs:
4545

4646
- name: Notify Slack
4747
if: always() && github.repository == 'linode/linode_api4-python'
48-
uses: slackapi/slack-github-action@v3
48+
uses: slackapi/slack-github-action@v4
4949
with:
5050
method: chat.postMessage
5151
token: ${{ secrets.SLACK_BOT_TOKEN }}

.github/workflows/publish-pypi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: actions/checkout@v7
1616

1717
- name: Setup Python
18-
uses: actions/setup-python@v6
18+
uses: actions/setup-python@v7
1919
with:
2020
python-version: '3.x'
2121

@@ -28,4 +28,4 @@ jobs:
2828
LINODE_SDK_VERSION: ${{ github.event.release.tag_name }}
2929

3030
- name: Publish the release artifacts to PyPI
31-
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # pin@release/v1.14.0
31+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # pin@release/v1.14.2

.github/workflows/release-cross-repo-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run: sudo apt-get install -y build-essential
2626

2727
- name: Set up Python
28-
uses: actions/setup-python@v6
28+
uses: actions/setup-python@v7
2929
with:
3030
python-version: '3.10'
3131

.github/workflows/release-notify-slack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- name: Notify Slack - Main Message
1313
id: main_message
14-
uses: slackapi/slack-github-action@v3
14+
uses: slackapi/slack-github-action@v4
1515
with:
1616
method: chat.postMessage
1717
token: ${{ secrets.SLACK_BOT_TOKEN }}

AGENTS.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Agent Guide
2+
3+
## Source of Truth
4+
5+
- This is the official synchronous Python SDK for the Linode API. Supported
6+
Python versions come from [pyproject.toml](pyproject.toml) (`>=3.10`); do not
7+
infer support from the older environment names still present in [tox.ini](tox.ini).
8+
- Make changes only in canonical source trees such as `linode_api4/`, `test/`,
9+
`docs/`, `examples/`, and `.github/`. Do not edit generated copies or output in
10+
`build/`, `dist/`, `docs/build/`, `docs/_build/`, or `linode_api4.egg-info/`.
11+
- `linode_api4/version.py` is generated by `make create-version` and `make build`.
12+
Do not hand-edit it for ordinary feature work.
13+
- Use [README.rst](README.rst) for setup and test details and
14+
[CONTRIBUTING.md](CONTRIBUTING.md) for contribution policy. Keep this file
15+
limited to guidance that is easy to miss while navigating the repository.
16+
17+
## Architecture and Implementation
18+
19+
- `linode_api4/linode_client.py` owns HTTP behavior and wires API groups onto
20+
`LinodeClient`; `linode_api4/groups/` exposes operations; `linode_api4/objects/`
21+
defines resource models; `linode_api4/paginated_list.py` handles collection
22+
pagination.
23+
- Follow the nearest existing group method, model, and unit test before adding a
24+
new pattern. Collection methods normally use `client._get_and_filter(...)`;
25+
create/update/delete methods use the client's request helpers and return model
26+
objects where appropriate.
27+
- Models are lazy-loaded, and reading an unknown or stale property may issue an
28+
API request. Read [docs/guides/core_concepts.rst](docs/guides/core_concepts.rst)
29+
before changing model properties, relationships, filtering, or pagination.
30+
- New public models must be exported from `linode_api4/objects/__init__.py`. New
31+
groups must be exported from `linode_api4/groups/__init__.py` and wired into
32+
`LinodeClient`. Preserve public API compatibility unless the task explicitly
33+
requires a breaking change.
34+
- Public behavior belongs in Sphinx-compatible docstrings and, when needed, the
35+
source files under `docs/`. Never edit rendered documentation.
36+
37+
## Tests
38+
39+
- Start with the narrowest relevant unit test, for example
40+
`python -m pytest test/unit/objects/linode_test.py -k test_name`. Run
41+
`make test-unit` for the full mocked unit suite.
42+
- Unit tests normally extend `test.unit.base.ClientBaseCase`. GET requests are
43+
resolved from JSON under `test/fixtures/`; use `mock_post`, `mock_put`, and
44+
`mock_delete` for other verbs and assert the captured URL, body, or headers.
45+
- Fixture names encode endpoint paths: a single underscore becomes `/`, while a
46+
doubled underscore becomes a literal `_`. Paginated fixtures containing
47+
`results` also provide per-ID responses automatically when items include an
48+
`id` field. See
49+
`test/unit/fixtures.py` before inventing custom request mocking.
50+
- `make test-int` and `make test-smoke` call the live Linode API, require
51+
`LINODE_TOKEN`, and may create or delete real resources. Run them only when the
52+
change requires live validation and the environment is intentionally configured.
53+
54+
## Formatting and Validation
55+
56+
- Install development dependencies with `make dev-install`.
57+
- Formatting is Black + isort + autoflake with settings in [pyproject.toml](pyproject.toml).
58+
`make format` rewrites all of `linode_api4/` and `test/`, so review the worktree
59+
before and after using it for a focused change.
60+
- `make lint` is the broad CI-equivalent check: it builds distributions, checks
61+
formatting/imports, runs pylint, and validates package metadata. Prefer focused
62+
tests first because this target regenerates build artifacts and version metadata.
63+
64+
## Pull Requests
65+
66+
- Target the `dev` branch unless the task specifies otherwise.
67+
- PR titles must use `TPT-1234: Description`; CI exempts only the labels documented
68+
in [.github/workflows/ci.yml](.github/workflows/ci.yml).
69+
- Keep changes focused, add tests for behavior changes, and use
70+
[.github/pull_request_template.md](.github/pull_request_template.md) when drafting
71+
the PR description.

test/integration/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ def test_linode_client():
295295
token,
296296
base_url=api_url,
297297
ca_path=api_ca_file,
298+
retry_statuses=[504],
298299
)
299300
return client
300301

0 commit comments

Comments
 (0)