Conversation
|
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 56 files out of 163 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the ✨ 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 |
429118a to
276d06f
Compare
276d06f to
3ad364e
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR reduces generated code size by extracting commonly used constants into a centralized constants file (FgaConstants.cs) and removing redundant file headers from auto-generated files. The changes consolidate magic numbers and string literals used throughout the codebase for hash code calculations, retry configurations, HTTP headers, and other SDK constants into a single, maintainable location.
Key changes:
- Created new
FgaConstants.csfile containing SDK-wide constants - Removed 13-line copyright/auto-generation headers from numerous files
- Replaced hardcoded magic numbers (9661, 9923) and string literals with named constants throughout model classes
Reviewed Changes
Copilot reviewed 163 out of 163 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/OpenFga.Sdk/Constants/FgaConstants.cs | New centralized constants file defining SDK version, retry parameters, HTTP headers, and hash code prime numbers |
| src/OpenFga.Sdk/Model/*.cs (90+ files) | Replaced magic numbers in GetHashCode() methods with FgaConstants references and removed file headers |
| src/OpenFga.Sdk/Telemetry/*.cs | Removed file headers and updated to use FgaConstants for header names |
| src/OpenFga.Sdk/Configuration/Configuration.cs | Updated to reference FgaConstants for version, user agent, and retry limits |
| src/OpenFga.Sdk/Client/Client.cs | Replaced hardcoded parallel request limits with FgaConstants references |
| src/OpenFga.Sdk/ApiClient/OAuth2Client.cs | Updated token expiry thresholds to use FgaConstants |
| .openapi-generator/FILES | Updated to reflect new file structure and removed references to deleted files |
| CONTRIBUTING.md | Updated contribution guidelines to clarify issue reporting and PR submission process |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Generated from: openfga/sdk-generator#638 using
What problem is being solved?
How is it being solved?
What changes are made to solve it?
References
Review Checklist
main