-
Notifications
You must be signed in to change notification settings - Fork 61
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
fix(web): RSS feed - Lowercase t in "contentType" query param #17282
Conversation
WalkthroughThe pull request introduces a minor modification to the RSS API endpoint in the Changes
Possibly related PRs
Suggested reviewers
Note: No sequence diagram is generated for this change as it represents a minor parameter case sensitivity adjustment with no significant flow modification. 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
Documentation and Community
|
Datadog ReportBranch report: ✅ 0 Failed, 84 Passed, 0 Skipped, 25.11s Total Time |
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: 0
🧹 Nitpick comments (2)
apps/web/pages/api/rss/index.ts (2)
Line range hint
1-200
: Update API documentation to reflect the parameter change.Since this introduces a new query parameter that's not in production, ensure that the API documentation is updated to reflect the correct parameter name
contenttype
.Would you like me to help create documentation for the RSS API endpoint that includes:
- Available query parameters and their types
- Supported content types
- Example requests and responses
Line range hint
18-18
: Consider using an API request validator middleware.The current approach of validating query parameters individually could be improved by implementing a request validation middleware using a schema validation library (e.g., Zod, Joi).
This would:
- Centralize parameter validation
- Ensure consistent casing rules
- Provide better type inference
- Generate API documentation automatically
Also applies to: 80-80
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/web/pages/api/rss/index.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
apps/web/pages/api/rss/index.ts (1)
Pattern apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
🔇 Additional comments (1)
apps/web/pages/api/rss/index.ts (1)
80-80
:
Verify backward compatibility for the query parameter change.
The change from contentType
to contenttype
might break existing client integrations. Consider implementing a temporary fallback to support both cases during a transition period.
- .parseServerSide(req.query?.contenttype) as 'news' | 'genericList' | 'event'
+ .parseServerSide(
+ (req.query?.contenttype ?? req.query?.contentType)
+ ) as 'news' | 'genericList' | 'event'
Run this script to check for existing usages:
✅ Verification successful
Let me search for any client-side usage of this RSS API endpoint to better understand the impact.
Let me try one more search to find any references to this RSS endpoint with different patterns.
The query parameter change appears to be safe
Based on the search results, there are no direct client-side usages of the RSS API endpoint with the contentType
parameter found in the codebase. The only references to content types are in the CMS services (news.service.ts
, event.service.ts
, cmsSync.service.ts
) which are internal implementations and not related to the API query parameter. Since there's no evidence of existing integrations using the uppercase version, the change from contentType
to contenttype
is unlikely to cause compatibility issues.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for existing usages of the contentType parameter
rg -i "contentType.*=.*['\"](?:news|genericList|event)['\"]" --type ts
Length of output: 584
Script:
#!/bin/bash
# Search for RSS API endpoint usage
rg -i "api/rss.*contenttype" --type ts -A 2
# Also search for any documentation or test files mentioning the RSS endpoint
fd -e md -e test.ts -X rg -i "api/rss"
Length of output: 84
Script:
#!/bin/bash
# Search for RSS API endpoint usage with broader patterns
rg -i "/api/rss\?" --type ts -A 2
# Look for RSS-related tests
rg -i "describe.*rss" --type ts
# Check if there's a specific RSS configuration file
fd -e ts -e js -e json -X rg -i "rss.*config"
Length of output: 117
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17282 +/- ##
==========================================
+ Coverage 35.68% 35.71% +0.02%
==========================================
Files 6922 6944 +22
Lines 148524 148488 -36
Branches 42419 42398 -21
==========================================
+ Hits 53008 53034 +26
+ Misses 95516 95454 -62
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 66 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* feat(web): RSS feed for events and generic list items (#17270) * WIP * Add support for generic list items and events --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * fix(web): RSS feed - Lowercase t in "contentType" query param (#17282) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * fix(web): RSS feed - Event dates should show single digit for date if it can (#17297) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
RSS feed - Lowercase t in "contentType" query param
What
Checklist:
Summary by CodeRabbit
contentType
query parameter for API requests, which may affect how clients specify content types.