Skip to content

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

Open
Archdiner wants to merge 2 commits 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 2 commits into
akash-network:mainfrom
Archdiner:fix/deployment-enforce-max-page-size

Conversation

@Archdiner

@Archdiner Archdiner commented May 31, 2026

Copy link
Copy Markdown

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 the deployment list query to enforce an upper bound on the limit parameter (capped at 100).
    • Adjusted the default limit to align with the same cap, improving consistency and helping prevent excessively large responses.

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

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

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: c0a05a14-fcfa-4baa-92c3-9d18b57c250d

📥 Commits

Reviewing files that changed from the base of the PR and between dafa871 and a971a95.

⛔ Files ignored due to path filters (1)
  • apps/api/test/functional/__snapshots__/docs.spec.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (1)
  • apps/api/src/deployment/http-schemas/deployment.schema.ts
🚧 Files skipped from review as they are similar to previous changes (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]

Suggested labels

size: S

Suggested reviewers

  • stalniy
✨ 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.

@baktun14 baktun14 force-pushed the fix/deployment-enforce-max-page-size branch from 2a20abc to dafa871 Compare June 19, 2026 19:50
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.20%. Comparing base (f62370e) to head (07b3c8a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3244      +/-   ##
==========================================
- Coverage   69.60%   68.20%   -1.40%     
==========================================
  Files        1087      998      -89     
  Lines       26669    24363    -2306     
  Branches     6415     5958     -457     
==========================================
- Hits        18562    16617    -1945     
+ Misses       7110     6781     -329     
+ Partials      997      965      -32     
Flag Coverage Δ *Carryforward flag
api 84.84% <100.00%> (-0.03%) ⬇️
deploy-web 55.25% <ø> (ø) Carriedforward from f62370e
log-collector ?
notifications 91.44% <ø> (ø) Carriedforward from f62370e
provider-console 81.38% <ø> (ø) Carriedforward from f62370e
provider-inventory ?
provider-proxy 86.26% <ø> (ø) Carriedforward from f62370e
tx-signer ?

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...i/src/deployment/http-schemas/deployment.schema.ts 100.00% <100.00%> (ø)

... and 90 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@baktun14

Copy link
Copy Markdown
Contributor

@Archdiner please fix the tests and ci

@Archdiner

Copy link
Copy Markdown
Author

@baktun14 hey sorry about that, just pushed fixes. Thanks!

@baktun14 baktun14 enabled auto-merge June 20, 2026 20:28
@baktun14

Copy link
Copy Markdown
Contributor

@Archdiner you need to sign your commits

@baktun14 baktun14 disabled auto-merge June 20, 2026 20:28
Archdiner and others added 2 commits June 21, 2026 00:36
…size

Reflects the new limit schema (default/max 100) on GET /v1/deployments.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Archdiner Archdiner force-pushed the fix/deployment-enforce-max-page-size branch from 07b3c8a to a971a95 Compare June 20, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants