Skip to content

feat(api): adds order to list deploymentVersions#898

Merged
mleonidas merged 5 commits intomainfrom
897-add-a-sort-order-parameter-to-the-deployment-versions-endpoint
Apr 2, 2026
Merged

feat(api): adds order to list deploymentVersions#898
mleonidas merged 5 commits intomainfrom
897-add-a-sort-order-parameter-to-the-deployment-versions-endpoint

Conversation

@mleonidas
Copy link
Copy Markdown
Collaborator

@mleonidas mleonidas commented Mar 31, 2026

  • adds order param when listing deploymentVersions with a default value

Summary by CodeRabbit

  • New Features

    • Added sorting option for deployment versions with ascending or descending order (defaults to descending).
  • Bug Fixes

    • Corrected HTTP response status code for successful workflow creation from 202 (Accepted) to 201 (Created).

* adds order param when listing deploymentVersions with a default value
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

📝 Walkthrough

Walkthrough

This PR introduces sorting order control to the deployment versions API endpoint by adding an optional order query parameter (asc/desc, default desc). Changes span OpenAPI specifications, configuration, backend route handlers, and TypeScript type definitions. Additionally updates the workflow creation response status code from 202 to 201.

Changes

Cohort / File(s) Summary
OpenAPI Library & Specification
apps/api/openapi/lib/openapi.libsonnet, apps/api/openapi/openapi.json
Added orderParam() helper function for optional query parameter with asc/desc enum. Updated deployment versions endpoint with order parameter. Changed workflow creation response status from 202 to 201 with updated description.
OpenAPI Path Configuration
apps/api/openapi/paths/deploymentversions.jsonnet
Integrated orderParam() into deployment versions endpoint parameters list.
Backend Implementation
apps/api/src/routes/v1/workspaces/deployments.ts, apps/api/src/types/openapi.ts
Added order query parameter handling with conditional asc/desc sorting logic in listDeploymentVersions. Updated TypeScript type definitions for new parameter and workflow endpoint status code change.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

🐰 Hop along with sorted lists,
Asc and desc in morning mists,
Deployments dance in order true,
201 responses—fresh and new! 🎀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding an order parameter to the list deploymentVersions endpoint, which is the primary focus across all modified files.
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.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 897-add-a-sort-order-parameter-to-the-deployment-versions-endpoint

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
Contributor

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/api/openapi/openapi.json`:
- Around line 4788-4800: The "order" query parameter description is ambiguous;
update the parameter object for "name": "order" in the OpenAPI schema to state
which field it sorts (e.g., "Sort order for results by {FIELD_NAME} — use 'asc'
or 'desc'"), so generated docs clearly convey that the order applies to that
specific field rather than to results in general.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a8bb1b31-05e6-461a-83dd-60f0f163f2a8

📥 Commits

Reviewing files that changed from the base of the PR and between d5401e3 and 7e1ff67.

📒 Files selected for processing (5)
  • apps/api/openapi/lib/openapi.libsonnet
  • apps/api/openapi/openapi.json
  • apps/api/openapi/paths/deploymentversions.jsonnet
  • apps/api/src/routes/v1/workspaces/deployments.ts
  • apps/api/src/types/openapi.ts

@mleonidas mleonidas merged commit c62e858 into main Apr 2, 2026
7 checks passed
@mleonidas mleonidas deleted the 897-add-a-sort-order-parameter-to-the-deployment-versions-endpoint branch April 2, 2026 12:40
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