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

Go type errors with v1.15.0-preview.202405090001 #4690

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

Go type errors with v1.15.0-preview.202405090001 #4690

kfcampbell opened this issue May 20, 2024 · 3 comments
Labels
Status: No Recent Activity 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

Go

Describe the bug

Starting May 9th when we switched from Kiota v1.14.0 to 1.15.0-preview.202405090001, our Go SDK builds started failing. The core of the issue appears to be that Kiota is using the filename without the extension ("CodeScanningVariantAnalysis_status") instead of the type inside that file ("CodeScanningVariantAnalysisStatus") as the type in references.

Kiota version: 1.15.0-preview.202405090001

Kiota dependency versions:
github.com/microsoft/[email protected]
github.com/microsoft/[email protected]
github.com/microsoft/[email protected]
github.com/microsoft/[email protected]
github.com/microsoft/[email protected]
github.com/microsoft/[email protected]
github.com/microsoft/[email protected]

Expected behavior

We expect the correct type to be used and our Go SDK builds to succeed.

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 the filename without the extension ("CodeScanningVariantAnalysis_status") instead of the type inside that file ("CodeScanningVariantAnalysisStatus") as the type in references.

@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
@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota May 20, 2024
@kfcampbell
Copy link
Member Author

@baywet
Copy link
Member

baywet commented May 21, 2024

Thanks for reporting this @kfcampbell
I ran a bisect between the two tags with a modified version of the script and all the commits are bad.
Are you sure the change of kiota version triggered the issues? Are you sure you were using 1.14 until the breakage? Could it have been a change in the description?

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 go -o D:/github/go-sdk -n github.com/octokit/go-sdk/pkg/github -d schemas/downloaded.json --ebc --dvr all
go build -o post-processors/go/post-processor.exe post-processors/go/main.go
popd
pushd D:/github/go-sdk
. "D:/github/source-generator/post-processors/go/post-processor.exe" $pwd
$buildResult = go build ./... 2>&1
git clean -f .
git checkout .
popd
$buildResultCount = $buildResult | % {$_.ToString()} | ? { $_.Contains("undefined: CodeScanningVariantAnalysis_status")} | measure | select -ExpandProperty Count
if ($buildResultCount -gt 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
@baywet baywet moved this from Needs Triage 🔍 to Proposed 💡 in Kiota May 22, 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.

@microsoft-github-policy-service microsoft-github-policy-service bot removed this from the Backlog milestone May 28, 2024
@github-project-automation github-project-automation bot moved this from Proposed 💡 to Done ✔️ in Kiota May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: No Recent Activity 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