YahnisElsts / plugin-update-checker

A custom update checker for WordPress plugins. Useful if you don't want to host your project in the official WP repository, but would still like it to support automatic updates. Despite the name, it also works with themes.
MIT License
2.25k stars 410 forks source link

Adding releases to GitLab API #460

Closed timwiel closed 3 years ago

timwiel commented 3 years ago

PR to add release capability to GitLab API with two options for assets:

Fixes issue #449

For information about release generic packages

YahnisElsts commented 3 years ago

Thank you for the PR! I have a few questions and suggestions:

timwiel commented 3 years ago

No worries - I'm happy with all those suggestions

I'll work on pushing some more changes to the PR to reflect your suggestions

timwiel commented 3 years ago

I've completed all those suggestions ...

I erred on setting a order of priority for the update checks in the chooseReference() based on the following order:

  1. releases with generic packages
  2. releases with source code assets
  3. branch name other than master
  4. master with tagnames (which is the default if no option is added by user to functions.php other than the connection setup

I've updated the README.md to outline this as well

I hope that's all ok

YahnisElsts commented 3 years ago

I don't think that order is going to work because it would be the opposite of how the update checker works with GitHub and BitBucket. For those hosting services, PUC only looks for releases or recent tags if the developer hasn't specified a custom branch. Let's move that option to the top:

  1. branch name other than master (or main, which seems to be the new default)
  2. releases with generic packages
  3. releases with source code assets
  4. master with tagnames

Also, it seems that the upcoming_release field is not mentioned anywhere in the Releases API documentation. Is that an undocumented API feature?

timwiel commented 3 years ago

PR updated as suggested :-)

the upcoming_release flag does seem to be undocumented but I've found reference to it here:

I've also created a PR for the Gitlab API documentation to be updated

YahnisElsts commented 3 years ago

All right, that seems fine. I'll merge it now.