-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[codegen/python] Correctly ref external types/resources w/ same mod name #8910
Conversation
Diff for pulumi-random with merge commit 2050952 |
Diff for pulumi-azuread with merge commit 2050952 |
if modName == mod.mod { | ||
modName = "" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it was mistakenly copied from the non-external cases:
objectType
:
pulumi/pkg/codegen/python/gen.go
Lines 217 to 219 in 7772c3e
if modName == mod.mod { | |
modName = "" | |
} |
tokenToResource
:
pulumi/pkg/codegen/python/gen.go
Lines 274 to 276 in 7772c3e
if modName == mod.mod { | |
modName = "" | |
} |
We don't want to do it for external types/resources.
Diff for pulumi-azuread with merge commit 8106deb |
Diff for pulumi-kubernetes with merge commit 2050952 |
Diff for pulumi-random with merge commit 8106deb |
Codecov Report
@@ Coverage Diff @@
## master #8910 +/- ##
=======================================
Coverage 59.36% 59.37%
=======================================
Files 642 642
Lines 99550 99547 -3
Branches 1389 1389
=======================================
+ Hits 59097 59104 +7
+ Misses 37082 37069 -13
- Partials 3371 3374 +3
Continue to review full report at Codecov.
|
Diff for pulumi-kubernetes with merge commit 8106deb |
Diff for pulumi-gcp with merge commit 2050952 |
Diff for pulumi-gcp with merge commit 8106deb |
Diff for pulumi-azure with merge commit 2050952 |
Diff for pulumi-azure with merge commit 8106deb |
Diff for pulumi-aws with merge commit 8106deb |
Diff for pulumi-aws with merge commit 2050952 |
Diff for pulumi-azure-native with merge commit 8106deb |
Diff for pulumi-azure-native with merge commit 2050952 |
pkg/codegen/internal/test/testdata/external-python-same-module-name/schema.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
76f22a1
to
85de021
Compare
Diff for pulumi-random with merge commit e81afa7 |
Diff for pulumi-azuread with merge commit e81afa7 |
Diff for pulumi-gcp with merge commit e81afa7 |
Diff for pulumi-kubernetes with merge commit e81afa7 |
Diff for pulumi-azure with merge commit e81afa7 |
Diff for pulumi-aws with merge commit e81afa7 |
Diff for pulumi-azure-native with merge commit e81afa7 |
This change fixes the Python codegen to correctly emit references to external types/resources that have the same module name as the referencing resource.
85de021
to
6103cc0
Compare
Diff for pulumi-random with merge commit c8cabef |
Diff for pulumi-azuread with merge commit c8cabef |
Diff for pulumi-gcp with merge commit c8cabef |
Diff for pulumi-kubernetes with merge commit c8cabef |
Diff for pulumi-azure with merge commit c8cabef |
Diff for pulumi-aws with merge commit c8cabef |
Diff for pulumi-azure-native with merge commit c8cabef |
This change fixes the Python codegen to correctly emit references to external types/resources that have the same module name as the referencing resource.
Fixes #8908