Skip to content

HYPERFLEET-1272 - refactor: rename query params pageSize→size and orderBy→order#63

Draft
rafabene wants to merge 1 commit into
openshift-hyperfleet:mainfrom
rafabene:HYPERFLEET-1272-rename-query-params
Draft

HYPERFLEET-1272 - refactor: rename query params pageSize→size and orderBy→order#63
rafabene wants to merge 1 commit into
openshift-hyperfleet:mainfrom
rafabene:HYPERFLEET-1272-rename-query-params

Conversation

@rafabene

Copy link
Copy Markdown
Contributor

Summary

  • Rename pageSize query parameter to size
  • Rename orderBy query parameter to order
  • Remove unused OrderDirection enum and separate order?: OrderDirection parameter

Aligns with api.openshift.com conventions. This is a breaking change to the API contract, intended before GA.

Test plan

  • npm run build compiles successfully
  • Generated schemas/core/openapi.yaml contains size and order (no pageSize, orderBy, or OrderDirection)

Downstream PRs

Consumer repos will follow with their own PRs after this merges:

Repo Impact
hyperfleet-api Server parsing + generated client + integration tests
hyperfleet-sentinel Client code (PageSizeSize struct fields) + tests
hyperfleet-e2e Regenerate OpenAPI client (no source changes)

@openshift-ci openshift-ci Bot requested review from ma-hill and vkareh June 24, 2026 12:49
@openshift-ci

openshift-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign vkareh for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@coderabbitai

coderabbitai Bot commented Jun 24, 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: 6275c54e-5e80-4aac-9d56-ed55a8018a3d

📥 Commits

Reviewing files that changed from the base of the PR and between 1a18793 and 99f0717.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • main.tsp
  • package.json
  • schemas/core/openapi.yaml
  • shared/models/common/model.tsp
🔗 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 (3)
  • main.tsp
  • package.json
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • shared/models/common/model.tsp
  • schemas/core/openapi.yaml

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • None.
  • Bug Fixes

    • Updated paginated list requests to use the new size query parameter for clusters, node pools, and adapter status lists.
    • Simplified list sorting by using a plain text order query parameter with a default of created_time.
    • Removed the separate orderBy query parameter and its standalone enum-based direction handling to align ordering behavior across endpoints.
  • Chores

    • Bumped API and package versions to 1.0.24 and updated the changelog accordingly.

Walkthrough

openapi.yaml, main.tsp, and package.json were bumped from 1.0.23 to 1.0.24. shared/models/common/model.tsp removes OrderDirection, renames pageSize to size, removes orderBy, and changes order to a string defaulting to created_time. schemas/core/openapi.yaml applies the same query-parameter changes across the paginated GET operations and updates the QueryParams component definitions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Title check ✅ Passed Title matches the main change: renaming pagination and ordering query parameters.
Description check ✅ Passed Description matches the change set and mentions the parameter renames and enum removal.
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 non-test/example slog/log/logr/zap/fmt.Print calls with token/password/credential/secret found; no CWE-532 exposure.
No Hardcoded Secrets ✅ Passed No hardcoded creds, tokens, passwords, private keys, or embedded-credential URLs found; only benign examples and npm integrity hash (CWE-798).
No Weak Cryptography ✅ Passed No CWE-327/208 findings: PR files and repo scan found no md5/des/rc4/SHA1-for-security, ECB, custom crypto, or secret compares.
No Injection Vectors ✅ Passed PASS: No CWE-89/78/79/502 patterns in the changed files; schemas.go only embeds OpenAPI and build-schema.sh uses fixed commands with repo-derived version.
No Privileged Containers ✅ Passed PASS: Diff only touches CHANGELOG/main.tsp/package.json/openapi/model; no manifests/Dockerfiles or privilege flags were present (CWE-732/CWE-266).
No Pii Or Sensitive Data In Logs ✅ Passed No added slog/logr/zap/fmt.Print* or payload-printing logs; diff is schema/docs/workflow text only. No CWE-532 exposure found.

✏️ 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.

…erBy→order

Aligns with api.openshift.com conventions. Removes unused OrderDirection
enum and separate order direction parameter.

Bumps version to 1.0.24.
@rafabene rafabene force-pushed the HYPERFLEET-1272-rename-query-params branch from 1a18793 to 99f0717 Compare June 24, 2026 12:53

@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.

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)

1420-1447: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Generated order parameter now has no enum/pattern — same boundary gap flagged at source.

The QueryParams.order parameter emits a bare type: string with no enum or pattern. This is the generated mirror of the root cause in shared/models/common/model.tsp:195-196; fixing the TypeSpec source and rebuilding will close it here. Not duplicating per-endpoint.

Cross-repo: this is a breaking contract change. Per linked findings, hyperfleet-sentinel/adapter/broker internal/client/client.go:347-435 still send PageSize, and client_test.go:1253-1276 assert pageSize in the URL — these will break until regenerated. Intended per PR objectives, but ensure downstream regeneration is tracked.

🤖 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 1420 - 1447, The generated
QueryParams.order schema is missing its allowed value constraints, so fix the
TypeSpec source in shared/models/common/model.tsp where the order parameter is
defined and regenerate the OpenAPI output. Add back the appropriate enum or
pattern at the source rather than patching schemas/core/openapi.yaml directly,
then rebuild so QueryParams.order emits the constrained string schema
consistently across all generated endpoints.
🤖 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.

Outside diff comments:
In `@schemas/core/openapi.yaml`:
- Around line 1420-1447: The generated QueryParams.order schema is missing its
allowed value constraints, so fix the TypeSpec source in
shared/models/common/model.tsp where the order parameter is defined and
regenerate the OpenAPI output. Add back the appropriate enum or pattern at the
source rather than patching schemas/core/openapi.yaml directly, then rebuild so
QueryParams.order emits the constrained string schema consistently across all
generated endpoints.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: e4bf2e61-e5ee-4c9d-895f-564cc4725fca

📥 Commits

Reviewing files that changed from the base of the PR and between 1e89f58 and 1a18793.

📒 Files selected for processing (2)
  • schemas/core/openapi.yaml
  • shared/models/common/model.tsp
🔗 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)

@rafabene rafabene marked this pull request as draft June 24, 2026 13:08
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.

1 participant