fix: service lint issues#3329
Conversation
|
Important Review skippedToo many files! This PR contains 298 files, which is 148 over the limit of 150. ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (298)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 prepares the Highlights
🧠 New Feature in Public Preview: You can now enable Memory 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 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. The code moves to a new home, Where monorepo giants roam. With linting fixed and paths aligned, A better structure we now find. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request reorganizes sorting tests in obligations_test.go and refactors the action deduplication logic in subject_mapping_builtin_actions.go by extracting it into a helper function. A review comment points out that while the new helper deduplicates actions within a single subject mapping, the outer loop continues to append these results, which may lead to redundant action names if multiple mappings match the same attribute value. It is recommended to perform a final deduplication for each value to ensure the output remains unique.
| entitlementsSet[valueFQN] = append( | ||
| entitlementsSet[valueFQN], | ||
| dedupeSubjectMappingActions(subjectMapping.GetActions(), l)..., | ||
| ) |
There was a problem hiding this comment.
The current implementation appends actions to entitlementsSet[valueFQN] for every matching subject mapping across all entities. While dedupeSubjectMappingActions ensures uniqueness within a single mapping, it does not prevent duplicate action names from accumulating when multiple mappings or multiple entities match for the same attribute value. This results in redundant actions in the final output. Since the system seems to intend for action names to be unique per attribute (as evidenced by the conflict detection logic), consider deduplicating the final action list for each valueFQN before returning, or using a map to collect unique actions across all iterations.
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
|
5e7ec70
into
DSPX-2655-migrate-otdfctl
Proposed Changes
Checklist
Testing Instructions