-
Notifications
You must be signed in to change notification settings - Fork 23
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
[MPOM-244] upload SHA-512 only for source-release to staging repo #40
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I consider this change non-sense and incomplete:
- ASF releases are solely distributed through dist.apache.org
- Generating checksums on the fly for remote repos is done by Maven Resolver
- Uploading checksums for a subset of items makes no sense
Note that Maven Resolver uses checksums to detect transport corruption only. Verification must happen with signatures.
@hboutemy WDYT? |
Not in all Apache projects, look at https://repo1.maven.org/maven2/org/apache/sling/org.apache.sling.api/2.9.0/ or https://repo1.maven.org/maven2/org/apache/felix/org.apache.felix.scr/2.1.8/. Maven Central has the source-release artifacts as well.
Only MD5 and SHA1. SHA512 has been explicitly disabled for performance reasons (https://issues.apache.org/jira/browse/MRESOLVER-140)
ASF policy enforces that only for those releases (https://infra.apache.org/release-distribution.html#sigs-and-sums). For the binaries it is never checked (because as you said, Maven will only use MD5/SHA1 to detect transport corruption) and ASF doesn't care about the binaries anyhow. |
They must comply with: https://infra.apache.org/release-distribution.html. They can provide more if they like, but not less than that.
What holds you off to enable this?
ASF never provides binary. The only official release is a source tarball/zip. Binaries are courtesy. So if you want to point someone to an Apache release, point to downloads.apache.org. That's it. |
To be honest, it is a bit tough to discuss with you. Also language like "non-sense" does not really help. But let me try to respond to your complaints:
Yes, even Apache Sling and Felix do that, but this is IMHO not relevant in the context of this PR.
This is only possible with command line options and not via pom.xml configuration. To distribute that among a team is much more effort than on relying on a plugin available from Maven Central which is even compatible with Apache Maven prior 3.8.1 (which is IMHO the first release shipping with Maven Resolver 1.6.x supporting SHA-512 on demand)
Same as above. IMHO not really relevant in the context of this PR. In fact a lot of ASF projects provide binaries via Maven Central although ASF only mandates distribution of source archives. The whole point about this PR is being able to use the Nexus Staging Repo as the single source for dist and Maven Central (as that eases validating a release candidate and therefore voting on a release). |
Does this work for you? I also believe that if you attach checksums Resolver will calculate checksums of checksums. |
I decided against using maven-resolver-impl for calculating SHA-512 for the following reasons:
Although the SHA-512 artifact being calculated by the checksum-maven-plugin will get another MD5/SHA1 checksum when being deployed that IMHO doesn't do any harm. |
@hboutemy I would appreciate your input on this as well. |
IIUC, in the end, you end-up about publishing sha512 checksum to Central only for source-release? => adding that key aspect to the PR title, will need to see if/how/when to update Jira on the implementation side, this means that the current commit is big because there was POM reformatting (change of order of 2 plugins), but the real update is about adding |
The reordering is necessary due to nicoulaj/checksum-maven-plugin#112 as both plugins leverage the same phase. Therefore we have to first attach the SHA-512 checksum before calculating the signature. The maven-gpg-plugin will not sign SHA-512 files (https://github.com/apache/maven-gpg-plugin/blob/878edefba0f80b55701ea347a69b58c9bbeca37d/src/main/java/org/apache/maven/plugins/gpg/GpgSignAttachedMojo.java#L53) |
I understand why you need to exclude asc from checksum, if asc was produced before checksum |
Let me summarize the status quo (without PR):
With this PR the order is inverted:
Without the inverted order the |
ah, ok, I didn't get that attaching checksums required to switch from |
@kwin wouldn't |
files goal does never attach with a classifier, therefore we can't use it |
ok, then it's safer to bind the |
I can do that but for clarity reason I would still reorder in the pom Update: Done in 5b2579d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have checked the change. Two questions:
- Will Resolver generate a checksum of the checksum when the checkusm is attached?
- What will happen if Resolver is configured to generate SHA-512 sums?
I answered the first question already in #40 (comment):
For the 2nd question, I have not tried, but most probably resolver will just overwrite the existing file (with the same content), for now this isn't an issue, because I don't see a reason why ASF projects should generate SHA-512 by Maven Resolver, it won't ever be enabled by default for performance reasons. |
Even if Resolver overwrites, Nexus Staging might reject this because the file is uploaded twice. You should check that. |
@hboutemy I wonder what will happen during a release: Maven Resolver uploads SHA-512, this change uploads it. Will Nexus staging reject it? This should be tested before merged. |
the day Maven Resolver will be configured to upload sha512, we'll remove this hack (because, yes, it's a hack to ease our release process) |
People can already configure it. I just want to avoid surprises for all Apache folks. E.g., Mark Thomas does this actively now. |
See here: https://repo1.maven.org/maven2/org/apache/tomcat/tomcat-catalina/10.0.6/ Produced by Resoler via Ant. |
FYI, I added some instructions to calculate sha512 in dist: apache/maven-site@29bc21e |
can you show me, please? I don't know how to do that notice: I mean using Maven, because that's the Maven ASF parent POM that we're tweaking... |
I have done this massively in Core ITs: apache/maven-integration-testing@672728a |
See https://maven.apache.org/resolver/configuration.html for |
oh nice, I didn't know that content! |
changed pom.xml version to 23 and ran the same |
That is nice. One can manually delete the redundant files from staging. |
I did not test yet, but why don't we just add |
@hboutemy See my answer in #40 (comment). SHA-512 checksum are not enabled by default for performance reasons: https://issues.apache.org/jira/browse/MRESOLVER-138. Although this affects mainly downloads it shows that SHA-512 checksums won't be checked automatically by Maven (probably will never be). Therefore the additional SHA512 only makes sense for artifacts not (primarily) downloaded via Maven. |
@kwin ok, thanks for the link |
@kwin Thanks for bearing with me. I am very picky when it affects all ASF committers. |
This change bugs me, mostly because the checksum files it creates aren't following any kind of standard. I would have preferred the content of the generated file not just be a raw checksum, but actually follow GNU coreutils default format or, more preferably, the BSD "tag" format (see https://man7.org/linux/man-pages/man1/sha512sum.1.html). Following a standard file format allows one to quickly and easily use standard tools to verify the checksum ( |
reading your comment, it makes me feel that for a very long time, we're probably conflating:
|
ASF mandates this format: https://www.apache.org/info/verification.html |
@ctubbsii @hboutemy @kwin There are many many issues conflated here and a lot of misunderstanding in general. I had a very lengthly talk about this in general with @cstamas recently. Disclaimer: I will not talk about signatures here. First of all, Maven repo (e.g., Central) != Apache dist area. The checksums in repo are solely for bitrot NOTHING ELSE. The format is basically an implementation detail of Maven Resolver, though the parsing is lenient. @kwin You maybe remember that we have talked about this.
Those are not checksum algorithms. @ctubbsii I here do agree with you that the dist area is most designed for human consumption (or curl, etc) and not Maven Resolver. Therefore proper checksums are highly advised. I highly favorize BSD tags since they are default, obviously on BSD systems including macOS, OpenSSL generates them as well by default and GNU sum tools can produce and consume them with ease. Upshot: Lets discuss a proper solution for the Apache dist area for all Maven-based projects. PS: You can of course abuse a cryptographic hashing algorithm like |
I do agree with
but the same is true for MD5 and SHA1. The format of hashes in Apache Dist are standardized among all ASF projects and the information from https://www.apache.org/info/verification.html implies that you MUST(!) use the raw hash in the files! |
Exactly!
I don't see this requirement of raw hash. Can you explicitly show me? |
You are right that the format is not stated on https://www.apache.org/info/verification.html but I would conclude that from https://infra.apache.org/release-signing.html#basic-facts
|
But not explicit. I don't know who to talk to, but this should be clarified explicitly as it causes confusion as you see. |
The referenced page of apache explicitly mentions the usage of The format from my point of view is a consequence by using the appropriate tools... if not otherwise explicitly mentioned I would assume that the format is the one which can be consumed by the given tools. This is currently not the case. |
...and they all produce different output. Windows does not even work:
Alternatively:
What now? |
A lot of this discussion is out of scope for MPOM. The point I was trying to make here in #40 (comment) is that this shouldn't be running by default in the apache-release profile if it's going to produce files with less overall utility to the staging process than the ones projects might already be creating for themselves. Therefore, it doesn't add much value to those MPOM users. I don't think MPOM should decide the format for the whole project, but I'm happy to advocate for the BSD "tag" style in the appropriate venue. For here, I'd be happy if it could be disabled more easily, or configured to provide the output format I prefer, so it's not just being a bother. |
https://issues.apache.org/jira/browse/MPOM-244
The SHA-512 checksum should be attached similar to the source-release.