Skip to content

HYPERFLEET-1246: Add missing kind field to NodePool creation example#7

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift-hyperfleet:mainfrom
kuudori:HYPERFLEET-1246-nodepool-kind
Jun 23, 2026
Merged

HYPERFLEET-1246: Add missing kind field to NodePool creation example#7
openshift-merge-bot[bot] merged 1 commit into
openshift-hyperfleet:mainfrom
kuudori:HYPERFLEET-1246-nodepool-kind

Conversation

@kuudori

@kuudori kuudori commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Added missing kind: "NodePool" to the NodePool creation Swagger example
  • Version bump 1.0.23 → 1.0.24

Context

Same bug as openshift-hyperfleet/hyperfleet-api-spec#61 — NodePool create example was missing the mandatory kind field.

Test plan

  • ./build-schema.sh passes
  • Swagger UI shows kind: NodePool in NodePool creation example

@openshift-ci openshift-ci Bot requested review from ciaranRoche and mbrudnoy June 22, 2026 16:23
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: aa269a58-478b-47a0-8353-c2edf95c2110

📥 Commits

Reviewing files that changed from the base of the PR and between 4241f0f and ab5fab2.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • main.tsp
  • models/nodepool/example_post.tsp
  • schemas/template/openapi.yaml
  • schemas/template/swagger.yaml
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift-hyperfleet/architecture (manual)
  • openshift-hyperfleet/hyperfleet-api (manual)
  • openshift-hyperfleet/hyperfleet-sentinel (manual)
  • openshift-hyperfleet/hyperfleet-adapter (manual)
  • openshift-hyperfleet/hyperfleet-broker (manual)
✅ Files skipped from review due to trivial changes (4)
  • main.tsp
  • models/nodepool/example_post.tsp
  • schemas/template/openapi.yaml
  • CHANGELOG.md

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Fixed the NodePool creation example by adding the missing top-level kind: "NodePool" field.
  • Documentation
    • Bumped API/service and specification versions to 1.0.24.
    • Updated OpenAPI/Swagger examples to include kind: NodePool.
    • Refreshed the changelog entry and version comparison links.

Walkthrough

Release 1.0.24 increments service version in main.tsp and schema versions in openapi.yaml and swagger.yaml from 1.0.23 to 1.0.24. The NodePool creation request example is corrected by adding a missing top-level kind: "NodePool" field in the TypeSpec source and in both OpenAPI and Swagger generated specifications. CHANGELOG.md documents the fix and updates version comparison links.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5 | ❌ 6

❌ Failed checks (6 inconclusive)

Check name Status Explanation Resolution
Sec-02: Secrets In Log Output ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
No Hardcoded Secrets ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
No Weak Cryptography ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
No Injection Vectors ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
No Privileged Containers ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
No Pii Or Sensitive Data In Logs ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and accurately summarizes the main change: adding the missing kind field to the NodePool creation example, with a version bump.
Description check ✅ Passed The description is directly related to the changeset, clearly explaining the bug fix, version bump, and test verification for the NodePool kind field addition.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
schemas/template/openapi.yaml (1)

1865-1892: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

NodePoolCreateRequest.kind remains unenforced in schema (CWE-20).

Line 1892 adds kind only to example data. The schema still does not require kind (Line 1865) and does not constrain its value (Line 1872). Linked API tests already enforce kind required and equal to NodePool, so contract and runtime validation remain inconsistent.

Suggested schema fix
    NodePoolCreateRequest:
      type: object
      required:
+       - kind
        - name
        - spec
      properties:
        kind:
          type: string
+         enum:
+           - NodePool

As per coding guidelines, "Validate input at system boundaries (HTTP handlers, CLI parsers, webhook receivers)."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@schemas/template/openapi.yaml` around lines 1865 - 1892, The
NodePoolCreateRequest schema does not properly enforce the `kind` field,
creating a mismatch with runtime validation. Add `kind` to the required list
(currently only containing "name" and "spec") and add an enum constraint to the
`kind` property definition to restrict its value to "NodePool". This ensures the
OpenAPI schema accurately reflects the actual API contract that API tests and
handlers are enforcing.

Sources: Coding guidelines, Linked repositories

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Around line 10-15: The CHANGELOG.md entry for version 1.0.24 is incomplete and
only documents the NodePool example fix. Update the changelog entry to include
all contract changes that were shipped in this release, specifically adding the
error modeling changes, list response requirements changes, and pagination
parameter constraints changes under the appropriate sections (Fixed, Changed,
etc.) to ensure downstream integrators have complete visibility into all
modifications in this release.

In `@schemas/template/openapi.yaml`:
- Around line 42-49: The explicit 4xx error responses (400, 404, and 409) in the
OpenAPI schema currently only include descriptions without response body
schemas, while the default response correctly defines an
application/problem+json content type with an Error schema reference. Since
explicit status codes take precedence in OpenAPI, clients cannot properly parse
typed error bodies for these known failure cases. Add the content block
containing the application/problem+json schema reference from the default
response to each of the explicit 4xx responses (at lines 42-49 for 400, lines
68-73 for 404, and lines 1034-1038 for 409) so that clients receive consistent
typed error information for these specific status codes.
- Around line 1294-1301: Remove `kind` from the required fields list in all list
response schemas. The required array appears at lines 1294, 1533, 1988, 2383,
and 2565 in the OpenAPI schema. In each of these locations, delete `kind` from
the required fields array (keeping page, size, total, and items as required)
since the current implementation in the hyperfleet-api list builders does not
set the `kind` field, causing schema validation failures in clients and mocks at
runtime.

---

Outside diff comments:
In `@schemas/template/openapi.yaml`:
- Around line 1865-1892: The NodePoolCreateRequest schema does not properly
enforce the `kind` field, creating a mismatch with runtime validation. Add
`kind` to the required list (currently only containing "name" and "spec") and
add an enum constraint to the `kind` property definition to restrict its value
to "NodePool". This ensures the OpenAPI schema accurately reflects the actual
API contract that API tests and handlers are enforcing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 131bfeb6-fa49-4cd2-84c3-b73a5c19071e

📥 Commits

Reviewing files that changed from the base of the PR and between 421b446 and 4241f0f.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • main.tsp
  • models/nodepool/example_post.tsp
  • schemas/template/openapi.yaml
  • schemas/template/swagger.yaml
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift-hyperfleet/architecture (manual)
  • openshift-hyperfleet/hyperfleet-api (manual)
  • openshift-hyperfleet/hyperfleet-sentinel (manual)
  • openshift-hyperfleet/hyperfleet-adapter (manual)
  • openshift-hyperfleet/hyperfleet-broker (manual)

Comment thread CHANGELOG.md
Comment thread schemas/template/openapi.yaml Outdated
Comment thread schemas/template/openapi.yaml Outdated
…ample

The Swagger UI example for NodePool creation was missing the mandatory
kind field, causing users to get a validation error when copying the
example payload.
@kuudori kuudori force-pushed the HYPERFLEET-1246-nodepool-kind branch from 4241f0f to ab5fab2 Compare June 23, 2026 13:34
@rh-amarin

Copy link
Copy Markdown
Collaborator

/lgtm

@openshift-ci

openshift-ci Bot commented Jun 23, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rh-amarin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot Bot merged commit 25d89d9 into openshift-hyperfleet:main Jun 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants