Closed timwiel closed 3 years ago
Thank you for the PR! I have a few questions and suggestions:
released_at
date actually arrives.enableReleasePackage()
or enableReleaseAssets()
? If I'm reading the code correctly, it appears that getLatestRelease()
will find the release and return a reference without a download URL. This would look like a confusing behaviour to someone not familiar with the code. I think we should do one of the following instead:
$releaseAssetsEnabled = true
by default so that getLatestRelease()
can return something useful without additional configuration. This is my preferred option.chooseReference()
or getLatestRelease()
so that it doesn't even try to retrieve releases if both $releaseAssetsEnabled
and $releasePackageEnabled
are set to false
.sources
list will be the generated ZIP file, we don't really need to take that risk. I think it would be more future-proof to just walk the sources
array in a foreach loop and pick the first item where format
equals zip
.No worries - I'm happy with all those suggestions
I'll work on pushing some more changes to the PR to reflect your suggestions
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:
functions.php
other than the connection setupI've updated the README.md to outline this as well
I hope that's all ok
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:
main
, which seems to be the new default)Also, it seems that the upcoming_release
field is not mentioned anywhere in the Releases API documentation. Is that an undocumented API feature?
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
All right, that seems fine. I'll merge it now.
PR to add release capability to GitLab API with two options for assets:
Fixes issue #449
For information about release generic packages