Skip to content

Commit ad65140

Browse files
Merge pull request #864 from linode/dev
Release v5.66.0
2 parents 4e7aa1c + 4c28406 commit ad65140

16 files changed

Lines changed: 906 additions & 26 deletions

.github/workflows/e2e-suite.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135

136136
- name: Upload Test Report as Artifact
137137
if: always()
138-
uses: actions/upload-artifact@v6
138+
uses: actions/upload-artifact@v7
139139
with:
140140
name: test-report-file
141141
if-no-files-found: ignore
@@ -252,7 +252,7 @@ jobs:
252252
submodules: 'recursive'
253253

254254
- name: Download test report
255-
uses: actions/download-artifact@v7
255+
uses: actions/download-artifact@v8
256256
with:
257257
name: test-report-file
258258

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # pin@v3.12.0
4646

4747
- name: Login to Docker Hub
48-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # pin@v3.6.0
48+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # pin@v3.7.0
4949
with:
5050
username: ${{ secrets.DOCKERHUB_USERNAME }}
5151
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -67,7 +67,7 @@ jobs:
6767
result-encoding: string
6868

6969
- name: Build and push to DockerHub
70-
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # pin@v6.18.0
70+
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # pin@v6.19.2
7171
with:
7272
context: .
7373
file: Dockerfile

.github/workflows/remote-release-trigger.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
- name: Get previous tag
2525
id: previoustag
26-
uses: WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce # pin@v1
26+
uses: WyriHaximus/github-action-get-previous-tag@61819f33034117e6c686e6a31dba995a85afc9de # pin@v2.0.0
2727
env:
2828
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929

linodecli/baked/request.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ def _parse_request_model(
160160
for k, v in properties.items():
161161
k = escape_arg_segment(k)
162162

163+
# Skip attributes with x-linode-cli-skip extension
164+
if v.extensions.get("linode-cli-skip"):
165+
continue
166+
163167
# Handle nested objects which aren't read-only and have properties
164168
if (
165169
v.type == "object"

linodecli/baked/response.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ def _parse_response_model(schema, prefix=None, nested_list_depth=0):
193193
for k, v in properties.items():
194194
pref = prefix + "." + k if prefix else k
195195

196+
# Skip attributes with x-linode-cli-skip extension
197+
if v.extensions.get("linode-cli-skip"):
198+
continue
199+
196200
if (
197201
v.type == "object"
198202
and v.properties is None
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
openapi: 3.0.1
2+
info:
3+
title: API Specification for x-linode-cli-skip Tests
4+
version: 1.0.0
5+
servers:
6+
- url: http://localhost/v4
7+
8+
paths:
9+
/skip/test:
10+
x-linode-cli-command: skip-test
11+
get:
12+
summary: Test GET with skipped response attributes
13+
operationId: getSkipTest
14+
x-linode-cli-action: list
15+
description: List items with some attributes skipped
16+
responses:
17+
'200':
18+
description: Successful response with skipped attributes
19+
content:
20+
application/json:
21+
schema:
22+
type: object
23+
properties:
24+
data:
25+
type: array
26+
items:
27+
$ref: '#/components/schemas/SkipTestResponse'
28+
page:
29+
$ref: '#/components/schemas/PaginationEnvelope/properties/page'
30+
pages:
31+
$ref: '#/components/schemas/PaginationEnvelope/properties/pages'
32+
results:
33+
$ref: '#/components/schemas/PaginationEnvelope/properties/results'
34+
post:
35+
summary: Create with skipped request attributes
36+
operationId: createSkipTest
37+
x-linode-cli-action: create
38+
description: Create an item with some request attributes skipped
39+
requestBody:
40+
description: Parameters for creating the item
41+
required: true
42+
content:
43+
application/json:
44+
schema:
45+
required:
46+
- visible_field
47+
allOf:
48+
- $ref: '#/components/schemas/SkipTestRequest'
49+
responses:
50+
'200':
51+
description: Successful response
52+
content:
53+
application/json:
54+
schema:
55+
$ref: '#/components/schemas/SkipTestResponse'
56+
57+
components:
58+
schemas:
59+
PaginationEnvelope:
60+
type: object
61+
properties:
62+
pages:
63+
type: integer
64+
readOnly: true
65+
description: The total number of pages.
66+
example: 1
67+
page:
68+
type: integer
69+
readOnly: true
70+
description: The current page.
71+
example: 1
72+
results:
73+
type: integer
74+
readOnly: true
75+
description: The total number of results.
76+
example: 1
77+
78+
SkipTestRequest:
79+
type: object
80+
description: Request object with skipped fields
81+
properties:
82+
visible_field:
83+
type: string
84+
description: This field should be visible
85+
skipped_request_field:
86+
type: string
87+
x-linode-cli-skip: true
88+
description: This field should be skipped in request
89+
another_visible_field:
90+
type: integer
91+
description: Another visible field
92+
skipped_both_field:
93+
type: string
94+
x-linode-cli-skip: true
95+
description: This field should be skipped in both request and response
96+
nested_object:
97+
type: object
98+
properties:
99+
nested_visible_field:
100+
type: string
101+
description: This nested field should be visible
102+
nested_skipped_field:
103+
type: string
104+
x-linode-cli-skip: true
105+
description: This nested field should be skipped
106+
107+
SkipTestResponse:
108+
type: object
109+
description: Response object with skipped fields
110+
properties:
111+
id:
112+
type: integer
113+
readOnly: true
114+
description: The unique ID
115+
visible_field:
116+
type: string
117+
description: This field should be visible
118+
skipped_response_field:
119+
type: string
120+
x-linode-cli-skip: true
121+
description: This field should be skipped in response
122+
another_visible_field:
123+
type: integer
124+
description: Another visible field
125+
skipped_both_field:
126+
type: string
127+
x-linode-cli-skip: true
128+
description: This field should be skipped in both request and response
129+
nested_object:
130+
type: object
131+
properties:
132+
nested_visible_field:
133+
type: string
134+
description: This nested field should be visible
135+
nested_skipped_field:
136+
type: string
137+
x-linode-cli-skip: true
138+
description: This nested field should be skipped

tests/integration/linodes/fixtures.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ def linode_instance_disk_tests(linode_cloud_firewall):
259259
)
260260

261261
retry_exec_test_command_with_delay(
262-
BASE_CMDS["linodes"] + ["shutdown", linode_id]
262+
BASE_CMDS["linodes"] + ["shutdown", linode_id],
263+
retries=10,
264+
delay=15,
263265
)
264266

265267
wait_until(linode_id=linode_id, timeout=240, status="offline")

tests/integration/linodes/test_disk.py

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import json
2+
13
from tests.integration.helpers import (
24
BASE_CMDS,
35
assert_headers_in_lines,
@@ -14,10 +16,51 @@
1416
)
1517

1618

19+
def _get_smallest_disk_id(linode_id):
20+
"""Return the disk ID of the smallest disk (e.g. swap) on the Linode."""
21+
disks_json = exec_test_command(
22+
BASE_CMDS["linodes"]
23+
+ [
24+
"disks-list",
25+
linode_id,
26+
"--json",
27+
]
28+
)
29+
disks = json.loads(disks_json)
30+
smallest = min(disks, key=lambda d: d["size"])
31+
return str(smallest["id"])
32+
33+
1734
def test_disk_resize_clone_and_create(linode_instance_disk_tests):
1835
linode_id = linode_instance_disk_tests
1936

20-
disk_id = get_disk_ids(linode_id=linode_id)[0]
37+
# Ensure disks are available
38+
def disks_ready():
39+
return len(get_disk_ids(linode_id=linode_id)) >= 2
40+
41+
wait_for_condition(10, 120, disks_ready)
42+
43+
# Use the smallest disk (swap) for resize/clone — the main OS disk
44+
# is too large to shrink to 50 MB because it contains filesystem data.
45+
disk_id = _get_smallest_disk_id(linode_id)
46+
47+
def disk_poll_func():
48+
status = exec_test_command(
49+
BASE_CMDS["linodes"]
50+
+ [
51+
"disk-view",
52+
linode_id,
53+
disk_id,
54+
"--text",
55+
"--no-headers",
56+
"--format=status",
57+
]
58+
)
59+
60+
return status.strip() == "ready"
61+
62+
# Make sure the disk is ready before resizing
63+
wait_for_condition(15, 300, disk_poll_func)
2164

2265
# resize disk
2366
retry_exec_test_command_with_delay(
@@ -29,27 +72,30 @@ def test_disk_resize_clone_and_create(linode_instance_disk_tests):
2972
"--size",
3073
"50",
3174
],
32-
retries=3,
33-
delay=10,
75+
retries=10,
76+
delay=15,
3477
)
3578

36-
def disk_poll_func():
37-
status = exec_test_command(
79+
# Wait for the disk to be ready after resize
80+
wait_for_condition(15, 300, disk_poll_func)
81+
82+
def disk_size_poll_func():
83+
size = exec_test_command(
3884
BASE_CMDS["linodes"]
3985
+ [
4086
"disk-view",
4187
linode_id,
4288
disk_id,
4389
"--text",
4490
"--no-headers",
45-
"--format=status",
91+
"--format=size",
4692
]
4793
)
4894

49-
return status == "ready"
95+
return size.strip() == "50"
5096

51-
# Wait for the instance to be ready
52-
wait_for_condition(15, 150, disk_poll_func)
97+
# Verify the resize actually took effect
98+
wait_for_condition(15, 300, disk_size_poll_func)
5399

54100
# clone disk
55101
res = retry_exec_test_command_with_delay(
@@ -60,8 +106,8 @@ def disk_poll_func():
60106
disk_id,
61107
"--text",
62108
],
63-
retries=3,
64-
delay=10,
109+
retries=10,
110+
delay=15,
65111
)
66112

67113
headers = ["id", "label", "status", "size", "filesystem", "disk_encryption"]

0 commit comments

Comments
 (0)