-
Notifications
You must be signed in to change notification settings - Fork 65
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
feature: Support the new Sonatype Central API #474
feature: Support the new Sonatype Central API #474
Conversation
740fe7f
to
b7753fb
Compare
@xerial , before finalizing and adding tests, could I get an overall thumbs-up on this implementation? Would like to make sure that there's nothing controversial here, otherwise time spent on testing could be wasted effort. |
Formatting issues are fixed - all workflows should now succeed. If there are no issues with the overall approach, I'll add some tests and finalize. |
@Andrapyre First of all, thanks for preparing this PR. It gives us a head start. I also could learn a lot about the new Sonatype API. Major and unknowns:
Good
Minor, but can be painful for me in the long run.Note: You don't need to tackle the items mentioned here, as I will be able to manage them.
After receiving your responses, I can suggest further adjustments to the PR, or I can make these changes myself to save your time, depending on your preference. |
@xerial , thanks for the quick response. Several points:
Let me know your thoughts. I'll proceed in any case with revising the json parsing away from circe. |
One more thought - I wouldn't hold off on merging this until airframe provides multipart support. There are users that need this functionality ASAP (including me) and I'm not sure that multipart uploads, including support for octet streams, will be a quick and simple feature add. Could we merge first and then come back and refactor when airframe provides multipart support? |
@Andrapyre The internal implementation can be changed later, so merging this first works. You need to address only two points addressed as major here #474 (comment)
I'm against changing the behavior of sonatypeBundleRelease with an option (e.g., isSonatypeReleaseAutomatic ) because See also existing commands for supporting such step-by-step executions https://github.com/xerial/sbt-sonatype?tab=readme-ov-file#individual-step-commands I believe not so many users are using these commands, though. |
Understood - I'll make said changes and revert. |
Alright. Several changes here:
I will add some tests (mainly for the Sonatype Central client), along with documentation, and then request a final review. |
f3b8ac2
to
b6cf90a
Compare
Apologies for the delay. I'll be looking into this next week. And with Sonatype's recent announcement about account migration, it looks like I'll also need to get my repositories set up there. |
All good - I had a delay myself due to other commitments taking priority. I did manage to test automatic deployments today, as well as a cross-versioned deployment to Sonatype Central, and everything worked as expected. I will forego tests for now for the sake of immediately merging this. The other client doesn't have testing as is and it seems that sttp might be ripped out in the near future and then all tests would need to be rewritten anyway. On that subject, if the plan is to keep sttp, I'm happy to add tests in a follow-up PR. I still need to add some documentation and push all changes. |
b6cf90a
to
f429b8a
Compare
Documentation is added. Happy to receive a review now. |
@xerial , I have moved all of the basic client operations into a client library here, where I will maintain and test it long term. I also updated some of the retry logic to immediately fail when it encounters user errors (e.g. the user specified wrong credentials, so we shouldn't retry for the next 30 minutes, etc.). Could we get a 4.0.0-RC1 out in the next few days, so that the community can test this? Main question mark for me is how very large, cross-built projects with a lot of modules will be affected and whether we need to build out any extra support for such projects. With Sonatype Central, users can only upload one large bundle. It looks like the legacy oss environment supported parallel processing of some kind vis-a-vis this comment here? The same functionality isn't available in Central. Not sure about the potential breakage there. |
@xerial Are there any blockers before this can be merged and an RC can be published? It would be amazing to be able to use BTW, thanks for maintaining this library ❤️ |
@KacperFKorban , @xerial expressed concerns offline that there was too much overlap between legacy and newer functionality, when many of the features are quite different or mean totally different things. For instance, there are no staging repos, host names, snapshot repos, or profiles, etc. in the new publishing api. Nevertheless, working the new central portal api into this plugin requires us to set values for all or most of these, which makes the code harder to reason about and could lead to potential bugs down the road. When I implemented this for |
Hi folks. As I don't have much time to review or fix it, I'll ship it now and fix it (or review it) later. |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [org.xerial.sbt:sbt-sonatype](https://togithub.com/xerial/sbt-sonatype) | plugin | minor | `3.10.0` -> `3.11.0` | --- ### Release Notes <details> <summary>xerial/sbt-sonatype (org.xerial.sbt:sbt-sonatype)</summary> ### [`v3.11.0`](https://togithub.com/xerial/sbt-sonatype/releases/tag/v3.11.0) [Compare Source](https://togithub.com/xerial/sbt-sonatype/compare/v3.10.0...v3.11.0) <!-- Release notes generated using configuration in .github/release.yml at v3.11.0 --> #### What's Changed ##### 🚀 Features - feature: Support the new Sonatype Central API by [@​Andrapyre](https://togithub.com/Andrapyre) in [https://github.com/xerial/sbt-sonatype/pull/474](https://togithub.com/xerial/sbt-sonatype/pull/474) ##### 🔗 Dependency Updates - Update scalafmt-core to 3.7.17 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/456](https://togithub.com/xerial/sbt-sonatype/pull/456) - Bump actions/setup-java from 3 to 4 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/xerial/sbt-sonatype/pull/457](https://togithub.com/xerial/sbt-sonatype/pull/457) - Update sbt, scripted-plugin to 1.9.8 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/458](https://togithub.com/xerial/sbt-sonatype/pull/458) - Update airframe-http, airspec to 23.12.0 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/459](https://togithub.com/xerial/sbt-sonatype/pull/459) - Update airframe-http, airspec to 23.12.1 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/460](https://togithub.com/xerial/sbt-sonatype/pull/460) - Update airframe-http, airspec to 24.1.0 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/462](https://togithub.com/xerial/sbt-sonatype/pull/462) - Update airframe-http, airspec to 24.1.1 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/463](https://togithub.com/xerial/sbt-sonatype/pull/463) - Update airframe-http, airspec to 24.1.2 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/466](https://togithub.com/xerial/sbt-sonatype/pull/466) - Bump release-drafter/release-drafter from 5 to 6 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/xerial/sbt-sonatype/pull/467](https://togithub.com/xerial/sbt-sonatype/pull/467) - Update scalafmt-core to 3.8.0 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/468](https://togithub.com/xerial/sbt-sonatype/pull/468) - Update airframe-http, airspec to 24.2.0 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/469](https://togithub.com/xerial/sbt-sonatype/pull/469) - Update sbt, scripted-plugin to 1.9.9 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/470](https://togithub.com/xerial/sbt-sonatype/pull/470) - Update airframe-http, airspec to 24.2.1 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/471](https://togithub.com/xerial/sbt-sonatype/pull/471) - Update airframe-http, airspec to 24.2.2 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/472](https://togithub.com/xerial/sbt-sonatype/pull/472) - Update scala-library to 2.12.19 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/473](https://togithub.com/xerial/sbt-sonatype/pull/473) - Update airframe-http, airspec to 24.2.3 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/475](https://togithub.com/xerial/sbt-sonatype/pull/475) - Update airframe-http, airspec to 24.3.0 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/476](https://togithub.com/xerial/sbt-sonatype/pull/476) - Update scalafmt-core to 3.8.1 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/478](https://togithub.com/xerial/sbt-sonatype/pull/478) - Update airframe-http, airspec to 24.4.0 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/479](https://togithub.com/xerial/sbt-sonatype/pull/479) - Update airframe-http, airspec to 24.4.1 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/480](https://togithub.com/xerial/sbt-sonatype/pull/480) - Update airframe-http, airspec to 24.4.2 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/481](https://togithub.com/xerial/sbt-sonatype/pull/481) - Update airframe-http, airspec to 24.4.3 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/482](https://togithub.com/xerial/sbt-sonatype/pull/482) - Update sbt, scripted-plugin to 1.10.0 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/484](https://togithub.com/xerial/sbt-sonatype/pull/484) - Update airframe-http, airspec to 24.5.0 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/485](https://togithub.com/xerial/sbt-sonatype/pull/485) - Update airframe-http, airspec to 24.5.1 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/486](https://togithub.com/xerial/sbt-sonatype/pull/486) - Update airframe-http, airspec to 24.5.2 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/487](https://togithub.com/xerial/sbt-sonatype/pull/487) - Update airframe-http, airspec to 24.6.0 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/488](https://togithub.com/xerial/sbt-sonatype/pull/488) - Update scalafmt-core to 3.8.2 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/489](https://togithub.com/xerial/sbt-sonatype/pull/489) - Update airframe-http, airspec to 24.6.1 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/490](https://togithub.com/xerial/sbt-sonatype/pull/490) ##### 🛠 Internal Updates - Update sbt-sonatype to 3.10.0 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/455](https://togithub.com/xerial/sbt-sonatype/pull/455) - Update sbt-buildinfo to 0.12.0 by [@​xerial-bot](https://togithub.com/xerial-bot) in [https://github.com/xerial/sbt-sonatype/pull/477](https://togithub.com/xerial/sbt-sonatype/pull/477) ##### Other Changes - feature: Give helpful advice when profile missing on host by [@​rtyley](https://togithub.com/rtyley) in [https://github.com/xerial/sbt-sonatype/pull/461](https://togithub.com/xerial/sbt-sonatype/pull/461) #### New Contributors - [@​Andrapyre](https://togithub.com/Andrapyre) made their first contribution in [https://github.com/xerial/sbt-sonatype/pull/474](https://togithub.com/xerial/sbt-sonatype/pull/474) **Full Changelog**: xerial/sbt-sonatype@v3.10.0...v3.11.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/slick/slick). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTMuMiIsInVwZGF0ZWRJblZlciI6IjM3LjQxMy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Description
This PR adds support for the new Sonatype Central publishing api, documented here and here. To use, ensure that your environment variables contain the appropriate credentials and add the following to your library
build.sbt
:New Dependencies
Adding these was necessary, since the airframe client does not support multipart uploads. Perhaps it is possible to custom-wire the airframe client so that it does this, but I was not successful in an initial try. There is, in any case, no airframe documentation about multipart uploads, nor could I find any support in the code base. The following dependencies made implementation very easy. I have added the "effect-free" versions, since the current
sbt-sonatype
codebase does not use any effects, though use of effects would make certain things like resource management easier.New SBT Keys
Users can customize Sonatype Central deployment names like so:
Additional Notes
This initial version hard-codes the bundle upload to a "user-managed" deployment - i.e. after the bundle is uploaded and verified, users will need to manually press "publish" in order for it to be published to Maven Central. This functionality is ideal for a release candidate version of
sbt-sonatype
, as it gives users the ability to verify that everything is working before publishing. A final version can either hard-code the deployment to "automatic" or introduce a new sbt key so that users can specify this themselves (preferred).Sonatype Central currently does not support publishing snapshots. The documentation says that an uploaded (but not published) deployment can be tested in production by referring to the deployment id, but I have not verified this.
I deployed a library to Sonatype Central using these new changes and it worked with no issues.