-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: disable v3 #2734
feat: disable v3 #2734
Conversation
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested reviewers
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
api/src/pdc/proxy/helpers/registerExpressRoute.ts (1)
Line range hint
52-53
: Clean up backward compatibility codeSince v3.0.0 is being removed, the FIXME comment and special handling for "v3" -> "v3.0" conversion appears to be obsolete.
Apply this diff to clean up the obsolete code:
- // FIXME: This is a dirty hack to ensure backward compatibility - const apiVersion = api_version == "v3" ? "v3.0" : api_version; + const apiVersion = api_version;
@@ -23,7 +23,7 @@ export interface RouteParams { | |||
rpcAnswerOnFailure?: boolean; | |||
} | |||
|
|||
const SUPPORTED_VERSIONS = ["3.0.0", "3.1.0"].map((v) => semver.parse(v)); | |||
const SUPPORTED_VERSIONS = ["3.1.0"].map((v) => semver.parse(v)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking Change: Verify API v3.0.0 deprecation strategy
Removing support for API v3.0.0 is a breaking change that could impact existing clients. Consider the following recommendations:
- Ensure proper communication to API consumers about this deprecation
- Consider implementing a deprecation notice period
- Update API documentation to reflect this change
Would you like me to help draft deprecation notices or documentation updates?
💡 Codebase verification
Version 3.0.0 support removal is not fully complete
The codebase still contains v3.0.0 specific handling that needs attention:
registerExpressRoute.ts
has a backward compatibility hack that maps "v3" to "v3.0"CarpoolLabelRepository.ts
contains v3.0.0 specific fraud label handlingCreateJourneyAction.ts
includes version 3.0 in its version range check
These locations need to be updated to remove v3.0.0 support:
api/src/pdc/proxy/helpers/registerExpressRoute.ts
: Remove the backward compatibility hack for "v3" to "v3.0" mappingapi/src/pdc/providers/carpool/repositories/CarpoolLabelRepository.ts
: Remove the v3.0.0 version check and legacy fraud label handlingapi/src/pdc/services/acquisition/actions/CreateJourneyAction.ts
: Update the version range check to only support 3.1.0
🔗 Analysis chain
Verify version handling impact
Let's verify that removing v3.0.0 support is handled correctly throughout the codebase.
Also applies to: 58-61
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for any remaining v3.0.0 API references or version handling
# Search for v3.0.0 version strings
echo "Searching for v3.0.0 references..."
rg -l "3\.0\.0|v3\.0"
# Search for version-specific handling
echo "Searching for version-specific code paths..."
rg -l "v3\."
# Search for API version documentation
echo "Searching for API documentation..."
fd -g "*api*.md" -g "*swagger*.{json,yaml}" -g "*openapi*.{json,yaml}"
Length of output: 1270
Script:
#!/bin/bash
# Let's examine the specific version handling in the key files
# Check the API spec file content
echo "=== Checking API spec file ==="
cat api/specs/api-v3.1.yaml
# Check version handling in registerExpressRoute
echo -e "\n=== Checking registerExpressRoute implementation ==="
cat api/src/pdc/proxy/helpers/registerExpressRoute.ts
# Check version handling in CarpoolLabelRepository
echo -e "\n=== Checking CarpoolLabelRepository implementation ==="
cat api/src/pdc/providers/carpool/repositories/CarpoolLabelRepository.ts
# Look for any version-specific routing or handling
echo -e "\n=== Checking for version-specific routing patterns ==="
ast-grep --pattern 'if ($_ === "3.0.0") { $$$ }'
Length of output: 111705
Script:
#!/bin/bash
# Let's check for any remaining v3.0.0 specific handling in the codebase
# Check registerExpressRoute.ts content with proper error handling
echo "=== Checking registerExpressRoute.ts ==="
cat api/src/pdc/proxy/helpers/registerExpressRoute.ts 2>/dev/null || echo "File not found"
# Check API spec for version references
echo -e "\n=== Checking API version references in spec ==="
rg -A 5 "version" api/specs/api-v3.1.yaml 2>/dev/null || echo "File not found"
# Check for version-specific code paths
echo -e "\n=== Checking for version-specific code paths ==="
rg -A 5 "3\.0\.0|v3\.0" --type ts 2>/dev/null || echo "No version-specific code found"
# Look for version comparisons
echo -e "\n=== Checking for version comparisons ==="
ast-grep --pattern 'semver.parse($_)' 2>/dev/null || echo "No version comparisons found"
Length of output: 7947
Summary by CodeRabbit
3.1.0
.