gradle / plugin-portal-requests

Gradle Plugin Portal issues and requests.
https://plugins.gradle.org/
12 stars 8 forks source link

plugin-publish: Plugin published but not activated #149

Closed osipxd closed 2 years ago

osipxd commented 2 years ago

I've published a plugin using publishPlugins task, but for some reason activation failed and the plugin stuck in the state when it is uploaded but not activated.

> Task :infrastructure-publish:publishPlugins FAILED
Publishing plugin com.redmadrobot.publish version 0.16.2
Publishing plugin com.redmadrobot.publish-config version 0.16.2

Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':infrastructure-publish:publishPlugins'.
> Unauthorized!
    Login from command line using:
      gradle login
    or login and download user API keys on:
      https://plugins.gradle.org/user/login

After this error, I've restarted publishPlugins (without login) and "Unauthorized" error just gone. But now I get another error:

Execution failed for task ':infrastructure-publish:publishPlugins'.
> Failed to post to server.
  Server responded with:
  Plugin: 'com.redmadrobot.publish', version: '0.16.2' exists already. It was created: 2022-06-17 09:52:13.076

Expected Behavior

There is possibility to activate or delete uploaded version, via website, for example.

Current Behavior

I can't publish version again (it is already uploaded) as well as I can't delete the uploaded version because it is not activated.

Your Environment

com.gradle.plugin-publish:0.21.0

osipxd commented 2 years ago

The only workaround I found - manually activate version using the following code in the build script:

import com.gradle.publish.OAuthHttpClient
import com.gradle.publish.protocols.v1.models.publish.PublishActivateRequest

val client = OAuthHttpClient(
    /* baseUrl = */ "https://plugins.gradle.org",
    /* publishKey = */ property("gradle.publish.key").toString(),
    /* publishSecret = */ property("gradle.publish.secret").toString(),
)
val request = PublishActivateRequest("com.redmadrobot.publish", "0.16.2")
client.send(request)
donat commented 2 years ago

The plugin is published now

donat commented 2 years ago

FYI the preferred way to reach out to Gradle is by opening an issue on this repository or via the following link: https://plugins.gradle.org/docs/get-help.

osipxd commented 2 years ago

Yes, the plugin is published using workaround I've mentioned before. But it wasn't the point of the issue. The point is to prevent such situations further.

Possible solutions I see: