A lot of the staging repository capabilities in Nexus Pro were added at the request of Apache. The background there is Apache has always had the concept of holding binaries in a temporary location for a community vote and these features had to be added before Apache could agree to use the software.
Here's an example walkthrough using a recent release (8.0.0-M3) that took a few tries.
# First vote
- "[VOTE] TomEE 8.0.0-M3 (staging-1135)"
https://lists.apache.org/thread.html/f41909414db91fb946d82bfe17045f6a45c46758435b112e4fcf21a2%40%3Cdev.tomee.apache.org%3E
In this email there's a staging repo to `
https://repository.apache.org/content/repositories/orgapachetomee-1135/` and another link to a `
https://dist.apache.org/repos/dist/dev/tomee/staging-1135/tomee-8.0.0-M3`
The first link is the primary thing we should focus on and is the Nexus Pro staging repository. Nexus Pro will create one of these automatically for you when you start uploading. However, the contents of the staging repo are not made public until the repo is closed. Once closed the staging repository is now immutable.
The reason this is important is that once a set of binaries (a staging repo) goes up for vote it should *not* be modified.
On our side of the fence we've had enough votes fail that we often put the staging repo name in the vote thread from the start. It helps keep people from voting on old vote threads and generally reduce confusion. This particular vote ended up getting withdrawn to address feedback.
# Second vote
- "[VOTE] TomEE 8.0.0-M3 (staging-1136) - take two"
https://lists.apache.org/thread.html/22c2dbea944dbfac78b229389f8b0dc49190558507123c9f2a40db8a%40%3Cdev.tomee.apache.org%3E
In the second vote attempt we have now a new staging repository at `
https://repository.apache.org/content/repositories/orgapachetomee-1136/`
The new `orgapachetomee-1136` was created the same way the previous `orgapachetomee-1135` was created; full release build including tagging git. At this point in time the `orgapachetomee-1135` staging repository is still visible and people can refer to it if they want to compare the new proposed `orgapachetomee-1136` binaries against the old `orgapachetomee-1135` binaries. It's also important to reflect and see how the immutability is very nice as if the `orgapachetomee-1135` binaries were still mutable, odds are someone someday would cut a corner and just tweak them, creating some very ambiguous monkey patching scenario. That's not possible since you can only share immutable binaries. There is no question on "how do we tell them apart" or doubt that two people visited the same URL on different days and saw different things.
Now, it's also important to understand that Nexus Pro does have a "virtual" staging repository of sorts that is the aggregate of all staging repositories. This is what we have been using on the Jakarta side. The trick is that everything available at this `virtual` staging repository URL is volatile and transient. As an aggregate of all staging repositories, it's also an aggregate of all failed attempts. What this means is you'll see all of the `orgapachetomee-1135` binaries with the `orgapachetomee-1136` binaries overlaid on top. If `orgapachetomee-1135` had a file it should not have and `orgapachetomee-1136` ensured that file was not present when it was published, the virtual staging directory will still show the deleted file and the only possible clue you'd have that it shouldn't be there is the older date stamp.
You can of course have a policy to delete the old staging repos immediately to avoid confusion around the virtual staging repository, but it does not fix that the virtual staging repository is non-deterministic and volatile. Any new attempts from anyone will keep overlaying and the contents of the virtual staging repository URL will change. Virtual staging repository URLs are mutable.
# That second URL?
You might have wondered what that second "Binaries and Source" URL was that you've seen in the votes. Apache has a binary distribution and mirror system that predates Maven Central and it's a requirement that projects use it.
For example the final TomEE 8.0.0-M3 zip/tar binaries and every zip/tar we've ever released are here:
http://archive.apache.org/dist/tomee/tomee-8.0.0-M3/ What lives here will be the select binaries people find most interesting, like the server zips/tars and as well as the full source zip of the entire git or svn tag that built those binaries. It's an Apache requirement that you are able to build the published binaries from a published source zip; note those "-source.jar" files in Maven Central do not cut it as they are not buildable.
When we stage this full-repo source zip and select "interesting" binaries we have a convention to use the Nexus Pro staging repo name in the URL path. So the first and second URLs are distinguishable:
-
https://dist.apache.org/repos/dist/dev/tomee/staging-1135/tomee-8.0.0-M3
-
https://dist.apache.org/repos/dist/dev/tomee/staging-1136/tomee-8.0.0-M3
It is not Nexus Pro doing this work and these URLs *are* mutable, but in practice we do not change them and treat them just as Nexus Pro would. Though it is an on-your-honor system and requires humans to do the right thing, we find that making the Nexus Pro staging number the universal "our release attempt" number and reflecting it everywhere (vote threads, all staged directories) helps keep everyone on the same page. Where there is less confusion there are fewer mistakes. We have also since automated creating those "out of nexus" staging directories and have a command line tool that will download the select "interesting" binaries from the actual Nexus Pro staging repos and put them into that similarly-named directory.
If we did decide we wanted to push some files to
https://download.eclipse.org/microprofile/, my recommendation would be we stage them using the same approach: we stage to Nexus Pro and pull anything that needs to get published to
download.eclipse.org in some sort of `
https://download.eclipse.org/microprofile/staging/orgeclipsemicroprofile-1234` directory during the vote.
# Publishing a release
Once a vote goes final you just need to got to Nexus Pro, select the staging repo and say "release." When that is done the contents are pushed to Maven Central and the staging repo is deleted. Any other staging repos from past attempts can either get deleted manually or stay there until Nexus expires them automatically after 30 days.
Similarly, the manually handled
dist.apache.org staged binaries are moved to the permanent location via a simple copy of all contents inside the `staging-1136/*` directory to the root TomEE dist directory. I.e. we take everything under `staging-1136` and move it to where it needs to go then we delete the now empty `staging-1136` directory.
Hope some of this is useful for our consideration in the MicroProfile Specification Process voting/releasing.
The short version of the idea is that we could put all these staging links into a Github Issue and use that to track progress and prepare the materials for vote. This would include putting the staged repo name/number in the actual ballot.
--
David Blevins
http://twitter.com/dblevins
http://www.tomitribe.com
310-633-3852