Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/e2e-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:

- name: Upload Test Report as Artifact
if: always()
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: test-report-file
if-no-files-found: ignore
Expand Down Expand Up @@ -252,7 +252,7 @@ jobs:
submodules: 'recursive'

- name: Download test report
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
name: test-report-file

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # pin@v3.12.0

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

- name: Build and push to DockerHub
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # pin@v6.18.0
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # pin@v6.19.2
with:
context: .
file: Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/remote-release-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

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

Expand Down
4 changes: 4 additions & 0 deletions linodecli/baked/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ def _parse_request_model(
for k, v in properties.items():
k = escape_arg_segment(k)

# Skip attributes with x-linode-cli-skip extension
if v.extensions.get("linode-cli-skip"):
continue

# Handle nested objects which aren't read-only and have properties
if (
v.type == "object"
Expand Down
4 changes: 4 additions & 0 deletions linodecli/baked/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ def _parse_response_model(schema, prefix=None, nested_list_depth=0):
for k, v in properties.items():
pref = prefix + "." + k if prefix else k

# Skip attributes with x-linode-cli-skip extension
if v.extensions.get("linode-cli-skip"):
continue

if (
v.type == "object"
and v.properties is None
Expand Down
138 changes: 138 additions & 0 deletions tests/fixtures/skip_attribute_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
openapi: 3.0.1
info:
title: API Specification for x-linode-cli-skip Tests
version: 1.0.0
servers:
- url: http://localhost/v4

paths:
/skip/test:
x-linode-cli-command: skip-test
get:
summary: Test GET with skipped response attributes
operationId: getSkipTest
x-linode-cli-action: list
description: List items with some attributes skipped
responses:
'200':
description: Successful response with skipped attributes
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/SkipTestResponse'
page:
$ref: '#/components/schemas/PaginationEnvelope/properties/page'
pages:
$ref: '#/components/schemas/PaginationEnvelope/properties/pages'
results:
$ref: '#/components/schemas/PaginationEnvelope/properties/results'
post:
summary: Create with skipped request attributes
operationId: createSkipTest
x-linode-cli-action: create
description: Create an item with some request attributes skipped
requestBody:
description: Parameters for creating the item
required: true
content:
application/json:
schema:
required:
- visible_field
allOf:
- $ref: '#/components/schemas/SkipTestRequest'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/SkipTestResponse'

components:
schemas:
PaginationEnvelope:
type: object
properties:
pages:
type: integer
readOnly: true
description: The total number of pages.
example: 1
page:
type: integer
readOnly: true
description: The current page.
example: 1
results:
type: integer
readOnly: true
description: The total number of results.
example: 1

SkipTestRequest:
type: object
description: Request object with skipped fields
properties:
visible_field:
type: string
description: This field should be visible
skipped_request_field:
type: string
x-linode-cli-skip: true
description: This field should be skipped in request
another_visible_field:
type: integer
description: Another visible field
skipped_both_field:
type: string
x-linode-cli-skip: true
description: This field should be skipped in both request and response
nested_object:
type: object
properties:
nested_visible_field:
type: string
description: This nested field should be visible
nested_skipped_field:
type: string
x-linode-cli-skip: true
description: This nested field should be skipped

SkipTestResponse:
type: object
description: Response object with skipped fields
properties:
id:
type: integer
readOnly: true
description: The unique ID
visible_field:
type: string
description: This field should be visible
skipped_response_field:
type: string
x-linode-cli-skip: true
description: This field should be skipped in response
another_visible_field:
type: integer
description: Another visible field
skipped_both_field:
type: string
x-linode-cli-skip: true
description: This field should be skipped in both request and response
nested_object:
type: object
properties:
nested_visible_field:
type: string
description: This nested field should be visible
nested_skipped_field:
type: string
x-linode-cli-skip: true
description: This nested field should be skipped
Loading
Loading