fix(core)!: Add min_len to search term.#3604
Conversation
📝 WalkthroughWalkthrough
ChangesPolicy proto/OpenAPI validation and request schema fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello, 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 updates the validation logic for search terms in the core service. By enforcing a minimum length of 1 character, it ensures that search queries are not empty, improving data integrity and search reliability. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
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 the 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 counterproductive. 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. A search term short and sweet, / With length of one complete. / No empty strings allowed, / To keep the system proud. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the Search message in service/policy/selectors.proto to enforce a minimum length of 1 on the term field. Feedback on this change highlights that the generated Go files must be regenerated and committed for the validation to take effect at runtime. Additionally, because proto3 string fields default to an empty string, adding min_len: 1 will cause validation to fail when the field is omitted; it is recommended to ignore the default value during validation using IGNORE_IF_DEFAULT.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
|
|
Successfully created backport PR for |
1.) Set `min_len` of search term to 1 when the field is present 2.) Remove `Search` from `ListRegisteredResourceValues` and `ListObligationTriggers` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Enforced minimum length validation for search terms to prevent empty searches. * Fixed field numbering conflicts in request messages. * **Refactor** * Updated request schemas to improve pagination handling in policy service requests. <!-- end of auto-generated comment: release notes by coderabbit.ai --> (cherry picked from commit 09e22dc)
1.) Set
min_lenof search term to 1 when the field is present2.) Remove
SearchfromListRegisteredResourceValuesandListObligationTriggersSummary by CodeRabbit
Bug Fixes
Refactor