Skip to content

feat(cli): add Info schema for info command response#22

Merged
feloy merged 2 commits intokortex-hub:mainfrom
bmahabirbu:feat/add-info-schema
Apr 3, 2026
Merged

feat(cli): add Info schema for info command response#22
feloy merged 2 commits intokortex-hub:mainfrom
bmahabirbu:feat/add-info-schema

Conversation

@bmahabirbu
Copy link
Copy Markdown
Contributor

Summary

  • Add Info schema to the CLI OpenAPI specification with version, agents, and runtimes fields
  • Add /info endpoint documentation
  • Regenerate Go types

Needed by kortex-hub/kortex-cli#121

Test plan

  • Verify generated Go types match the OpenAPI schema
  • Verify api.Info struct has correct JSON tags

🤖 Generated with Claude Code

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

Warning

Rate limit exceeded

@feloy has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 50 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 3 minutes and 50 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 965fb293-f4f2-402b-b1bb-5d443f50b72b

📥 Commits

Reviewing files that changed from the base of the PR and between 95fa782 and eddc4f7.

📒 Files selected for processing (1)
  • cli/openapi.yaml
📝 Walkthrough

Walkthrough

Added GET /info OpenAPI operation returning an Info schema (version, agents, runtimes). Introduced generated Go package api with JSON-annotated structs: Error, Info, Workspace, WorkspaceId, WorkspacePaths, WorkspacesList. No other OpenAPI schema changes.

Changes

Cohort / File(s) Summary
API Specification
cli/openapi.yaml
Added GET /info path returning 200 with components/schemas/Info and 400 referencing Error; added components/schemas/Info (version, agents, runtimes). No changes to Workspace schema in this diff.
Generated Go Models
cli/go/api.go
New package api with exported structs: Error, Info, Workspace, WorkspaceId, WorkspacePaths, WorkspacesList — data-only types with explicit json tags, no methods or runtime logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding an Info schema to the CLI for the info command response, which matches the changeset.
Description check ✅ Passed The description is directly related to the changeset, outlining the specific changes made (Info schema, endpoint documentation, Go type regeneration) and referencing a related issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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.

🧹 Nitpick comments (1)
cli/openapi.yaml (1)

166-173: Consider bounding agents and runtimes arrays.

Both arrays are unbounded; adding maxItems would improve schema hardening and address CKV_OPENAPI_21.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli/openapi.yaml` around lines 166 - 173, The OpenAPI schema currently
defines unbounded arrays for the properties agents and runtimes; update the
schema for these array items (agents and runtimes in openapi.yaml) to include a
maxItems constraint (and optionally minItems if sensible) to harden the contract
and satisfy CKV_OPENAPI_21. Pick a reasonable upper bound for each array based
on expected usage (e.g., 10 or 100) and add maxItems: <number> under both the
agents and runtimes array definitions while keeping items:type: string intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@cli/openapi.yaml`:
- Around line 166-173: The OpenAPI schema currently defines unbounded arrays for
the properties agents and runtimes; update the schema for these array items
(agents and runtimes in openapi.yaml) to include a maxItems constraint (and
optionally minItems if sensible) to harden the contract and satisfy
CKV_OPENAPI_21. Pick a reasonable upper bound for each array based on expected
usage (e.g., 10 or 100) and add maxItems: <number> under both the agents and
runtimes array definitions while keeping items:type: string intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b5c85590-04e7-4930-b634-4c6ce94fb91a

📥 Commits

Reviewing files that changed from the base of the PR and between 8c8628a and 81f0084.

📒 Files selected for processing (2)
  • cli/go/api.go
  • cli/openapi.yaml

@bmahabirbu bmahabirbu force-pushed the feat/add-info-schema branch from 81f0084 to ef085ee Compare April 2, 2026 04:55
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.

🧹 Nitpick comments (1)
cli/openapi.yaml (1)

164-181: LGTM!

The Info schema is well-defined with all fields correctly marked as required. The generated Go struct in cli/go/api.go (lines 11-16) correctly represents these as non-pointer types without omitempty.

Static analysis flags missing maxItems on the arrays (CKV_OPENAPI_21). Since this spec documents CLI output rather than API input validation, this is less critical. However, if you want to suppress the warning and document expected bounds:

📝 Optional: Add maxItems to arrays
         agents:
           type: array
+          maxItems: 100
           items:
             type: string
         runtimes:
           type: array
+          maxItems: 50
           items:
             type: string

Based on learnings: "OpenAPI spec (cli/openapi.yaml) intentionally documents only CLI command output", so input validation constraints like maxItems are optional here.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli/openapi.yaml` around lines 164 - 181, Add maxItems constraints to the
Info schema arrays to satisfy static analysis (CKV_OPENAPI_21): update the Info
properties "agents" and "runtimes" to include a sensible maxItems value (e.g.,
maxItems: 100) so the arrays have documented upper bounds; keep them as type:
array and leave required fields unchanged in the Info schema to avoid changing
generated Go types in cli/go/api.go.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@cli/openapi.yaml`:
- Around line 164-181: Add maxItems constraints to the Info schema arrays to
satisfy static analysis (CKV_OPENAPI_21): update the Info properties "agents"
and "runtimes" to include a sensible maxItems value (e.g., maxItems: 100) so the
arrays have documented upper bounds; keep them as type: array and leave required
fields unchanged in the Info schema to avoid changing generated Go types in
cli/go/api.go.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eff871f2-b9b5-4404-9b85-4301ae0850af

📥 Commits

Reviewing files that changed from the base of the PR and between 81f0084 and ef085ee.

📒 Files selected for processing (2)
  • cli/go/api.go
  • cli/openapi.yaml
✅ Files skipped from review due to trivial changes (1)
  • cli/go/api.go

@feloy feloy force-pushed the feat/add-info-schema branch from ef085ee to 95fa782 Compare April 2, 2026 07:07
Copy link
Copy Markdown
Contributor

@feloy feloy left a comment

Choose a reason for hiding this comment

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

go/api.go must not be generated

bmahabirbu and others added 2 commits April 3, 2026 10:34
Add Info schema to the OpenAPI specification with version, agents,
and runtimes fields. Regenerate Go types.

Signed-off-by: Brian <brian@brian.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Brian <bmahabir@bu.edu>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
@feloy feloy force-pushed the feat/add-info-schema branch from 95fa782 to eddc4f7 Compare April 3, 2026 08:35
@feloy feloy merged commit ce0c181 into kortex-hub:main Apr 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants