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

pluginDownloadURL not implemented #1109

Closed
hansbarnard opened this issue May 24, 2023 · 2 comments · Fixed by #1365
Closed

pluginDownloadURL not implemented #1109

hansbarnard opened this issue May 24, 2023 · 2 comments · Fixed by #1365
Assignees
Labels
area/codegen kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@hansbarnard
Copy link

What happened?

I added a custom URL to the property pluginDownloadURL in schema.json. However this property is not used in the generated java SDK. As a result, when using the generated java SDK the pulumi CLI tries to download the plugin from http://get.pulumi.com/... and fails:

image

The build.gradle file generates a plugin.json file but this file does not contain a server property. Also, the value of pluginDownloadURL is not added anywhere else in the generated code.

Expected Behavior

The generated SDK should honour the value of pluginDownloadURL and download the plugin binary from this URL.

Steps to reproduce

Clone https://github.com/hansbarnard/pulumi-test-java and run make build_java.
Check the content of file sdk/java/build/resources/main/com/xxxxx/ipidp/plugin.json

Output of pulumi about

Not applicable.

Additional context

Using java gen v0.9.3

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@hansbarnard hansbarnard added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels May 24, 2023
@Frassle Frassle added area/codegen and removed needs-triage Needs attention from the triage team labels May 26, 2023
@muhlba91
Copy link

muhlba91 commented Jun 7, 2023

i can confirm this. the result in my case is:

{
    "resource": true,
    "version": "0.0.1",
    "name": ""
}

this file should also contain a server property. the file is generated in build.gradle (auto-generated file):

def genPulumiResources = tasks.register('genPulumiResources') {
    doLast {
        def resourcesDir = sourceSets.main.output.resourcesDir
        def subDir = project.name.replace(".", "/")
        def outDir = file("$resourcesDir/$subDir")
        outDir.mkdirs()
        new File(outDir, "version.txt").text = resolvedVersion
        def info = new Object()
        info.metaClass.resource = true
        info.metaClass.name = ""
        info.metaClass.version = resolvedVersion
        def infoJson = new groovy.json.JsonBuilder(info).toPrettyString()
        new File(outDir, "plugin.json").text = infoJson
    }
}

as far as i can tell this is due to https://github.com/pulumi/pulumi-java/blob/main/pkg/codegen/java/build.gradle.template#L77-L79 not setting this property at all.

the context for this template does not even contain a reference to the pluginDownloadUrl: https://github.com/pulumi/pulumi-java/blob/main/pkg/codegen/java/templates_gradle.go#L66-L85

hence, it is also not set in https://github.com/pulumi/pulumi-java/blob/main/pkg/codegen/java/templates_gradle.go#L87 which generates the context which is later passed to the template.

similar to #1118 this is preventing third-party publishers.

@muhlba91
Copy link

@dixler are there any updates to that? as far as i can tell this and #1110 are definitely still blocking third-party publishers.

t0yv0 added a commit that referenced this issue Jun 12, 2024
<!--- 
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->

# Description

This PR will fix the issue described in #1109.

updated `build.gradle` code with `info.metaClass.server`


![image](https://github.com/pulumi/pulumi-java/assets/14177833/f426a845-b078-45d9-b6d9-5a1866fb993a)

generated `plugin.json`:


![image](https://github.com/pulumi/pulumi-java/assets/14177833/a6820aea-2fad-4156-b5c4-b549366f6fd0)


<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->

Fixes #1109

## Checklist

<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [ ] I have added tests that prove my fix is effective or that my
feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have updated the
[CHANGELOG-PENDING](https://github.com/pulumi/pulumi/blob/master/CHANGELOG_PENDING.md)
file with my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Service,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Service API version
<!-- @pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->

---------

Co-authored-by: Thomas Meckel <[email protected]>
Co-authored-by: Anton Tayanovskyy <[email protected]>
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/codegen kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants