Skip to content

fix(deployment): enforce max page size on GET /v1/deployments#3244

Open
Archdiner wants to merge 1 commit into
akash-network:mainfrom
Archdiner:fix/deployment-enforce-max-page-size
Open

fix(deployment): enforce max page size on GET /v1/deployments#3244
Archdiner wants to merge 1 commit into
akash-network:mainfrom
Archdiner:fix/deployment-enforce-max-page-size

Conversation

@Archdiner
Copy link
Copy Markdown

@Archdiner Archdiner commented May 31, 2026

Why

Fixes #2586
The GET /v1/deployments list endpoint had a default limit of 1000 but no upper bound enforced. This PR brings the endpoint in line with other list endpoints by enforcing a maximum page size of 100.

What

  • Moved deploymentListMaxLimit above ListDeploymentsQuerySchema in apps/api/src/deployment/http-schemas/deployment.schema.ts to prevent ReferenceErrors.
  • Added .max(deploymentListMaxLimit) constraint to the limit query parameter schema.

Summary by CodeRabbit

  • Bug Fixes
    • Updated deployment list query to enforce a maximum limit of 100 items per request and adjusted the default limit accordingly.

@Archdiner Archdiner requested a review from a team as a code owner May 31, 2026 16:20
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 31, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 516cc595-04e1-444c-bd50-d915cee14509

📥 Commits

Reviewing files that changed from the base of the PR and between ef633f7 and 2a20abc.

📒 Files selected for processing (1)
  • apps/api/src/deployment/http-schemas/deployment.schema.ts

📝 Walkthrough

Walkthrough

The PR enforces a maximum page size of 100 on the GET /v1/deployments list endpoint by moving the deploymentListMaxLimit constant to an earlier position in the schema file and updating ListDeploymentsQuerySchema to apply both a .max() constraint and consistent default using that constant.

Changes

Deployment List Page Size Enforcement

Layer / File(s) Summary
Schema limit constraint and constant definition
apps/api/src/deployment/http-schemas/deployment.schema.ts
The deploymentListMaxLimit constant (set to 100) is moved earlier in the file and referenced in ListDeploymentsQuerySchema.limit to enforce a maximum bound and set a consistent default value, replacing the hardcoded 1000 default.

Estimated Code Review Effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Assessment against linked issues

Objective Addressed Explanation
Enforce max page size on GET /v1/deployments endpoint [#2586]
Set default limit to 100 consistent with other endpoints [#2586]
Add .max() constraint to limit parameter [#2586]
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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.

perf(api): enforce max page size on GET /v1/deployments

1 participant