Skip to content

Conversation

@adityachoudhari26
Copy link
Contributor

@adityachoudhari26 adityachoudhari26 commented Mar 13, 2025

Summary by CodeRabbit

  • Refactor

    • Standardized the platform’s channel handling by updating the data structure used for deployment channels, ensuring consistent behavior across environments and API endpoints.
  • Chore

    • Harmonized naming conventions and streamlined internal logic to improve maintainability and future scalability.

These updates enhance system reliability and set the stage for future improvements without altering end-user functionality.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2025

Walkthrough

This pull request systematically updates the type definitions and schema references for deployment channels across the codebase. In multiple UI components, API routes, routers, authentication utilities, and database schemas, properties and operations that formerly used SCHEMA.ReleaseChannel (or its array variants) now use SCHEMA.DeploymentVersionChannel. The changes affect type signatures, join conditions, middleware calls, and method names without altering the underlying business logic or control flow.

Changes

File(s) Change Summary
apps/webservice/src/app/[workspaceSlug]/(app)/** (UpdateOverride.tsx, EnvironmentPolicyDrawer.tsx, ReleaseChannels.tsx, Overview.tsx, ReleaseConditionDialog.tsx, DeploymentPageContent.tsx, ReleaseChannelsTable.tsx, and similar files under (appv2)) Updated type definitions: properties and component props now use SCHEMA.DeploymentVersionChannel/SCHEMA.DeploymentVersionChannel[] instead of SCHEMA.ReleaseChannel/SCHEMA.ReleaseChannel[].
apps/webservice/src/app/api/v1/** (deployments route, environments/route.ts, release-channels/route.ts) Modified API endpoints: database operations and query conditions now reference deploymentVersionChannel instead of releaseChannel, including renaming of methods such as createReleaseChannel to createDeploymentVersionChannel.
packages/api/src/router/** (deployment-version.ts, deployment.ts, environment-policy.ts, environment.ts) Adjusted router queries and CRUD procedures: updated join conditions, input schemas, and procedure definitions to reflect the new deployment version channel model.
packages/auth/src/utils/rbac.ts Updated the inner join and filtering logic in getReleaseChannelScopes to operate on deploymentVersionChannel rather than releaseChannel.
packages/db/src/schema/** (release-channel-relations.ts, release-channel.ts, release.ts) Renamed and updated database schema components: releaseChannel is replaced with deploymentVersionChannel across type aliases, table definitions, and helper functions.
packages/job-dispatch/src/** (environment-release-channel-update.ts, policies/release-sequencing.ts, policies/release-string-check.ts) Modified query logic in job dispatch policies to reference deploymentVersionChannel in place of releaseChannel.

Possibly related PRs

Poem

I'm a hoppy rabbit in the code field today,
Skipping through types in a delightful display.
From Release to Deployment, I cheerfully bound,
New channel names in every file found.
Leaping with joy at the change so neat—
Code carrots await in every commit treat!
🥕🐇 Happy coding!

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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: 0

🧹 Nitpick comments (2)
packages/auth/src/utils/rbac.ts (1)

125-129: Maintained the "releaseChannel" scope type for compatibility.

This is a notable design decision: while the database entity has been renamed to deploymentVersionChannel, the scope type returned by the function is still "releaseChannel". This approach maintains compatibility with existing RBAC definitions and permission checks that expect the "releaseChannel" scope type.

While this approach is pragmatic for a refactoring effort, consider whether a follow-up task to align the scope type name with the entity name would improve long-term code clarity. The scope type is defined in packages/db/src/schema/rbac.ts as noted in the retrieved learning.

packages/api/src/router/deployment.ts (1)

30-73: Maintainability enhancement: Consider updating permission names.

While the implementation has been updated to use deploymentVersionChannel, the permission names (like Permission.ReleaseChannelCreate, Permission.ReleaseChannelUpdate, etc.) still use the old terminology. Consider updating these in a future PR to maintain consistency in terminology throughout the codebase.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 64f4d23 and 38e5276.

📒 Files selected for processing (23)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment-drawer/policy-override/UpdateOverride.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment-policy-drawer/EnvironmentPolicyDrawer.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/policy-form-components/ReleaseChannels.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/release-channel-drawer/Overview.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/release-condition/ReleaseConditionDialog.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(appv2)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/DeploymentPageContent.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(appv2)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/channels/ReleaseChannelsTable.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(appv2)/_components/channel/drawer/Overview.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(appv2)/_components/release/condition/ReleaseConditionDialog.tsx (1 hunks)
  • apps/webservice/src/app/api/v1/deployments/[deploymentId]/release-channels/name/[name]/route.ts (1 hunks)
  • apps/webservice/src/app/api/v1/environments/route.ts (1 hunks)
  • apps/webservice/src/app/api/v1/release-channels/route.ts (3 hunks)
  • packages/api/src/router/deployment-version.ts (2 hunks)
  • packages/api/src/router/deployment.ts (8 hunks)
  • packages/api/src/router/environment-policy.ts (2 hunks)
  • packages/api/src/router/environment.ts (2 hunks)
  • packages/auth/src/utils/rbac.ts (2 hunks)
  • packages/db/src/schema/release-channel-relations.ts (2 hunks)
  • packages/db/src/schema/release-channel.ts (2 hunks)
  • packages/db/src/schema/release.ts (2 hunks)
  • packages/job-dispatch/src/environment-release-channel-update.ts (1 hunks)
  • packages/job-dispatch/src/policies/release-sequencing.ts (1 hunks)
  • packages/job-dispatch/src/policies/release-string-check.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{ts,tsx}`: **Note on Error Handling:** Avoid strict en...

**/*.{ts,tsx}: Note on Error Handling:
Avoid strict enforcement of try/catch blocks. Code may use early returns, Promise chains (.then().catch()), or other patterns for error handling. These are acceptable as long as they maintain clarity and predictability.

  • apps/webservice/src/app/[workspaceSlug]/(appv2)/_components/channel/drawer/Overview.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment-policy-drawer/EnvironmentPolicyDrawer.tsx
  • apps/webservice/src/app/api/v1/environments/route.ts
  • packages/job-dispatch/src/policies/release-string-check.ts
  • packages/api/src/router/environment-policy.ts
  • packages/api/src/router/environment.ts
  • packages/job-dispatch/src/environment-release-channel-update.ts
  • packages/job-dispatch/src/policies/release-sequencing.ts
  • apps/webservice/src/app/[workspaceSlug]/(appv2)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/channels/ReleaseChannelsTable.tsx
  • packages/db/src/schema/release-channel.ts
  • apps/webservice/src/app/[workspaceSlug]/(appv2)/_components/release/condition/ReleaseConditionDialog.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment-drawer/policy-override/UpdateOverride.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/policy-form-components/ReleaseChannels.tsx
  • packages/api/src/router/deployment-version.ts
  • packages/auth/src/utils/rbac.ts
  • packages/db/src/schema/release-channel-relations.ts
  • apps/webservice/src/app/api/v1/release-channels/route.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/release-condition/ReleaseConditionDialog.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/release-channel-drawer/Overview.tsx
  • packages/db/src/schema/release.ts
  • apps/webservice/src/app/api/v1/deployments/[deploymentId]/release-channels/name/[name]/route.ts
  • apps/webservice/src/app/[workspaceSlug]/(appv2)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/DeploymentPageContent.tsx
  • packages/api/src/router/deployment.ts
🧠 Learnings (3)
apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment-policy-drawer/EnvironmentPolicyDrawer.tsx (2)
Learnt from: adityachoudhari26
PR: ctrlplanedev/ctrlplane#183
File: apps/webservice/src/app/[workspaceSlug]/_components/environment-drawer/ReleaseChannels.tsx:48-71
Timestamp: 2025-03-12T21:38:05.695Z
Learning: Prefer using `Object.fromEntries` over `.reduce` for transforming arrays into objects in React components to improve readability and maintainability.
Learnt from: adityachoudhari26
PR: ctrlplanedev/ctrlplane#188
File: apps/webservice/src/app/[workspaceSlug]/_components/release-channel-drawer/Usage.tsx:42-44
Timestamp: 2025-03-12T21:38:05.695Z
Learning: In `apps/webservice/src/app/[workspaceSlug]/_components/release-channel-drawer/Usage.tsx`, within the `Usage` component, the arrays used for filtering inherited environments are expected to remain small. Therefore, performance optimizations for this filtering logic are not necessary.
apps/webservice/src/app/[workspaceSlug]/(appv2)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/channels/ReleaseChannelsTable.tsx (2)
Learnt from: adityachoudhari26
PR: ctrlplanedev/ctrlplane#183
File: apps/webservice/src/app/[workspaceSlug]/_components/environment-drawer/ReleaseChannels.tsx:48-71
Timestamp: 2025-03-12T21:38:05.695Z
Learning: Prefer using `Object.fromEntries` over `.reduce` for transforming arrays into objects in React components to improve readability and maintainability.
Learnt from: adityachoudhari26
PR: ctrlplanedev/ctrlplane#188
File: apps/webservice/src/app/[workspaceSlug]/_components/release-channel-drawer/Usage.tsx:42-44
Timestamp: 2025-03-12T21:38:05.695Z
Learning: In `apps/webservice/src/app/[workspaceSlug]/_components/release-channel-drawer/Usage.tsx`, within the `Usage` component, the arrays used for filtering inherited environments are expected to remain small. Therefore, performance optimizations for this filtering logic are not necessary.
packages/auth/src/utils/rbac.ts (1)
Learnt from: adityachoudhari26
PR: ctrlplanedev/ctrlplane#181
File: packages/auth/src/utils/rbac.ts:102-118
Timestamp: 2025-03-12T21:38:05.696Z
Learning: The `releaseChannel` scope type is included in the `scopeType` enum in `packages/db/src/schema/rbac.ts`.
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Typecheck
  • GitHub Check: Lint
  • GitHub Check: build (linux/amd64)
  • GitHub Check: build (linux/amd64)
  • GitHub Check: build (linux/amd64)
  • GitHub Check: build (linux/amd64)
🔇 Additional comments (47)
packages/job-dispatch/src/policies/release-sequencing.ts (1)

94-94: Schema refactoring looks good

The changes correctly update references from schema.releaseChannel to schema.deploymentVersionChannel consistently throughout the query. This aligns with the overall transition from ReleaseChannel to DeploymentVersionChannel in the database schema.

Also applies to: 98-98, 101-101

packages/job-dispatch/src/policies/release-string-check.ts (1)

24-25: Schema update properly implemented

The refactoring from schema.releaseChannel to schema.deploymentVersionChannel has been consistently applied to all relevant fields and join conditions. The modifications maintain the original query functionality while using the new schema.

Also applies to: 29-29, 32-32

apps/webservice/src/app/[workspaceSlug]/(appv2)/_components/release/condition/ReleaseConditionDialog.tsx (1)

46-46: Type signature updated correctly

The type for releaseChannels has been properly updated from SCHEMA.ReleaseChannel[] to SCHEMA.DeploymentVersionChannel[], maintaining type safety with the new schema structure.

apps/webservice/src/app/[workspaceSlug]/(appv2)/_components/channel/drawer/Overview.tsx (1)

41-41: Type definition properly updated

The releaseChannel prop type has been correctly changed from SCHEMA.ReleaseChannel to SCHEMA.DeploymentVersionChannel, aligning with the schema changes throughout the codebase.

packages/job-dispatch/src/environment-release-channel-update.ts (1)

20-28: Schema reference successfully updated in getReleaseFilter function

The schema reference has been properly updated from SCHEMA.releaseChannel to SCHEMA.deploymentVersionChannel in both the table selection and where condition. This change maintains the function's behavior while aligning with the broader refactoring from release channels to deployment version channels across the codebase.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/release-channel-drawer/Overview.tsx (1)

40-42: Type definition correctly updated

The type of releaseChannel in OverviewProps has been properly updated from SCHEMA.ReleaseChannel to SCHEMA.DeploymentVersionChannel, ensuring type consistency across the component. Since the component continues to use the same properties of the channel object, this change maintains functionality while updating to the new schema reference.

apps/webservice/src/app/api/v1/environments/route.ts (1)

53-62: Database query properly updated to use deployment version channel

The database query has been correctly modified to select from schema.deploymentVersionChannel instead of schema.releaseChannel, and the where clause has been updated accordingly. The mapping logic to extract channel and deployment IDs remains unchanged, preserving the function's behavior while updating the schema reference.

apps/webservice/src/app/api/v1/deployments/[deploymentId]/release-channels/name/[name]/route.ts (1)

22-32: DELETE operation updated to target the correct schema

The delete operation has been properly updated to target schema.deploymentVersionChannel instead of schema.releaseChannel, with corresponding updates to the where clause conditions. The error handling remains unchanged, ensuring that the API endpoint continues to function as expected with the new schema reference.

apps/webservice/src/app/[workspaceSlug]/(appv2)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/DeploymentPageContent.tsx (1)

178-178: Type update appears correct.

The type change from schema.ReleaseChannel | null to schema.DeploymentVersionChannel | null aligns with the broader refactoring in this PR. The component usage of this property remains consistent.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment-drawer/policy-override/UpdateOverride.tsx (1)

13-13: Type update appears correct.

The change from SCHEMA.ReleaseChannel[] to SCHEMA.DeploymentVersionChannel[] is consistent with the deployment version channel refactoring throughout the codebase.

packages/api/src/router/environment-policy.ts (2)

17-17: Import updated correctly.

Updated import from releaseChannel to deploymentVersionChannel aligns with the schema refactoring.


40-44: Database join condition updated correctly.

The left join operation has been updated to use deploymentVersionChannel instead of releaseChannel, maintaining the same join condition structure. This change ensures database queries properly reference the new schema entity.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/policy-form-components/ReleaseChannels.tsx (2)

17-17: Type update appears correct.

The change from SCHEMA.ReleaseChannel[] to SCHEMA.DeploymentVersionChannel[] aligns with the refactoring pattern in this PR.


20-20: Type update appears correct.

The Policy type's releaseChannels property has been updated to use SCHEMA.DeploymentVersionChannel[] to maintain consistency with the other type changes.

apps/webservice/src/app/[workspaceSlug]/(appv2)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/channels/ReleaseChannelsTable.tsx (1)

18-18: Type definition updated correctly to use DeploymentVersionChannel.

The type definition has been updated to use the new DeploymentVersionChannel schema type instead of the previous ReleaseChannel type. This change is consistent with the deployment version channel refactoring mentioned in the PR objectives.

packages/api/src/router/deployment-version.ts (2)

257-262: Schema references updated correctly in the policyRCSubquery.

The schema references have been properly updated from SCHEMA.releaseChannel to SCHEMA.deploymentVersionChannel in the select statement of the policyRCSubquery. This maintains consistency with the deployment version channel refactoring.


592-596: Join condition updated correctly to reference the new schema.

The inner join condition has been properly updated to reference SCHEMA.deploymentVersionChannel instead of the previous SCHEMA.releaseChannel. This ensures that the query continues to function correctly with the refactored schema.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/release-condition/ReleaseConditionDialog.tsx (1)

46-46: Type definition updated correctly for releaseChannels prop.

The type definition for the releaseChannels prop has been updated from SCHEMA.ReleaseChannel[] to SCHEMA.DeploymentVersionChannel[], maintaining consistency with the deployment version channel refactoring across the codebase.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment-policy-drawer/EnvironmentPolicyDrawer.tsx (1)

119-119: ViewProps type updated correctly to use DeploymentVersionChannel.

The releaseChannels property in the ViewProps type has been properly updated to use SCHEMA.DeploymentVersionChannel[] instead of the previous SCHEMA.ReleaseChannel[]. This change aligns with the deployment version channel refactoring efforts across the codebase.

packages/api/src/router/environment.ts (3)

19-19: Import updated to use deploymentVersionChannel.

The import has been updated to include deploymentVersionChannel which aligns with the broader refactoring effort across the codebase.


61-66: Field references updated to use deploymentVersionChannel.

The field references in the subquery selection have been systematically updated from releaseChannel* to reference the corresponding fields from deploymentVersionChannel. This is consistent with the deployment version channel refactoring.


69-74: Join condition updated to use deploymentVersionChannel.

The inner join condition has been properly updated to join on deploymentVersionChannel instead of releaseChannel, maintaining the same relationship structure but with the renamed entity.

packages/db/src/schema/release-channel-relations.ts (3)

5-5: Import updated to deploymentVersionChannel.

The import statement has been correctly updated to import deploymentVersionChannel instead of releaseChannel.


7-12: releaseChannelRelations updated to use deploymentVersionChannel.

The releaseChannelRelations function now correctly uses deploymentVersionChannel as its base entity while maintaining the same relationship structure.


21-24: Relation references updated to deploymentVersionChannel.

The relation definition for releaseChannel within environmentPolicyReleaseChannelRelations has been updated to reference the deploymentVersionChannel entity and its ID field, maintaining database integrity.

packages/db/src/schema/release-channel.ts (2)

6-6: Import updated to deploymentVersionChannel.

The import statement has been correctly updated to import deploymentVersionChannel instead of releaseChannel.


16-17: Foreign key reference updated to deploymentVersionChannel.id.

The foreign key reference for the channelId field has been correctly updated to reference deploymentVersionChannel.id, ensuring proper database relationships.

packages/auth/src/utils/rbac.ts (2)

16-16: Added deploymentVersionChannel to imports.

The import statement has been updated to include deploymentVersionChannel, aligning with the broader refactoring.


118-123: Updated inner join to use deploymentVersionChannel.

The inner join in getReleaseChannelScopes function has been updated to use deploymentVersionChannel instead of releaseChannel, maintaining the same query structure with the renamed entity.

apps/webservice/src/app/api/v1/release-channels/route.ts (6)

5-5: Import updated to match the renamed schema entity.

The import statement has been correctly updated to use createDeploymentVersionChannel instead of createReleaseChannel, aligning with the schema changes.


15-15: Middleware updated to use the new schema validator.

The parseBody middleware now correctly uses the createDeploymentVersionChannel validator to match the schema changes.


23-23: Type inference correctly updated.

The handler's type definition has been updated to use the new schema type, maintaining type safety throughout the request handling chain.


27-32: Database query updated to use new schema table.

The database query has been updated consistently to use SCHEMA.deploymentVersionChannel instead of SCHEMA.releaseChannel in both the table reference and field selectors.


43-43: Insert operation updated to target the new schema table.

The database insert operation now correctly targets SCHEMA.deploymentVersionChannel.


36-48: Note: API response message remains backward compatible.

While the database schema has been updated, the error message in the API response still mentions "Release channel already exists". This preserves backward compatibility for API consumers while the internal implementation has changed.

packages/db/src/schema/release.ts (2)

55-69: Schema table definition renamed to match new terminology.

The table definition has been appropriately renamed to deploymentVersionChannel while keeping the underlying database table name deployment_version_channel unchanged, which avoids the need for database migrations.


71-79: Type definitions and schema functions updated consistently.

All related type definitions and schema functions have been updated:

  • ReleaseChannelDeploymentVersionChannel
  • createReleaseChannelcreateDeploymentVersionChannel
  • updateReleaseChannelupdateDeploymentVersionChannel

The changes maintain the same structure and validation rules, ensuring functionality remains the same.

packages/api/src/router/deployment.ts (10)

32-32: Input schema updated to use new validation schema.

The input validation for the create procedure now uses SCHEMA.createDeploymentVersionChannel instead of SCHEMA.createReleaseChannel.


41-41: Insert operation updated for new schema table.

The database insert operation now correctly uses SCHEMA.deploymentVersionChannel.


46-49: Updated input schema for update procedure.

The input schema for the update procedure now correctly uses SCHEMA.updateDeploymentVersionChannel while maintaining the same structure.


59-62: Update operation modified to use new schema table.

Both the table reference and the where condition have been updated to use SCHEMA.deploymentVersionChannel.


75-76: Delete operation updated to target new schema table.

The delete operation now correctly targets SCHEMA.deploymentVersionChannel with an updated where condition.


91-92: List query updated to use new schema table.

The select operation and where clause in the list query now correctly reference SCHEMA.deploymentVersionChannel.


122-124: Query method updated to use new schema entity.

The query method has been updated to use deploymentVersionChannel instead of releaseChannel.


536-541: Left join updated to use new schema table.

The left join operation in the bySlug query now correctly uses SCHEMA.deploymentVersionChannel.


576-581: Consistent update to all join operations.

The left join in the bySystemId query has also been updated to use SCHEMA.deploymentVersionChannel, ensuring consistency throughout the codebase.


557-558: API response structure remains backward compatible.

The property name in the returned object is still releaseChannels even though it now contains deployment_version_channel objects. This maintains backward compatibility for API consumers, which is a good practice when refactoring internal implementations.

@adityachoudhari26 adityachoudhari26 merged commit 76b4f35 into main Mar 13, 2025
10 checks passed
@adityachoudhari26 adityachoudhari26 deleted the deployment-version-channel-refactor branch March 13, 2025 21:43
@coderabbitai coderabbitai bot mentioned this pull request Apr 6, 2025
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