-
Notifications
You must be signed in to change notification settings - Fork 54
CI: Demote error to warning if sha256 checksum in .yaml is empty. #616
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
Conversation
There can be legit reasons why the sha256 checksum of a version can be empty. E.g., that version could track a "rolling release" of a package. In most cases, an empty sha256 checksum is probably an oversight that should be fixed. So, emit a warning if it is empty, but continue testing the package.
I suggest we should check for package id such as in
This way, empty sha256 strings will only be allowed for |
Hmm... Should "rolling releases" be limited to the name "dev"? |
In @siko1056 's example for a Furthermore, leaving it unrestricted, gives the opportunity to publish properly versioned packages without sha256 checksum and just get away with a warning. This opens dark doors from a security perspective. At least, when restricting to the use of |
Could you please elaborate on which "dark doors" would open? `* This PR would add that condition to the CI run. |
Your patch allows me to upload It is exactly because most users don't check for checksum that they will see a proper version number and they will assume everything is ok. Whereas, if restricted to |
True. Even if a sha256 checksum is displayed on the package index, a malicious player can still exchange the tarball after the CI ran here. All users that install the package, e.g., with I'd assume that most users don't do these manual steps. Instead, I guess that most users install with If you prefer to not provide that SHA256 checksum with the initial upload of the package, you can do that without affecting the vast majority of users in any way. Only users that prefer to download the tarball manually wouldn't know with which checksum they should compare. For anyone else, nothing changes. So, I don't see where "dark doors" open if the CI ignores the checksum if it is empty in the index. That step in the CI rules still makes sense to make sure that the sha256 checksum is correct if it is set in the .yaml file. Otherwise, that could confuse users that actually download the tarball manually and check its SHA256 hash manually. |
It's not about displaying the sha256 checksum on the package index. Ordinary package releases must be checked with the CI and found true with regards to their declared and actual sha256 checksums. This is not possible for developments brach or for cases like continuous releases. My take is that such releases should be all marked as If a maintainer is allowed to provide a proper release name without a checksum, then this can lead to trouble, even if the maintainer does not intend to. It only takes one bad PR to go unnoticed and be merged into main, before it can be installed in a user's system. The checksum is there to prevent third parties from compromising the maintainers' work. So, octave packages without a proper release cycle should not be allowed to be named arbitrarily. This is why the A released package with the checksum approved by the CI is much harder to tamper with, unless the maintainer is the bad actor. But this is not the purpose of sha256 checksum. |
We are going in circles. Imho, we shouldn't impose arbitrary limits on how maintainers would like to present their packages here. We might want to encourage adding the checksum. But I don't see a strong reason why we need to enforce that. Putting a connection between requiring a checksum and a specific name label seems completely arbitrary to me. But since I see that there are other opinions, I won't merge this PR and will wait for the input from others. |
To some extend I agree to @pr0m1th3as . The checksums are intended for ensuring integrity of the package installation: What I installed today and works fine, should be what I installed 5 years ago, and in future 10 years. Changes must be tracked as checksum changes in version control. Due to the lag of signing and trusted keys, etc. the checksums do not extend to cryptographic signatures to prevent "evil players" entirely. In my opinion, a released package should be bundled once (or deterministic repeatable like in GitHub) and deserves some sort of integrity checksum. This enables to safely copy the archive to other hosting services in private intranets or to machines that do not have internet access, mostly to identify broken packages easily. Now come the question that is neither wrong or right in my opinion, but more what is asked by users and package maintainers: Should every maintainer be forced to give a release a checksum and call it "dev" otherwise? In my opinion yes. Rolling releases can be named after the git branch (main, dev, ...) and as @pr0m1th3as said, a user will know that she installs something "not released" or "not repeatable" in 2 weeks or 2 years. In my experience rolling releases are barely useful for simple users just wanting to follow a blog post where versions should be pinned for reproducibility and pro-users should have a way to install other package tags or versions with proper understanding. Therefore, only the topmost release ID is checked to work to not touch old stuff or dev versions. But again this is more opinion than a final truth. I am still unsure how to handle the case if a maintainer wants to just release a single dev release 🤷 Historically the checksum check, was a warning made to an error after a request by a package maintainer slipping through that warning 3c572c9 and here I would like avoid turning in circles 😅 |
I've currently little time to work on anything Octave related. When I opened this PR, I was thinking this was a small changes that can quickly be dealt with. I didn't anticipate that this could be controversial. Feel free to close or amend this PR if you prefer. It would probably take a couple of weeks before I can come back to looking into this. |
There can be legit reasons why the sha256 checksum of a version can be empty. E.g., that version could track a "rolling release" of a package.
In most cases, an empty sha256 checksum is probably an oversight that should be fixed. So, emit a warning if it is empty, but continue testing the package.