Skip to content

Commit

Permalink
Merge branch 'branches/rudder/8.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
clarktsiory committed Oct 21, 2024
2 parents 167f77a + 2faf131 commit 150b63a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
15 changes: 8 additions & 7 deletions api-doc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
for template in templates:
with open(template, 'r') as content_file:
main = yaml.load(content_file.read(), Loader=yaml.FullLoader)

################################################################################
# Lint doc using redocly (on split files to allow correct file reports)
if subprocess.call(['npx', 'redocly', 'lint', template]):
print('Linter failed on %s' % (template))
exit(1)

version = main['info']['version']
intro_file = main['info']['description']

Expand All @@ -40,18 +47,12 @@
# Dump target in target .yml file
src_openapi_file = template.replace('.src', '')
with open(src_openapi_file, 'w') as file:
documents = yaml.dump(main, file)
yaml.dump(main, file)

target = '%s/%s/%s' % (target_dir, api, version)

print('Built %s' % (src_openapi_file))

################################################################################
# Lint doc using redocly (on split files to allow correct file reports)
if subprocess.call(['npx', 'redocly', 'lint', src_openapi_file]):
print('Linter failed on %s' % (src_openapi_file))
exit(1)

################################################################################
# Build final OpenAPI spec files using redocly
for format in ["yml", "json"]:
Expand Down
2 changes: 1 addition & 1 deletion api-doc/redocly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rules:
no-invalid-media-type-examples:
severity: 'error'
allowAdditionalProperties: false
no-server-example.com: 'error'
no-server-example.com: 'warn' # we should migrate away from localhost as server url
no-unused-components: 'error'

theme:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl LinuxPackageManager for ZypperPackageManager {

fn upgrade(&mut self, packages: Vec<PackageSpec>) -> ResultOutput<()> {
let mut c = Command::new("zypper");
c.arg("--non-interactive").arg("--name").arg("update");
c.arg("--non-interactive").arg("update");
c.args(packages.into_iter().map(Self::package_spec_as_argument));
let res_update = ResultOutput::command(c);
res_update.clear_ok()
Expand Down
7 changes: 4 additions & 3 deletions webapp/sources/api-doc/openapi.src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,10 @@ paths:
"/nodes/status":
$ref: paths/nodes/status.yml
"/nodes/pending":
$ref: paths/nodes/pending-all.yml
"/nodes/pending":
$ref: paths/nodes/pending-update.yml
get:
$ref: paths/nodes/pending-all.yml
post:
$ref: paths/nodes/pending-update.yml
"/nodes/{nodeId}":
$ref: paths/nodes/id.yml
"/nodes/pending/{nodeId}":
Expand Down
1 change: 0 additions & 1 deletion webapp/sources/api-doc/paths/nodes/pending-all.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: CC-BY-SA-2.0
# SPDX-FileCopyrightText: 2013-2020 Normation SAS
get:
summary: List pending nodes
description: Get information about the nodes pending acceptation
operationId: listPendingNodes
Expand Down
1 change: 0 additions & 1 deletion webapp/sources/api-doc/paths/nodes/pending-update.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: CC-BY-SA-2.0
# SPDX-FileCopyrightText: 2013-2024 Normation SAS
post:
summary: Update pending nodes status
description: Accept or refuse one or many pending nodes
operationId: changePendingNodesStatus
Expand Down

0 comments on commit 150b63a

Please sign in to comment.