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

Convert: Nested named structs are not properly addressed (JSII upstream issue) #2800

Open
ansgarm opened this issue Apr 13, 2023 · 2 comments
Assignees
Labels
bug Something isn't working feature/convert language/c# C# language issues language/golang language/python priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters. upstream/jsii Pending upstream work on JSII

Comments

@ansgarm
Copy link
Member

ansgarm commented Apr 13, 2023

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Expected Behavior

convert should return:

aws.s3_bucket.S3Bucket(self, "bucket",
    logging=aws.s3_bucket.S3BucketLogging(
        target_bucket="target"
    )
)

Actual Behavior

convert returns no proper access for S3BucketLogging

aws.s3_bucket.S3Bucket(self, "bucket",
    logging=S3BucketLogging(
        target_bucket="target"
    )
)

Steps to Reproduce

Convert the following snippet to e.g. Python

resource "aws_s3_bucket" "bucket" {
  logging {
    target_bucket = "target"
  }
}

Important Factoids

More details (e.g. for other languages) can be found in the upstream issue linked below

References

  • #0000
@ansgarm ansgarm added bug Something isn't working language/python upstream/jsii Pending upstream work on JSII language/golang language/c# C# language issues feature/convert labels Apr 13, 2023
@xiehan xiehan added this to the 0.17 (tentative) milestone Jun 2, 2023
@xiehan xiehan added the priority/important-soon High priority, to be worked on as part of our current release or the following one. label Jun 2, 2023
@mutahhir
Copy link
Member

This might also be fixable by doing granular imports rather than star imports

@xiehan xiehan added priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters. and removed priority/important-soon High priority, to be worked on as part of our current release or the following one. labels Jul 20, 2023
@DanielMSchmidt DanielMSchmidt self-assigned this Aug 4, 2023
@mutahhir
Copy link
Member

Granular imports were implemented, but they don't help in this specific case.

When we generate TypeScript, we don't import types as they're implicitly handled. When JSII/Rosetta converts the code to the destination language, it doesn't add import statements to the newly added types.

There are two ways of doing this. One is to fix this on the JSII side (recommended), and the other is to make the convert code know about this issue and have it add type imports (possibly faster to implement / easier).

@xiehan xiehan modified the milestones: 0.18, 0.20 (tentative) Aug 15, 2023
@xiehan xiehan removed this from the 0.20 (tentative) milestone Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature/convert language/c# C# language issues language/golang language/python priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters. upstream/jsii Pending upstream work on JSII
Projects
None yet
Development

No branches or pull requests

4 participants