Repository navigation
Enable storage retention for hex - #452
Conversation
andrew
left a comment
There was a problem hiding this comment.
Rather than documenting the 4.1.5-1 / 0.1.0-dev-10 split as a limitation, please fix parseTarballFilename in internal/handler/hex.go. It splits at the last hyphen followed by a digit, so amqp_client-4.1.5-1.tar is stored as package amqp_client-4.1.5, which is wrong for cooldown, policy and listings as well as retention rules. Hex package names can't contain a hyphen, so splitting at the first one (strings.Cut(base, "-")) is enough, with test cases for both version shapes.
With that in, the caveat in the hex docs row and the last two sentences of the init comment can go. The fix can be in this PR or a separate one merged first. This will also need rebasing for the docs/configuration.md table once the neighbouring retention PRs are in.
Tarballs are stored under the name from the tarball filename, and purl keeps hex names as they are, so package rules use the default mapping with the name as published. The filename parser splits versions like 4.1.5-1 at the wrong hyphen and files them under a package like amqp_client-4.1.5, so package rules don't reach them; the docs row says so until the parser is fixed. Refs git-pkgs#306
parseTarballFilename split at the last hyphen before a digit, so amqp_client-4.1.5-1.tar was stored as package amqp_client-4.1.5. Hex names can't contain a hyphen, so it now splits at the first one. The docs caveat is gone. Refs git-pkgs#306
97f6613 to
c3c1204
Compare
|
Fixed in c3c1204: |
Tarballs are stored under the name from the tarball filename, and purl keeps hex names as they are, so package rules use the default mapping with the name as published.
The filename parser splits versions like 4.1.5-1 at the wrong hyphen and files them under a package like amqp_client-4.1.5, so package rules don't reach them; the docs row says so until the parser is fixed.
Refs #306