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

chore: record ancestry for release 1.103.1 #4629

Closed
wants to merge 3 commits into from
Closed

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Aug 30, 2024

I accidentally squash-merged #4628, which I shouldn't have.

Merge that same branch again, but this time recording ancestry properly. No other changes.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

iliapolo and others added 2 commits August 30, 2024 10:54
…served (#4625)

In #4611, we added the `_jsii_proxy_class__` attributes to the `@jsii.interface` implementations. This was required in order to comply with `typeguard` protocol checking. We didn't implement it correctly, accidentally overriding user defined proxy classes.

## Note

I have been wrecking my brain trying to understand if this bug has any runtime implications, and I couldn't find any.

#### How so?

At runtime, from what I could gather, the `__jsii_proxy_class__` attribute is only used when we try to instantiate a subclass of an abstract class:

https://github.com/aws/jsii/blob/dc77d6c7016bcb7531f6e374243410f969ea1fbf/packages/%40jsii/python-runtime/src/jsii/_reference_map.py#L65-L70

However, for abstract classes, we assign an explicit value to `__jsii_proxy_class__`:

https://github.com/aws/jsii/blob/dc77d6c7016bcb7531f6e374243410f969ea1fbf/packages/jsii-pacmak/lib/targets/python.ts#L1496-L1501

Luckily, this happens **AFTER** the `@jsii.implements` decorator has finished, thus overriding the mistake in the decorator.
Presumably, this would still be a problem for user defined abstract classes (since they don't have this assignment). However, reference resolving for user defined classes is done via native reference lookup:

https://github.com/aws/jsii/blob/dc77d6c7016bcb7531f6e374243410f969ea1fbf/packages/%40jsii/python-runtime/src/jsii/_reference_map.py#L48-L54

This is also why I couldn't come up with a real life test case, and had to resort to an artificial one. 

---

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
@rix0rrr rix0rrr added the pr/no-squash This PR should be merged instead of squash-merging it label Aug 30, 2024
@rix0rrr rix0rrr changed the base branch from main to release August 30, 2024 11:32
@rix0rrr rix0rrr changed the title chore: record ancestry for branch chore: record ancestry for release 1.103.1 Aug 30, 2024
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Aug 30, 2024
@mrgrain mrgrain closed this Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. pr/no-squash This PR should be merged instead of squash-merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants