Add GitHub API pages support to get script#4642
Add GitHub API pages support to get script#4642openshift-merge-robot merged 1 commit intocri-o:masterfrom
get script#4642Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
fe5b3f8 to
a0dc6b8
Compare
| jq -r '.workflow_runs | map(select(.name == "test" and .head_branch == "master" and .conclusion == "success")) | first | .head_sha') | ||
|
|
||
| echo "Using latest successful GitHub action master: $VERSION" | ||
| for ((i = 1; i < 10; i++)); do |
There was a problem hiding this comment.
I have never used GH API, but I was just wondering if they allow us to fetch pages by specifying size? Then how about fetching just one page with large enough page size. That way we avoid the pagination implementation at our side.
Sorry if this sounds silly, I am just thinking out loud.
There was a problem hiding this comment.
That's a great idea! We cannot query the amount of pages via the API, but we can check if the workflow_runs array is empty or not. We now stop the search in that case, but generally this should never happen.
There was a problem hiding this comment.
Yeah this is cool, this way we don't have to hard code num pages to iterate on.
a0dc6b8 to
c865261
Compare
It may be possible that we do not find a result on the first page. This means we do now add paging support to the search for a successful GitHub actions run. Signed-off-by: Sascha Grunert <[email protected]>
c865261 to
704b77b
Compare
|
@saschagrunert: The following test failed, say
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/override ci/kata-jenkins |
|
@haircommander: Overrode contexts on behalf of haircommander: ci/kata-jenkins DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
4 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
@saschagrunert: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
It may be possible that we do not find a result on the first page. This
means we do now add paging support to the search for a successful GitHub
actions run.
Which issue(s) this PR fixes:
None
Special notes for your reviewer:
None
Does this PR introduce a user-facing change?