lilydjwg / nvchecker

New version checker for software releases
MIT License
438 stars 70 forks source link

Bitbucket: Add support for queries and sorting #206

Closed alexfikl closed 2 years ago

alexfikl commented 2 years ago

Make better use of the bitbucket API to sort tags:

lilydjwg commented 2 years ago

I didn't know bitbucket has query and sort support on this. I'd like to utilize this instead of paging, like the github source does.

alexfikl commented 2 years ago

I didn't know bitbucket has query and sort support on this. I'd like to utilize this instead of paging, like the github source does.

Not super familiar with the bitbucket API, but it seems like the results are always paginated, even when sorted or filtered.

I can definitely use the sorted results to get a latest tag like the github plugin. Is that what you meant? EDIT: Gave it a go in e6012b8. Let me know what you think!

lilydjwg commented 2 years ago

I want to expose the q and sort parameters from the API to the configuration, and we only return results on the first page. Hopefully the desired tag can be queried and sorted to be on the first page, and any outliners can be filtered using the "list options" mechanism.

We may add three new options: use_sorted_tags (not latest since we can sort differently) means to use this new behavior and optional query and sort can be provided, and we pass those directly to bitbucket's API.

(However the old behavior needs to be kept for backward compatibility.)

alexfikl commented 2 years ago

I want to expose the q and sort parameters from the API to the configuration, and we only return results on the first page. Hopefully the desired tag can be queried and sorted to be on the first page, and any outliners can be filtered using the "list options" mechanism.

We may add three new options: use_sorted_tags (not latest since we can sort differently) means to use this new behavior and optional query and sort can be provided, and we pass those directly to bitbucket's API.

(However the old behavior needs to be kept for backward compatibility.)

Tried do implement something like that in a8228bb. It seems to work for the simple tests I played with. What do you think?

alexfikl commented 2 years ago

There are a few other things we can add to the query:

lilydjwg commented 2 years ago
alexfikl commented 2 years ago
  • Yes, the smaller the response is, the faster it works.

Added support for this in the latest commit and fixed the mypy issues (at least locally, fingers crossed!).