-
Notifications
You must be signed in to change notification settings - Fork 12
feat: [#303] Validations rules should receive context #204
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
Conversation
Summary of ChangesHello @hwbrzzl, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the validation system by integrating Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with π and π on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request updates the validation logic to pass the request context to validation rules, which is a great improvement for extensibility. The core change in the Validate method correctly passes r.ctx to validation.Make. However, I've found a potential issue in the implementation of the PrepareForValidation option within ValidateRequest. The fallback logic for retrieving the contractshttp.Context might lead to loss of context values if the context is wrapped by the validation framework, potentially causing subtle bugs. I've left a specific comment with more details. The dependency updates in go.mod and go.sum are noted and seem appropriate for the framework update.
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.
Pull request overview
This PR implements support for passing context to validation rules, addressing issue #303. The main changes include updating the framework dependency to support context-aware validation and modifying validation method calls to propagate the HTTP context.
- Updates the Goravel framework dependency to version with context-aware validation support
- Passes context parameter to validation.Make() method
- Wraps PrepareForValidation callback to handle context type conversion
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| go.mod | Updates goravel/framework dependency and adds new transitive dependencies (go-logr, otel/log) |
| go.sum | Reflects dependency version updates including framework, godump, grpc, and other packages |
| context_request.go | Adds context import, passes r.ctx to validation.Make(), and wraps PrepareForValidation with context type conversion logic |
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
π Description
Closes goravel/goravel#303
β Checks