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

Investigate Kiota non-determinism #28

Open
kfcampbell opened this issue Nov 3, 2023 · 4 comments
Open

Investigate Kiota non-determinism #28

kfcampbell opened this issue Nov 3, 2023 · 4 comments

Comments

@kfcampbell
Copy link
Member

Related to #15 and #27.

For some reason, in the file generated/go/users/item_starred_repository.go, Kiota occasionally generates a file that includes

// ItemStarredRepositoryable
type ItemStarredRepositoryable interface {
    IAdditionalDataHolder
}

when it otherwise generates (correctly)

// ItemStarredRepositoryable
type ItemStarredRepositoryable interface {
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
}

We should take this to the Kiota team and see if they can point us in the right direction.

@baywet
Copy link

baywet commented Nov 7, 2023

Most likely related to this microsoft/kiota#3339
Can you provide the OpenAPI description for the type?
Do you know how often it's referenced?
Which version of kiota are you using at the moment?

Can you try to set the KIOTA_GENERATION_MAXDEGREEOFPARALLELISM environment variable to 0 before you run kiota and see if you get better results? (expect significant performance reduction)

@kfcampbell
Copy link
Member Author

Can you provide the OpenAPI description for the type?

Our schema makes this pretty difficult with its large size unfortunately. My best guess is it's:

a "simple-user" (in a dropdown to condense the comment)
"simple-user": { "title": "Simple User", "description": "A GitHub user.", "type": "object", "properties": { "name": { "nullable": true, "type": "string" }, "email": { "nullable": true, "type": "string" }, "login": { "type": "string", "example": "octocat" }, "id": { "type": "integer", "example": 1 }, "node_id": { "type": "string", "example": "MDQ6VXNlcjE=" }, "avatar_url": { "type": "string", "format": "uri", "example": "https://github.com/images/error/octocat_happy.gif" }, "gravatar_id": { "type": "string", "example": "41d064eb2195891e12d0413f63227ea7", "nullable": true }, "url": { "type": "string", "format": "uri", "example": "https://api.github.com/users/octocat" }, "html_url": { "type": "string", "format": "uri", "example": "https://github.com/octocat" }, "followers_url": { "type": "string", "format": "uri", "example": "https://api.github.com/users/octocat/followers" }, "following_url": { "type": "string", "example": "https://api.github.com/users/octocat/following{/other_user}" }, "gists_url": { "type": "string", "example": "https://api.github.com/users/octocat/gists{/gist_id}" }, "starred_url": { "type": "string", "example": "https://api.github.com/users/octocat/starred{/owner}{/repo}" }, "subscriptions_url": { "type": "string", "format": "uri", "example": "https://api.github.com/users/octocat/subscriptions" }, "organizations_url": { "type": "string", "format": "uri", "example": "https://api.github.com/users/octocat/orgs" }, "repos_url": { "type": "string", "format": "uri", "example": "https://api.github.com/users/octocat/repos" }, "events_url": { "type": "string", "example": "https://api.github.com/users/octocat/events{/privacy}" }, "received_events_url": { "type": "string", "format": "uri", "example": "https://api.github.com/users/octocat/received_events" }, "type": { "type": "string", "example": "User" }, "site_admin": { "type": "boolean" }, "starred_at": { "type": "string", "example": "\"2020-07-09T00:17:55Z\"" } }, "required": [ "avatar_url", "events_url", "followers_url", "following_url", "gists_url", "gravatar_id", "html_url", "id", "node_id", "login", "organizations_url", "received_events_url", "repos_url", "site_admin", "starred_url", "subscriptions_url", "type", "url" ] },

Though it's difficult for me to see how the starred items line up with the property of starred_url.

Do you know how often it's referenced?

Between nullable-user and simple-user, there are 183 references in our schema.

Which version of kiota are you using at the moment?

 sh$ kiota --version
1.8.1+c93d90721f5ff6e0af6c2f41babbf5f2e7bbae61

Can you try to set the KIOTA_GENERATION_MAXDEGREEOFPARALLELISM environment variable to 0 before you run kiota and see if you get better results? (expect significant performance reduction)

I removed the hack to fix this and ran generation five times each with the env variable set and without it set. The error occurred on 3/5 runs without the environment variable but only 1/5 runs with the environment variable. Interestingly, the performance degradation was not noticeable; perhaps we should be conducting all of our runs like that?

@baywet
Copy link

baywet commented Nov 7, 2023

Before you lock your generation workflow to a single thread, I'd like us to look into fixing the underlying issue since you experience it even on a single thread. Can you create an issue in kiota for this one please?

@kfcampbell
Copy link
Member Author

Done! See microsoft/kiota#3700.

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

No branches or pull requests

2 participants