Skip to content

HYPERFLEET-1143 - chore: remove kind from list schemas#58

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift-hyperfleet:mainfrom
tirthct:hyperfleet-1143
Jun 2, 2026
Merged

HYPERFLEET-1143 - chore: remove kind from list schemas#58
openshift-merge-bot[bot] merged 1 commit into
openshift-hyperfleet:mainfrom
tirthct:hyperfleet-1143

Conversation

@tirthct
Copy link
Copy Markdown
Contributor

@tirthct tirthct commented Jun 2, 2026

Summary

  • Remove kind from ClusterList, NodePoolList, AdapterStatusList, and ResourceList schemas
  • The field is redundant — callers already know the resource type from the endpoint URL
  • Individual resource kind fields (e.g. Cluster, NodePool) are unchanged

Changes

  • shared/models/common/model.tsp — removed kind: string from generic List<T> model
  • shared/models/resource/model.tsp — removed kind: string from ResourceList (inline definition)
  • shared/models/statuses/example_adapter_status.tsp — removed kind from example constant
  • main.tsp — version bump to 1.0.21
  • schemas/core/openapi.yaml — regenerated

Breaking Change

List endpoints no longer return a kind field in the response body. The hyperfleet-api repo must be updated after this release:

  • Bump api-spec dependency to v1.0.21
  • Run make generate-all
  • Remove Kind assignments from handlers (cluster.go, node_pool.go, cluster_nodepools.go, cluster_status.go, nodepool_status.go)
  • Remove Kind from presenters/resource.go and presenters/slice_filter.go
  • Update test assertions in presenter_test.go and resource_test.go

Test plan

  • TypeSpec compiles without errors
  • spectral lint passes
  • kind absent from all *List schemas in generated OpenAPI
  • kind still present on individual resource schemas

@openshift-ci openshift-ci Bot requested review from aredenba-rh and rafabene June 2, 2026 19:09
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Version Updates

    • Released version 1.0.21
  • API Changes

    • Removed the kind field from all paginated list responses, including clusters, node pools, adapter statuses, and resources. This simplifies API interactions and ensures consistency across all list endpoints for improved clarity and usability.

Walkthrough

Version 1.0.21 removes the kind field from list response schemas across the HyperFleet API. The generic List<T> model in TypeSpec and all derived list schemas (AdapterStatusList, ClusterList, NodePoolList, ResourceList) no longer expose a kind property. All model definitions, OpenAPI specifications, examples, and version metadata have been updated consistently, with a changelog entry documenting the removal (HYPERFLEET-1143).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: removing the kind property from list schemas as tracked by HYPERFLEET-1143.
Description check ✅ Passed The description comprehensively explains the rationale, changes, breaking change impact, and test plan—all directly related to the changeset.
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.
Sec-02: Secrets In Log Output ✅ Passed No log statements (slog, log, logr, zap, fmt.Print*) found in non-test code. The only Go file (schemas/schemas.go) contains no logging. PR modifies TypeSpec schemas and configuration only.

✏️ 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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

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

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

1689-1715: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Coordinate this list-schema break with downstream repos before release.

The linked openshift-hyperfleet/hyperfleet-api repo still serializes Kind in these list responses, and its presenters/tests still assert it. openshift-hyperfleet/hyperfleet-sentinel mocks also still expect list kind. Publishing this OpenAPI ahead of those follow-up changes will put the released contract out of sync with real producers/consumers on day one. Please block the release until the dependent PRs land, or keep a compatibility field for one version.

As per coding guidelines, "Validate changes against HyperFleet architecture standards from the linked architecture repository."

Also applies to: 1914-1935, 2265-2285, 2593-2613

🤖 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/core/openapi.yaml` around lines 1689 - 1715, The new Array-list
schema AdapterStatusList removes the legacy list-level "kind" which will break
downstream repos (e.g., hyperfleet-api presenters/tests and hyperfleet-sentinel
mocks); either coordinate and block the release until those dependent PRs land
or make the change backward-compatible by adding an optional "kind" property to
the list schemas (e.g., AdapterStatusList and the other list schemas referenced)
with the same string value consumers expect and update the examples; ensure the
schema names (AdapterStatusList and the other list types at the other ranges)
include this optional field so existing serializers/tests continue to pass until
downstream repos are updated.
🤖 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 entry for version 1.0.21 removes the `kind`
property from the list response schemas (ClusterList, NodePoolList,
AdapterStatusList, ResourceList) but omits required downstream migration steps;
update the CHANGELOG.md entry to list explicit upgrade actions for consumers:
describe updating the `hyperfleet-api` handler/presenter and their tests to stop
expecting `kind`, and updating sentinel mock implementations/tests to reflect
the schema change (include example checklist or bullet points for
handler/presenter/test updates and sentinel mock/test changes), and add a brief
note that this is a breaking change so consumers must update before adopting the
tag.

In `@main.tsp`:
- Around line 32-33: The release version in the manifest (the version field set
to "1.0.21") must be bumped to a breaking-major version because removing `kind`
from all `*List` responses is a wire-contract break; update the version string
to the next major (e.g., "2.0.0") in the same location where version: "1.0.21"
is declared so consumers can recognize the breaking change and ensure the change
complies with HyperFleet architecture validation rules.

---

Outside diff comments:
In `@schemas/core/openapi.yaml`:
- Around line 1689-1715: The new Array-list schema AdapterStatusList removes the
legacy list-level "kind" which will break downstream repos (e.g., hyperfleet-api
presenters/tests and hyperfleet-sentinel mocks); either coordinate and block the
release until those dependent PRs land or make the change backward-compatible by
adding an optional "kind" property to the list schemas (e.g., AdapterStatusList
and the other list schemas referenced) with the same string value consumers
expect and update the examples; ensure the schema names (AdapterStatusList and
the other list types at the other ranges) include this optional field so
existing serializers/tests continue to pass until downstream repos are updated.
🪄 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: b9743276-1a13-4306-891f-c85c0c3ce768

📥 Commits

Reviewing files that changed from the base of the PR and between 61f6091 and d30ae93.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • main.tsp
  • schemas/core/openapi.yaml
  • shared/models/common/model.tsp
  • shared/models/resource/model.tsp
  • shared/models/statuses/example_adapter_status.tsp
💤 Files with no reviewable changes (3)
  • shared/models/statuses/example_adapter_status.tsp
  • shared/models/resource/model.tsp
  • shared/models/common/model.tsp

Comment thread CHANGELOG.md
Comment on lines +10 to +15
## [1.0.21] - 2026-06-02

### Removed

- `kind` property from `ClusterList`, `NodePoolList`, `AdapterStatusList`, and `ResourceList` list response schemas (HYPERFLEET-1143)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Document the downstream migration steps in this release note.

This entry says the field was removed, but it omits the concrete follow-up required by known consumers (hyperfleet-api handler/presenter/test updates, plus sentinel mock/test updates). For a breaking contract change, the changelog should include the upgrade steps so downstream teams do not pick up the tag without the required code changes.

Also applies to: 203-204

🤖 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 `@CHANGELOG.md` around lines 10 - 15, The changelog entry for version 1.0.21
removes the `kind` property from the list response schemas (ClusterList,
NodePoolList, AdapterStatusList, ResourceList) but omits required downstream
migration steps; update the CHANGELOG.md entry to list explicit upgrade actions
for consumers: describe updating the `hyperfleet-api` handler/presenter and
their tests to stop expecting `kind`, and updating sentinel mock
implementations/tests to reflect the schema change (include example checklist or
bullet points for handler/presenter/test updates and sentinel mock/test
changes), and add a brief note that this is a breaking change so consumers must
update before adopting the tag.

Comment thread main.tsp
@kuudori
Copy link
Copy Markdown
Contributor

kuudori commented Jun 2, 2026

/lgtm

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jun 2, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kuudori

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-ci openshift-ci Bot added the approved label Jun 2, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 64f5006 into openshift-hyperfleet:main Jun 2, 2026
3 checks passed
@tirthct tirthct deleted the hyperfleet-1143 branch June 2, 2026 20:58
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