Open opoplawski opened 8 years ago
You could use the custom backend and your own regex
Maybe it would be better to add (off by default) switch to provide a regexp instead of just prefix? Some projects (RabbitMQ among them) are using very unusual tag schemes. In case of RabbitMQ they have tags like "rabbitmq_v3_6_1_rc2" which can be matched by a regex like that:
perl -pe 's/rabbitmqv(\d+)(\d+)_(\d+).*$/$1.$2.$3/'
Also do we use an API for GitHub? They provide a very nice JSON API. For example:
We don't use the API for github as it is rate limited and we don't know how many projects we have on github or will have.
perl -pe 's/rabbitmq_v(\d+)(\d+)(\d+).*$/$1.$2.$3/'
Isn't it just simpler to use the custom
backend then?
+1, I could use a custom suffix as well instead of having to create a custom backend.
@pypingou for authenticated requests the API is rate limited to 5000 requests per hour. Note that only requests that actually yield new data are counted, assuming the correct headers are used. This means running into those limits would require anitya to find 5k new releases within just one hour. If the app hits the HTML equivalents that often, I'm sure github would step in and rate limit the source IP anyway. Using the official API instead of parsing HTML returns via regex seems to be a better way of solving this, in my opinion.
It will be best to use https://packit.dev/docs/configuration/#upstream_tag_template instead and allow users to specify their own template for retrieved version.
https://github.com/Unidata/netcdf4-python uses "vX.X.Xrel" tags for releases, but GitHub backend only allows for version prefix.