fix(ruby): stop models with colliding file names overwriting each other - #8127
Conversation
Andrea Peruffo (andreaTP)
commented
Sep 2, 2026
- names differing only in separator placement snake-cased to one path, losing a model
- disambiguates the file name rather than the type, so the generated API is unchanged
- un-suppresses github, excluding the contents endpoint as java and typescript do
- names differing only in separator placement snake-cased to one path, losing a model - disambiguates the file name rather than the type, so the generated API is unchanged - un-suppresses github, excluding the contents endpoint as java and typescript do
Vincent Biret (baywet)
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
There was a problem hiding this comment.
🟢 Approval recommended
The change is well-scoped, includes targeted regression tests, and the filename disambiguation approach is deterministic and consistent with the generator’s rendering flow.
Pull request overview
This PR improves Ruby SDK generation correctness by preventing Ruby model/enum files with snake-cased name collisions from overwriting each other, while keeping the generated type names unchanged. It also re-enables the GitHub Ruby integration test by narrowing the suppression to the known-problematic endpoint, aligning Ruby with existing Java/TypeScript behavior.
Changes:
- Update
RubyPathSegmenter.NormalizeFileNameto detect per-namespace snake_case collisions and disambiguate colliding filenames using a stable numeric suffix. - Add focused unit tests covering collision scenarios (enum/enum, class/enum, stability on non-collisions, repeat-call determinism).
- Adjust Ruby integration-test configuration and RuboCop settings to remove broad suppression and disable a noisy cop for the GitHub description.
File summaries
| File | Description |
|---|---|
| tests/Kiota.Builder.Tests/PathSegmenters/RubyPathSegmenterTests.cs | Adds regression tests proving filename collision disambiguation and stability behavior. |
| src/Kiota.Builder/PathSegmenters/RubyPathSegmenter.cs | Implements stable, per-namespace collision detection and disambiguated Ruby filenames to prevent overwrites. |
| it/ruby/.rubocop.yml | Disables Lint/MissingSuper to avoid false positives from an API property named inherited. |
| it/config.json | Removes Ruby-wide GitHub suppression and narrows it to the /contents endpoint, matching other languages. |
| CHANGELOG.md | Documents the Ruby collision fix and GitHub IT un-suppression behavior. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Andrea Peruffo (@andreaTP) can you run dotnet format on that file please? |
Head branch was pushed to by a user without write access
|
done 👍 |
Vincent Biret (baywet)
left a comment
There was a problem hiding this comment.
Thank you for making the changes!