ory / sdk

The place where ORY's SDKs are being auto-generated
Apache License 2.0
139 stars 86 forks source link

Releasing pipeline is failing #226

Closed aeneasr closed 1 year ago

aeneasr commented 1 year ago

Preflight checklist

Describe the bug

https://app.circleci.com/pipelines/github/ory/sdk/1223/workflows/63eddfc6-ac77-4411-80b0-cc980aed0c1a/jobs/1128

Reproducing the bug

See above

Relevant log output

No response

Relevant configuration

No response

Version

master

On which operating system are you observing this issue?

No response

In which environment are you deploying?

No response

Additional Context

Maybe updating to openapi 6.2.1 solves the problem?

jonas-jonas commented 1 year ago

The issue is related to the python SDK generation seemingly being broken. https://github.com/OpenAPITools/openapi-generator/issues/12590 describes the problem we are having.

aeneasr commented 1 year ago

Does 6.2.1 also have this problem?

jonas-jonas commented 1 year ago

Does 6.2.1 also have this problem?

For some reason, that has even more errors (35 error in 110.86 second)

Not sure what's going on with the generators there. Apparently, they are planning on releasing a completely reworked python generator soon, but no ETA yet.

The same errors are present on 5.4.0 btw. I'll investigate a bit more tomorrow.

aeneasr commented 1 year ago

ok, maybe we can then work around this by fixing NullBool somehow

aeneasr commented 1 year ago

in 6.2.1 the experimental one is the default one, which is why this is probably failing with so many errors. try using python-prior generator with 6.2.1 - that is the original generator. maybe it has the problem fixed

jonas-jonas commented 1 year ago

That has the same 7 errors.

test/test_login_request.py:16: in <module>
    from ory_client.model.o_auth2_client import OAuth2Client
E     File "/project/clients/client/python/ory_client/model/o_auth2_client.py", line 38
E       globals()['from ory_client.model.null_duration import NullDuration'] = from ory_client.model.null_duration import NullDuration
E                                                                                 ^
E   SyntaxError: invalid syntax

It seems, that the generator, for some reason, does not remove the ory_client.model.null_duration import from NullDuration.

jonas-jonas commented 1 year ago

I think I figured out what the issue is, so I am documenting my findings here:

The client API spec contains two models called OAuth2Client (one capitalized and one not):

I hope the fix is to use Open API patches to turn the "uppercase" one into kratosOAuth2Client in the Kratos repository so that they don't clash anymore. See https://github.com/ory/kratos/pull/2902

jonas-jonas commented 1 year ago

This is now fixed in the network repository, but we need an updated spec (presumably a v0.3.1) for this to be available in this repository.

aeneasr commented 1 year ago

v1.0.0 released fine - closing