Skip to content

fix(ruby): stop models with colliding file names overwriting each other - #8127

Merged
Vincent Biret (baywet) merged 2 commits into
microsoft:mainfrom
andreaTP:fix/ruby-github-dangling-using
Sep 2, 2026
Merged

fix(ruby): stop models with colliding file names overwriting each other#8127
Vincent Biret (baywet) merged 2 commits into
microsoft:mainfrom
andreaTP:fix/ruby-github-dangling-using

Conversation

@andreaTP

Copy link
Copy Markdown
Contributor
  • 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

@baywet Vincent Biret (baywet) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.NormalizeFileName to 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.

@baywet

Copy link
Copy Markdown
Member

Andrea Peruffo (@andreaTP) can you run dotnet format on that file please?

auto-merge was automatically disabled September 2, 2026 13:39

Head branch was pushed to by a user without write access

@andreaTP

Copy link
Copy Markdown
Contributor Author

done 👍

@baywet Vincent Biret (baywet) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making the changes!

@baywet
Vincent Biret (baywet) added this pull request to the merge queue Sep 2, 2026
Merged via the queue into microsoft:main with commit 114aa7e Sep 2, 2026
334 of 344 checks passed
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