Skip to content

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Jan 3, 2026

πŸ“‘ Description

Closes goravel/goravel#303

βœ… Checks

  • Added test cases for my code

Copilot AI review requested due to automatic review settings January 3, 2026 04:23
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 context.Context directly into validation rules. This change allows validation logic to leverage contextual information, such as request-scoped values or cancellation signals, making the validation process more robust and adaptable. Additionally, it incorporates routine updates to the project's Go module dependencies.

Highlights

  • Contextual Validation: Validation rules now receive the context.Context, enabling more sophisticated and context-aware validation logic within the application.
  • Dependency Updates: The pull request includes updates to several Go module dependencies, including the main goravel/framework and various indirect packages, ensuring the project uses up-to-date libraries.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

Copy link

Copilot AI left a 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.

@hwbrzzl hwbrzzl merged commit 538c3fd into master Jan 3, 2026
7 checks passed
@hwbrzzl hwbrzzl deleted the bowen/#303 branch January 3, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ [Feature] Validations rules should receive context

2 participants