Skip to content

chore: reduce generated code#135

Merged
rhamzeh merged 4 commits intomainfrom
chore/reduce-generation
Oct 24, 2025
Merged

chore: reduce generated code#135
rhamzeh merged 4 commits intomainfrom
chore/reduce-generation

Conversation

@rhamzeh
Copy link
Copy Markdown
Member

@rhamzeh rhamzeh commented Oct 14, 2025

Description

Generated from: openfga/sdk-generator#638 using

OPEN_API_REF=0ac19aac54f21f3c78970126b84b4c69c6e3b9a2 OPENAPI_GENERATOR_CLI_DOCKER_TAG=v7.11.0 make build-client-dotnet

What problem is being solved?

How is it being solved?

What changes are made to solve it?

References

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 14, 2025

Important

Review skipped

More 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 reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/reduce-generation

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rhamzeh rhamzeh force-pushed the chore/reduce-generation branch from 429118a to 276d06f Compare October 16, 2025 00:52
@rhamzeh rhamzeh force-pushed the chore/reduce-generation branch from 276d06f to 3ad364e Compare October 24, 2025 15:47
@rhamzeh rhamzeh marked this pull request as ready for review October 24, 2025 16:08
Copilot AI review requested due to automatic review settings October 24, 2025 16:08
@rhamzeh rhamzeh requested review from a team as code owners October 24, 2025 16:08
Copy link
Copy Markdown
Contributor

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 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.cs file 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.

@rhamzeh rhamzeh added this pull request to the merge queue Oct 24, 2025
Merged via the queue into main with commit 707766e Oct 24, 2025
23 checks passed
@rhamzeh rhamzeh deleted the chore/reduce-generation branch October 24, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants