-
Notifications
You must be signed in to change notification settings - Fork 1
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(#285): false-positives for unknowns #534
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Reviewer's Guide by SourceryThis pull request addresses false-positive issues for unknown ingredients and improves the overall functionality of the ingredients controller. The changes include refactoring the ingredient parsing logic, updating the response structure, and modifying test cases. Updated class diagram for IngredientsControllerclassDiagram
class IngredientsController {
+getIngredients(ingredientsParam: string, res: Response, translateFlag: boolean)
+parseIngredients(ingredientsString: string) : string[]
+sendResponse(res: Response, notVeganItems: string[], veganItems: string[], unknownItems: string[])
}
class TranslationService {
+translateText(text: string, targetLang: string, timeout: number)
}
class ResponseData {
+boolean vegan
+string[] surely_vegan
+string[] not_vegan
+string[] maybe_vegan
}
IngredientsController --> TranslationService
IngredientsController --> ResponseData
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @philipbrembeck - I've reviewed your changes - here's some feedback:
Overall Comments:
- The changes look good overall, but please revisit the skipped tests in
errors.controller.spec.ts
to ensure adequate test coverage is maintained.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Ref: #285
Summary by Sourcery
Fix false-positive results for unknown ingredients by categorizing them correctly. Refactor the ingredients parsing logic and improve the response structure. Update tests by removing and skipping certain cases. Update the OpenAPI specification by removing the 'translate' query parameter.
Bug Fixes:
Enhancements:
Documentation:
Tests: