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

[codegen/python] Correctly ref external types/resources w/ same mod name #8910

Merged
merged 3 commits into from
Feb 3, 2022

Conversation

justinvp
Copy link
Member

@justinvp justinvp commented Feb 2, 2022

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

@github-actions
Copy link

github-actions bot commented Feb 2, 2022

Diff for pulumi-random with merge commit 2050952

@github-actions
Copy link

github-actions bot commented Feb 2, 2022

Diff for pulumi-azuread with merge commit 2050952

Comment on lines -168 to -170
if modName == mod.mod {
modName = ""
}
Copy link
Member Author

@justinvp justinvp Feb 2, 2022

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:

if modName == mod.mod {
modName = ""
}

tokenToResource:

if modName == mod.mod {
modName = ""
}

We don't want to do it for external types/resources.

@justinvp justinvp requested a review from stack72 February 2, 2022 20:25
@github-actions
Copy link

github-actions bot commented Feb 2, 2022

Diff for pulumi-azuread with merge commit 8106deb

@justinvp justinvp requested a review from a team February 2, 2022 20:25
@github-actions
Copy link

github-actions bot commented Feb 2, 2022

Diff for pulumi-kubernetes with merge commit 2050952

@github-actions
Copy link

github-actions bot commented Feb 2, 2022

Diff for pulumi-random with merge commit 8106deb

@codecov
Copy link

codecov bot commented Feb 2, 2022

Codecov Report

Merging #8910 (6103cc0) into master (6c179e0) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           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     
Impacted Files Coverage Δ
pkg/codegen/internal/test/sdk_driver.go 78.35% <ø> (ø)
pkg/codegen/python/gen.go 84.27% <ø> (-0.03%) ⬇️
sdk/go/common/resource/properties.go 82.87% <0.00%> (-0.83%) ⬇️
sdk/go/common/util/ciutil/github_actions.go 73.52% <0.00%> (+38.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c179e0...6103cc0. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Feb 2, 2022

Diff for pulumi-kubernetes with merge commit 8106deb

@github-actions
Copy link

github-actions bot commented Feb 2, 2022

Diff for pulumi-gcp with merge commit 2050952

@github-actions
Copy link

github-actions bot commented Feb 2, 2022

Diff for pulumi-gcp with merge commit 8106deb

@github-actions
Copy link

github-actions bot commented Feb 2, 2022

Diff for pulumi-azure with merge commit 2050952

@github-actions
Copy link

github-actions bot commented Feb 2, 2022

Diff for pulumi-azure with merge commit 8106deb

@github-actions
Copy link

github-actions bot commented Feb 2, 2022

Diff for pulumi-aws with merge commit 8106deb

@github-actions
Copy link

github-actions bot commented Feb 2, 2022

Diff for pulumi-aws with merge commit 2050952

@github-actions
Copy link

github-actions bot commented Feb 2, 2022

Diff for pulumi-azure-native with merge commit 8106deb

@github-actions
Copy link

github-actions bot commented Feb 2, 2022

Diff for pulumi-azure-native with merge commit 2050952

Copy link
Member

@iwahbe iwahbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@justinvp justinvp force-pushed the justin/codegen-python-same-module branch from 76f22a1 to 85de021 Compare February 3, 2022 14:28
@github-actions
Copy link

github-actions bot commented Feb 3, 2022

Diff for pulumi-random with merge commit e81afa7

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

Diff for pulumi-azuread with merge commit e81afa7

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

Diff for pulumi-gcp with merge commit e81afa7

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

Diff for pulumi-kubernetes with merge commit e81afa7

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

Diff for pulumi-azure with merge commit e81afa7

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

Diff for pulumi-aws with merge commit e81afa7

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

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.
@justinvp justinvp force-pushed the justin/codegen-python-same-module branch from 85de021 to 6103cc0 Compare February 3, 2022 15:47
@github-actions
Copy link

github-actions bot commented Feb 3, 2022

Diff for pulumi-random with merge commit c8cabef

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

Diff for pulumi-azuread with merge commit c8cabef

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

Diff for pulumi-gcp with merge commit c8cabef

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

Diff for pulumi-kubernetes with merge commit c8cabef

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

Diff for pulumi-azure with merge commit c8cabef

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

Diff for pulumi-aws with merge commit c8cabef

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

Diff for pulumi-azure-native with merge commit c8cabef

@justinvp justinvp merged commit 58cd76f into master Feb 3, 2022
@pulumi-bot pulumi-bot deleted the justin/codegen-python-same-module branch February 3, 2022 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants