Fix changelog generator so that all PR commits are checked #5474
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When working through a recent mu-plugins release, a changelog was not generated for production. After some digging, I realized the script was only fetching 30 of the many PRs associated, and so some PRs/commits were not being checked for chaneglogs. (So if the first 30 commits had no changelog entry, no post would be generated.)
Thankfully, this endpoint can be paginated with
page
andper_page
, so we simply request with page++ until the page is empty. At that point, we have all the commits for the request.Steps to Test
First, create a
test.php
file, and copy both thecurl_get_all
andcurl_get
functions from this branch into that file. Then, add this test code:You can compare the two commits to see that they are the same, and verify that more commits are requested using the new approach.