feat(cli): add Info schema for info command response#22
feat(cli): add Info schema for info command response#22feloy merged 2 commits intokortex-hub:mainfrom
Conversation
|
Warning Rate limit exceeded
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 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. 📝 WalkthroughWalkthroughAdded GET /info OpenAPI operation returning an Info schema (version, agents, runtimes). Introduced generated Go package Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cli/openapi.yaml (1)
166-173: Consider boundingagentsandruntimesarrays.Both arrays are unbounded; adding
maxItemswould improve schema hardening and addressCKV_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
📒 Files selected for processing (2)
cli/go/api.gocli/openapi.yaml
81f0084 to
ef085ee
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cli/openapi.yaml (1)
164-181: LGTM!The
Infoschema is well-defined with all fields correctly marked as required. The generated Go struct incli/go/api.go(lines 11-16) correctly represents these as non-pointer types withoutomitempty.Static analysis flags missing
maxItemson 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: stringBased on learnings: "OpenAPI spec (cli/openapi.yaml) intentionally documents only CLI command output", so input validation constraints like
maxItemsare 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
📒 Files selected for processing (2)
cli/go/api.gocli/openapi.yaml
✅ Files skipped from review due to trivial changes (1)
- cli/go/api.go
ef085ee to
95fa782
Compare
feloy
left a comment
There was a problem hiding this comment.
go/api.go must not be generated
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>
95fa782 to
eddc4f7
Compare
Summary
Infoschema to the CLI OpenAPI specification withversion,agents, andruntimesfields/infoendpoint documentationNeeded by kortex-hub/kortex-cli#121
Test plan
api.Infostruct has correct JSON tags🤖 Generated with Claude Code