fix: resolve CSharp wrapper namespace collisions - #8237
Shubham Padkonde (Shubham-Padkonde) wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Two moderate issues remain in wrapper collision merging and suffix-based namespace matching.
Review effort: Lite
Findings: None
What changed in this PR
Fixes C# namespace collisions for composed-type wrapper classes.
Changes:
- Reorders collision handling after wrapper creation.
- Adds union and intersection regression tests.
- Documents the fix in the changelog.
| File | Description |
|---|---|
tests/Kiota.Builder.Tests/Refiners/CSharpLanguageRefinerTests.cs |
Tests wrapper relocation for unions and intersections. |
src/Kiota.Builder/Refiners/CSharpRefiner.cs |
Reorders refinement and collision handling. |
CHANGELOG.md |
Records the collision fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Shubham Padkonde (@Shubham-Padkonde) your behaviour is disruptive, opening about 30 PRs on the repos in a couple of hours time, most likely code that was AI generated and not tested/reviewed, will only clog our review pipeline. Please stop opening additional pull requests and work on the comments added to existing ones. We have turned on pull requests limits on this repository, and will proceed to blocking you at the organization level if additional pull requests are opened on other repositories before the already opened ones are reviewed and closed/or merged. |
|
Shubham Padkonde (@Shubham-Padkonde) this PR is conflicting, would you mind handling the conflicts when you have a minute please? |
|
This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged. |
|
Conflicts have been resolved. A maintainer will take a look shortly. |
|
This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged. |
|
Conflicts have been resolved. A maintainer will take a look shortly. |
|
This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged. |
|
Conflicts have been resolved. A maintainer will take a look shortly. |
|
This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged. |
|
Conflicts have been resolved. A maintainer will take a look shortly. |
1 similar comment
|
Conflicts have been resolved. A maintainer will take a look shortly. |
Hello, can you please look into my open PR's it's been long they are open. |
Fixes #7729.
C# namespace collision handling runs before composed types are converted into wrapper classes. A wrapper created afterward can therefore share its name with a child namespace, producing CS0101. Run the existing collision handling after wrapper creation, before imports are generated, so these wrappers receive the same treatment as ordinary model classes.
Two regressions cover union and intersection wrappers, checking that the original type reference still points at the class after relocation. Both cases fail before the change and pass after it.
Developed with Codex assistance. No live service calls were made.
Validation:
GetsGithubFromApisGuruWithExactMatchAsyncduring an external HTTP download (100-second timeout). This network failure is disclosed; the full suite is not reported as fully green.