Add 404 for Analytics.upsert_analytics_rule#47
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR updates the Analytics.upsert_analytics_rule endpoint to document and handle a 404 "not found" response consistently across the OpenAPI spec and Elixir client operation definition. Sequence diagram for Analytics.upsert_analytics_rule 404 handlingsequenceDiagram
actor Client
participant AnalyticsClient as OpenApiTypesense_Analytics
participant TypesenseAPI as Typesense_Analytics_Endpoint
Client->>AnalyticsClient: upsert_analytics_rule(rule_id, payload, opts)
AnalyticsClient->>TypesenseAPI: HTTP PUT /analytics/rules/{rule_id}
TypesenseAPI-->>AnalyticsClient: 404 ApiResponse
AnalyticsClient-->>Client: {:error, ApiResponse} for 404
Updated class diagram for Analytics.upsert_analytics_rule responsesclassDiagram
class OpenApiTypesense_Analytics {
+upsert_analytics_rule(rule_id, payload, opts)
}
class OpenApiTypesense_AnalyticsRule {
+id
+params
}
class OpenApiTypesense_ApiResponse {
+status_code
+message
+errors
}
OpenApiTypesense_Analytics ..> OpenApiTypesense_AnalyticsRule : returns_200
OpenApiTypesense_Analytics ..> OpenApiTypesense_ApiResponse : returns_400
OpenApiTypesense_Analytics ..> OpenApiTypesense_ApiResponse : returns_401
OpenApiTypesense_Analytics ..> OpenApiTypesense_ApiResponse : returns_404
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="lib/open_api_typesense/operations/analytics.ex" line_range="310" />
<code_context>
{400, {OpenApiTypesense.ApiResponse, :t}},
- {401, {OpenApiTypesense.ApiResponse, :t}}
+ {401, {OpenApiTypesense.ApiResponse, :t}},
+ {404, {OpenApiTypesense.ApiResponse, :t}}
],
opts: opts
</code_context>
<issue_to_address>
**issue:** Check that callers pattern-matching on responses are updated to handle the new 404 case explicitly
This new 404 variant changes the response type for this operation. Please review any downstream pattern matches or case clauses that assumed only 200/400/401 to ensure 404 is handled explicitly rather than falling into a generic catch-all.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
TIP This summary will be updated as you push new changes. Give us feedback
There was a problem hiding this comment.
Gates Passed
3 Quality Gates Passed
See analysis details in CodeScene
Absence of Expected Change Pattern
- open_api_typesense/lib/open_api_typesense/operations/analytics.ex is usually changed with: open_api_typesense/lib/open_api_typesense/operations/debug.ex, open_api_typesense/lib/open_api_typesense/operations/collections.ex, open_api_typesense/lib/open_api_typesense/operations/operations.ex, open_api_typesense/lib/open_api_typesense/operations/synonyms.ex, open_api_typesense/lib/open_api_typesense/operations/override.ex, open_api_typesense/lib/open_api_typesense/operations/presets.ex, open_api_typesense/lib/open_api_typesense/operations/curation.ex, open_api_typesense/lib/open_api_typesense/operations/conversations.ex
Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Document 404 Not Found responses for analytics rule updates and align the analytics operation response types accordingly.
Bug Fixes:
Documentation: