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 and publish NPM package with install-pulumi-plugin.js #13195

Closed
AaronFriel opened this issue Jun 17, 2023 · 5 comments
Closed

Generate and publish NPM package with install-pulumi-plugin.js #13195

AaronFriel opened this issue Jun 17, 2023 · 5 comments
Assignees
Labels
area/codegen SDK-gen, program-gen, convert kind/bug Some behavior is incorrect or out of spec language/javascript resolution/fixed This issue was fixed

Comments

@AaronFriel
Copy link
Member

Recently published NPM packages by the ecosystem team have failed to install, on failing to execute a script scripts/install-pulumi-plugin.js. See:

AaronFriel added a commit to pulumi/pulumi-package-publisher that referenced this issue Jun 17, 2023
Fixes #10

This hotfix is intended to substitute for a longer term fix in
pulumi/pulumi#13195. This allows us to update our publishing workflows with a
fixed NPM package.
AaronFriel added a commit to pulumi/pulumi-package-publisher that referenced this issue Jun 17, 2023
Fixes #10

This hotfix is intended to substitute for a longer term fix in
pulumi/pulumi#13195. This allows us to update our publishing workflows with a
fixed NPM package.
AaronFriel added a commit to pulumi/pulumi-package-publisher that referenced this issue Jun 17, 2023
Fixes #10

This hotfix is intended to substitute for a longer term fix in
pulumi/pulumi#13195. This allows us to update our publishing workflows with a
fixed NPM package.
@Frassle
Copy link
Member

Frassle commented Jun 17, 2023

Commented on pulumi/pulumi-package-publisher#10 (comment) so just linking that here for visibility.

@justinvp justinvp added kind/bug Some behavior is incorrect or out of spec area/codegen SDK-gen, program-gen, convert language/javascript labels Jul 18, 2023
@justinvp
Copy link
Member

I think the root cause of this is actually a Node.js sdkgen bug. We do emit the scripts/install-pulumi-plugin.js file as part of sdkgen, but when running tsc to build, the JavaScript file doesn't actually get copied into bin/scripts because it isn't a TypeScript file and isn't listed in tsconfig.json.

Originally, sdkgen did not emit this file at all. Our publishing script injected it into the package before publishing: https://github.com/pulumi/scripts/blob/b6ee1692954d2b39e7a22b0db80b8cc4b735c101/ci/publish-tfgen-package#L33-L42. This ends up running add-plugin-installer-script.js, which adds this copy of install-pulumi-plugin.js into the package.

Eventually we changed sdkgen to emit this file in #8730, but since this file never got "built" and copied into the built directory along with all the other compiled javascript, it was never actually included in the published package. Instead the variant of install-pulumi-plugin.js from the https://github.com/pulumi/scripts repo was being published.

We should fix the Node.js sdkgen to emit a scripts/install-pulumi-plugin.ts TypeScript file (rather than a JavaScript file), and list it in tsconfig.json so that it is copied to the bin/scripts/install-pulumi-plugin.js as part of compiling the TypeScript to JavaScript. (Or, possibly use "allowJs": true in tsconfig.json and list the .js file there, so it is copied over to the built dir).

We may have to update any publish scripts and commands to avoid injecting a scripts/install-pulumi-plugin.js if one already exists.

@Frassle
Copy link
Member

Frassle commented Jul 18, 2023

Honestly wonder if we should just do #13075 and drop these files entirely. NodeJS is going to be the only language where this works via library files, not totally sure it's worth the special treatment.

@Frassle
Copy link
Member

Frassle commented Sep 1, 2023

Closing this as we've changed codegen to drop these files entirely now.

@Frassle Frassle closed this as completed Sep 1, 2023
@pulumi-bot pulumi-bot reopened this Sep 1, 2023
@pulumi-bot
Copy link
Contributor

Cannot close issue:

  • does not have an assignee

Please fix these problems and try again.

@Frassle Frassle self-assigned this Sep 1, 2023
@Frassle Frassle closed this as completed Sep 1, 2023
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
peterdeme added a commit to spacelift-io/pulumi-spacelift that referenced this issue Oct 27, 2023
Apprently Pulumi dropped the install script: pulumi/pulumi#13195 (comment)

Signed-off-by: peterdeme <snypox@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/codegen SDK-gen, program-gen, convert kind/bug Some behavior is incorrect or out of spec language/javascript resolution/fixed This issue was fixed
Projects
None yet
Development

No branches or pull requests

4 participants