Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# type errors with v1.15.0-preview.202405090001 #4691

Closed
kfcampbell opened this issue May 20, 2024 · 4 comments
Closed

C# type errors with v1.15.0-preview.202405090001 #4691

kfcampbell opened this issue May 20, 2024 · 4 comments
Labels
status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience

Comments

@kfcampbell
Copy link
Member

kfcampbell commented May 20, 2024

What are you generating using Kiota, clients or plugins?

API Client/SDK

In what context or format are you using Kiota?

Nuget tool

Client library/SDK language

Csharp

Describe the bug

Note: it's possible this is related to or the same issue as #4690. If so, please close this issue and accept my apologies for the duplication.

Starting May 9th when we switched from Kiota v1.14.0 to 1.15.0-preview.202405090001, our C# SDK builds started failing. The core of the issue appears to be that Kiota is using Team without qualifying it as GitHub.Models.Team, when an existing Team exists in the current namespace.

Kiota version: 1.15.0-preview.202405090001
Kiota dependencies:
{"Name":"Microsoft.Kiota.Abstractions","Version":"1.9.0"},
{"Name":"Microsoft.Kiota.Http.HttpClientLibrary","Version":"1.4.1"},
{"Name":"Microsoft.Kiota.Serialization.Form","Version":"1.2.0"},
{"Name":"Microsoft.Kiota.Serialization.Json","Version":"1.3.0"},
{"Name":"Microsoft.Kiota.Authentication.Azure","Version":"1.1.5"},
{"Name":"Microsoft.Kiota.Serialization.Text","Version":"1.2.0"},
{"Name":"Microsoft.Kiota.Serialization.Multipart","Version":"1.1.4"}

Expected behavior

We expect the type to be qualified correctly and our C# SDK to build successfully.

How to reproduce

Open API description file

https://github.com/github/rest-api-description/blob/main/descriptions/api.github.com/api.github.com.yaml

Kiota Version

1.15.0-preview.202405090001

Latest Kiota version known to work for scenario above?(Not required)

v1.14.0

Known Workarounds

Configuration

This occurs locally and in GitHub Actions; I do not believe this is architecture-specific.

Debug output

⚠ Debug log is too big to paste here. Please let me know if you'd like this as a separate file and I can include it as a gist.

Other information

It appears that Kiota is using Team without qualifying it as GitHub.Models.Team, when an existing Team exists in the current namespace.

@kfcampbell kfcampbell added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels May 20, 2024
@kfcampbell
Copy link
Member Author

@baywet
Copy link
Member

baywet commented May 21, 2024

Hi @kfcampbell
Thanks for reporting this.
I'm not able to reproduce the issue with the provided information. (yes, I used the dotnet repo as opposed to the go one in the instructions)

Here is the updated powershell version for later for an eventual bisect.

pushd D:/github/source-generator
go run schemas/main.go --schema-next=false

$Env:KIOTA_TUTORIAL_ENABLED = $false
dotnet run --project D:/github/kiota/src/kiota/kiota.csproj -c Release -- generate -l csharp -o D:/github/dotnet-sdk -c GitHubClient -n GitHub -d schemas/downloaded.json --ebc --dvr all
go build -o post-processors/csharp/post-processor.exe post-processors/csharp/main.go
popd
pushd D:/github/dotnet-sdk
. "D:/github/source-generator/post-processors/csharp/post-processor.exe" $pwd/src/GitHub
dotnet build
$dotnetExitCode = $lastExitCode
git clean -f .
git checkout .
popd
if ($dotnetExitCode -ne 0) {
   Write-Error "status snake case"
   exit 1;
}

@baywet baywet added the status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close label May 21, 2024
@baywet baywet added this to the Backlog milestone May 21, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@kfcampbell
Copy link
Member Author

First of all, I apologize for the Go language! That was poor form since I opened two issues.

Secondly, I went to go reproduce this today, and it turns out our builds are failing for an unrelated reason (though the workaround for this issue is in place). For our product, I think the best course of action is switching off of prerelease builds.

We can leave this issue and #4690 closed, and should we somehow see errors in v1.15.0 upon its release, I can reopen or open new issues as appropriate.

Thanks Vincent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience
Projects
Archived in project
Development

No branches or pull requests

2 participants