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

Generate scripts/install-pulumi-plugin.json #8730

Merged
merged 6 commits into from
Jan 19, 2022

Conversation

iwahbe
Copy link
Member

@iwahbe iwahbe commented Jan 12, 2022

Description

Fixes #8701

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • Yes, there are changes in this PR that warrants bumping the Pulumi Service API version

@iwahbe iwahbe self-assigned this Jan 12, 2022
@github-actions
Copy link

Diff for pulumi-random with merge commit 31c71d7

@github-actions
Copy link

Diff for pulumi-azuread with merge commit 31c71d7

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit 31c71d7

@github-actions
Copy link

Diff for pulumi-gcp with merge commit 31c71d7

@github-actions
Copy link

Diff for pulumi-azure with merge commit 31c71d7

@github-actions
Copy link

Diff for pulumi-aws with merge commit 31c71d7

@codecov
Copy link

codecov bot commented Jan 12, 2022

Codecov Report

Merging #8730 (89937ed) into master (48012b5) will increase coverage by 0.03%.
The diff coverage is 93.02%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8730      +/-   ##
==========================================
+ Coverage   59.33%   59.36%   +0.03%     
==========================================
  Files         637      637              
  Lines       97740    97800      +60     
  Branches     1385     1385              
==========================================
+ Hits        57995    58060      +65     
+ Misses      36470    36462       -8     
- Partials     3275     3278       +3     
Impacted Files Coverage Δ
pkg/codegen/nodejs/gen.go 83.84% <93.02%> (+0.14%) ⬆️
pkg/codegen/dotnet/templates.go 100.00% <0.00%> (ø)
sdk/dotnet/Pulumi/Deployment/CallOptions.cs 0.00% <0.00%> (ø)
sdk/dotnet/Pulumi/Deployment/InvokeOptions.cs 100.00% <0.00%> (ø)
sdk/dotnet/Pulumi/Resources/ResourceOptions.cs 100.00% <0.00%> (ø)
sdk/dotnet/Pulumi/Deployment/Deployment_Call.cs 0.00% <0.00%> (ø)
...dk/dotnet/Pulumi/Resources/ResourceOptions_Copy.cs 100.00% <0.00%> (ø)
...k/dotnet/Pulumi/Resources/ResourceOptions_Merge.cs 0.00% <0.00%> (ø)
pkg/codegen/dotnet/gen.go 82.35% <0.00%> (+0.02%) ⬆️
sdk/dotnet/Pulumi/Resources/Resource.cs 73.36% <0.00%> (+0.13%) ⬆️
... and 5 more

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 48012b5...89937ed. Read the comment docs.

@github-actions
Copy link

Diff for pulumi-azure-native with merge commit 31c71d7

@iwahbe iwahbe requested review from justinvp and a team January 12, 2022 18:53
@iwahbe iwahbe added impact/no-changelog-required This issue doesn't require a CHANGELOG update and removed impact/no-changelog-required This issue doesn't require a CHANGELOG update labels Jan 12, 2022
@iwahbe iwahbe requested a review from stack72 January 12, 2022 20:00
Comment on lines -2130 to -2133
// Ideally, this `scripts` section would include an install script that installs the provider, however, doing
// so causes problems when we try to restore package dependencies, since we must do an install for that. So
// we have another process that adds the install script when generating the package.json that we actually
// publish.
Copy link
Member

Choose a reason for hiding this comment

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

Hmmm. Is it a real problem in practice? Generally, we yarn link a locally built package. Will the install script run as part of a yarn link and try to install a plugin that hasn't been released yet?

(Wondering the same if we switch off yarn to using npm link, i.e. #8003)

If this is a problem, we may have to rethink this.

Copy link
Member Author

@iwahbe iwahbe Jan 12, 2022

Choose a reason for hiding this comment

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

I have built a project linked against a code generated module (using yarn link). It works without running the install script. npm link does run the install script. We can mitigate this issue by having the install script exit cleanly if it is passed a version of ${VERSION}, since we don't update that until the version is known (and the package is published).

Implemented as 3e3e916

@github-actions
Copy link

Diff for pulumi-azuread with merge commit 18a99ba

@github-actions
Copy link

Diff for pulumi-random with merge commit 18a99ba

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit 18a99ba

@github-actions
Copy link

Diff for pulumi-gcp with merge commit 18a99ba

@github-actions
Copy link

Diff for pulumi-azure with merge commit 18a99ba

@github-actions
Copy link

Diff for pulumi-aws with merge commit 18a99ba

@github-actions
Copy link

Diff for pulumi-azure-native with merge commit 18a99ba

@iwahbe iwahbe requested a review from justinvp January 12, 2022 22:23
@github-actions
Copy link

Diff for pulumi-azuread with merge commit 184fb28

@github-actions
Copy link

Diff for pulumi-random with merge commit 184fb28

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit 184fb28

@github-actions
Copy link

Diff for pulumi-gcp with merge commit 184fb28

@github-actions
Copy link

Diff for pulumi-azure with merge commit 184fb28

@github-actions
Copy link

Diff for pulumi-aws with merge commit 184fb28

@github-actions
Copy link

Diff for pulumi-azure-native with merge commit 184fb28

@github-actions
Copy link

Diff for pulumi-random with merge commit a72a5cd

@github-actions
Copy link

Diff for pulumi-azuread with merge commit a72a5cd

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit a72a5cd

@github-actions
Copy link

Diff for pulumi-gcp with merge commit a72a5cd

@github-actions
Copy link

Diff for pulumi-azure with merge commit a72a5cd

@github-actions
Copy link

Diff for pulumi-aws with merge commit a72a5cd

@github-actions
Copy link

Diff for pulumi-azure-native with merge commit a72a5cd

Comment on lines 2537 to 2538
// NOTE: version split is intended to prevent sed style replacement
if (args.indexOf("${VERS" + "ION}") != -1) {
Copy link
Member

Choose a reason for hiding this comment

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

Clever. Can we get away without it, though, and just look for the "${VERSION}" string as-is? I don't think we're doing sed style replacement in this file anywhere. And if there is a pluginDownloadURL set, the URL could contain ${VERSION} with #8507, so it's possible this file may end up having ${VERSION} in it anyway.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that #8507 ensures that you are right here. Good catch.

pkg/codegen/nodejs/gen.go Outdated Show resolved Hide resolved
@iwahbe iwahbe requested a review from justinvp January 14, 2022 01:49
@github-actions
Copy link

Diff for pulumi-random with merge commit ba6c766

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit ba6c766

@github-actions
Copy link

Diff for pulumi-azuread with merge commit ba6c766

@github-actions
Copy link

Diff for pulumi-gcp with merge commit ba6c766

@github-actions
Copy link

Diff for pulumi-azure with merge commit ba6c766

@github-actions
Copy link

Diff for pulumi-aws with merge commit ba6c766

@github-actions
Copy link

Diff for pulumi-azure-native with merge commit ba6c766

@iwahbe iwahbe requested a review from a team January 19, 2022 17:44
Copy link
Member

@justinvp justinvp left a comment

Choose a reason for hiding this comment

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

LGTM

@stack72, I am pretty sure that there's no need to immediately update the publish-tfgen-package script as this codegen change is adopted in our provider repos.

From what I can tell and from trying out the script locally, the existing script will continue to run and overwrite what's been generated from this change (which is fine). https://github.com/pulumi/scripts/blob/b6ee1692954d2b39e7a22b0db80b8cc4b735c101/ci/publish-tfgen-package#L33-L42

Eventually, when all the provider repos have been updated, we can remove those lines from publish-tfgen-package so that it'll just use what is generated.

@iwahbe iwahbe merged commit b134b55 into master Jan 19, 2022
@pulumi-bot pulumi-bot deleted the iwahbe/8701/codegen-nodejs-install-script branch January 19, 2022 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[codegen/nodejs] Generate install-pulumi-plugin.js install script
3 participants