gradle-nexus / publish-plugin

Gradle plugin for publishing to Nexus repositories
Apache License 2.0
399 stars 29 forks source link

possible bug in finding a staging profile #89

Closed sebm253 closed 3 years ago

sebm253 commented 3 years ago

hey, i think there might be a possible bug in finding a staging profile based on the package group specified: https://github.com/gradle-nexus/publish-plugin/blob/f3c24a7b92c5b282fa921cb5f8c966aff6dbf306/src/main/kotlin/io/github/gradlenexus/publishplugin/internal/NexusClient.kt#L81-L83

lets take my case as an example - the staging profile name is dev.mlnr.blh, but when i provide dev.mlnr as the package group, the current code is unable to find that profile, which results in an exception: Failed to find staging profile for package group: dev.mlnr

while i worked around this with explicitly setting the staging profile id, i don't think this is supposed to happen

vlsi commented 3 years ago

when i provide dev.mlnr as the package group

What if the server contains both dev.mlnr.blh and dev.mlnr.hlb? Which one of them should the plugin choose?

sebm253 commented 3 years ago

when i provide dev.mlnr as the package group

What if the server contains both dev.mlnr.blh and dev.mlnr.hlb? Which one of them should the plugin choose?

it's kinda tricky, if you own the domain - in my case mlnr.dev, then it shouldn't matter, right? isn't the staging profile same for all sub-groups? i'm new to this maven-repo-trickery

szpak commented 3 years ago

it's kinda tricky, if you own the domain - in my case mlnr.dev, then it shouldn't matter, right? isn't the staging profile same for all sub-groups?

I you own a domain, you should usually request one staging profile for it (to do not re-request a new staging profile for another projects). However, you might also want to separate permissions to release given projects and have two (or more) staging repositories (e.g. dev.mlnr.blh and dev.mlnr.hlb) with particular developers responsible for the project blh and others for hlb. You, as a domain master/owner/CEO could be added to both the staging profiles. The other case could be an administrative staging project dev.mlnr (with permissions to release all the projects and any new projects) and - in addition - separate profiles for dev.mlnr.blh and dev.mlnr.hlb (per project). However, I'm not sure, if Nexus supports that.

Coming back do the original report. Maybe we could select detailed staging profile, but only if there is just one matching (in a scope of a given user)? Nevertheless, I believe that for the majority of cases it should not be needed.

Btw, @caneleex Why didn't you request dev.mlnr as your staging profile (if you use it as your project's group id)?

sebm253 commented 3 years ago

Btw, @caneleex Why didn't you request dev.mlnr as your staging profile (if you use it as your project's group id)?

i was confused a bit about what to enter as it was my first time requesting my own staging profile or even trying to publish to a public repo, but then i realized i don't want to publish under the sub-group which turned out to work just fine as i got permissions to publish from the root group too, but this plugin didn't see the staging profile as its name is "dev.mlnr.blh". as i said, i worked around this with explicitly setting the staging profile id

szpak commented 3 years ago

i realized i don't want to publish under the sub-group which turned out to work just fine as i got permissions to publish from the root group too

So, currently you have access to two staging profiles in Nexus: dev.mlnr and dev.mlnr.blh? Or I misinterpreted your utterances?

sebm253 commented 3 years ago

i realized i don't want to publish under the sub-group which turned out to work just fine as i got permissions to publish from the root group too

So, currently you have access to two staging profiles in Nexus: dev.mlnr and dev.mlnr.blh? Or I misinterpreted your utterances?

nope, only the dev.mlnr.blh one, but i'm able to publish under the root group as well.however, i can't close any staging repo except the ones which were published under "dev.mlnr.blh" and i'm trying to sort that out with OSSRH support, but they keep marking my issue tickets as duplicates, supposedly ignoring any description i provide and i don't know how this will get resolved. examples - issue 1, issue 2