Skip to content

Conversation

akhilmhdh
Copy link
Member

Description 📣

This PR fixes secret move failing due to recent workspace id removal revamp happened. The service would accept both slug and id, but the. router expected slug only which should have been project id. The frontend was passing id only

Type ✨

  • Bug fix
  • New feature
  • Improvement
  • Breaking change
  • Documentation

Tests 🛠️

# Here's some code block to paste some code snippets

@akhilmhdh akhilmhdh requested a review from maidul98 September 18, 2025 14:42
@maidul98
Copy link
Collaborator

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR fixes a critical compatibility issue in the secret move API endpoint by updating the request schema validation. The change modifies the /move endpoint in the secret router from expecting projectSlug to projectId in the request body schema.

The issue stemmed from a mismatch between the frontend and backend after a recent "workspace id removal revamp." While the underlying moveSecrets service function supports both project slugs and IDs (it can handle either through projectDAL.findProjectBySlug or projectDAL.findById), the API router was only validating for projectSlug in the schema. Meanwhile, the frontend was sending projectId values, causing the API calls to fail validation.

This change aligns the router schema with what the frontend is actually sending and maintains consistency with other endpoints in the same router file that already use projectId. The service layer's flexibility to handle both slug and ID formats means this change doesn't require any modifications to the business logic - it simply fixes the schema validation layer to match the data format being sent by the client.

Confidence score: 4/5

  • This PR is safe to merge with minimal risk of breaking existing functionality
  • Score reflects a straightforward schema fix that aligns frontend-backend communication without changing business logic
  • No files require special attention as this is a single-line schema validation change

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@maidul98 maidul98 merged commit 05f17ed into main Sep 18, 2025
9 of 10 checks passed
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