metacpan-web
metacpan-web copied to clipboard
Add repology version links to the MetaCPAN distribution and module sidebars
Describe the feature
I propose displaying a link the version page link on repology (for example Rex versions) for CPAN distributions and modules (in their sidebars).
Which problem does it solve?
As a CPAN author, it is useful to check the version (and sometimes the history) pages from repology for things like:
-
if a downstream distribution lagging behind on packaging, then the author may reach out to the package maintainers directly to lend a hand and ask for feedback (or even find distro-specific patches to merge upstream!)
-
when choosing a new dependency for their projects, they can check its packaging status across various downstream distributions to judge how much extra effort it might impose on downstream packagers (depending on availability, current versions, etc.)
The latter sounds helpful for the consumers of CPAN distributions as well (not just their authors), to decide between candidates for new dependencies.
Expected behavior
- A link in the dist sidebar on MetaCPAN to the given distributions's version page on repology.
- A link in the module sidebar on MetaCPAN to the same.
Volunteering
I would love to, though I have to admit I have no clue about where to even start.
The only reference I've seen to repology in this repo is a single
<a href="[% $author.links.repology %]">Repology</a>
line, and I have no idea where exactly I should start in order to add similar functionality.
I would be up to a pair programming session with someone more knowledgeable about the project as part of my open source office hours to both implement this and as a learning opportunity for myself.
Given detailed guidance on the major steps for this change, I can also try to follow that on my own (for example (go to this repo, add a test here, change these two files to include the links, generate link in this other file, etc.).
Additional context
This issue is a follow-up from the original reddit thread.
In general, Perl distribution names seem to be converted to lowercase and then prefixed with perl: on repology. The prefix is not always added on repology, so it might be either something to fix there, or requires understanding of the exact mapping logic from there.
In general, Perl distribution names seem to be converted to lowercase and then prefixed with perl: on repology. The prefix is not always added on repology, so it might be either something to fix there, or requires understanding of the exact mapping logic from there.
Yeah, that is a complication. I guess we need to have a custom key in the meta files (e.g. x_repology) that allows authors to override the name if it isn't prefixed with perl:
I guess we need to have a custom key in the meta files (e.g.
x_repology) that allows authors to override the name if it isn't prefixed withperl:
Yeah, I had the same idea as a fallback plan, but I really would like to understand the rules repology uses to decide whether to add a perl: prefix or not. There's certainly some hint that is recognized by repology to consider it "yes, this is perl stuff, let's put perl: in front".
I guess this has to do something like package categories from linux distributions at the moment. Taking Gentoo package categories for example:
| CPAN | Gentoo | repology |
|---|---|---|
| Test-Warnings | dev-perl/Test-Warnings | perl:test-warnings |
| Rex | app-admin/rex | rex |
I guess again, repology might be able to use an extra hint about "hey, this is CPAN, let's put perl: in front regardless of what linux distributions think about their own categories".
ps.: this does not exclude a possibility to recognize a custom meta key like x_repology, but may help match the overwhelming majority even without it.
From what I can see, this is done manually: https://github.com/repology/repology-rules/blob/fe9450d33ccb834260756a66662249c38e93601b/800.renames-and-merges/r.yaml#L76
It would be possible to make this part of our indexing process. It would also require adding cron jobs to keep the rules up to date.
From what I can see, this is done manually: https://github.com/repology/repology-rules/blob/fe9450d33ccb834260756a66662249c38e93601b/800.renames-and-merges/r.yaml#L76
That line is most certainly a leftover glitch from an initial indexing attempt on repology. There is no perl:rex package on repology anymore: https://repology.org/project/perl:rex/versions
The correct link is https://repology.org/project/rex/versions (note the missing perl:).
Also compare that with other things from CPAN, like Test::Warnings:
https://metacpan.org/release/Test-Warnings => https://repology.org/project/perl:test-warnings/versions (includes perl: prefix).
That file is used when updating packages on repology. It renames the package from perl:rex to rex.
That file is used when updating packages on repology. It renames the package from
perl:rextorex.
Hmm, I read it backwards, then. Thanks for the correction!
Repology's intent seems to be:
(e.g. packages from
CPANare always perl modules)
(via)
so I'm getting the feeling that needs to be corrected somehow on repology's side to make sure that CPAN packages always have to have the perl: prefix.
In that case we may choose to generate the links like that on MetaCPAN, and I expect most of things on CPAN will be resolved already, and the rest may be corrected in repology to have the correct prefix.
To give way to be explicit about the mapping for MetaCPAN display purposes, the x_repology meta key may still be useful, though :thinking:
To me, that sounds like something that may be added on top once we have something working first for the standard perl: prefixed cases already. Or would you prefer doing it "all-or-nothing" for the purposes of this repository?
I've created a preliminary branch to add this metadata. https://github.com/metacpan/metacpan-api/compare/haarg/dist-repology It is entirely untested and definitely incomplete, but should be a foundation to build this properly.