Skip to content

Add GitHub API pages support to get script#4642

Merged
openshift-merge-robot merged 1 commit intocri-o:masterfrom
saschagrunert:get-pages
Mar 10, 2021
Merged

Add GitHub API pages support to get script#4642
openshift-merge-robot merged 1 commit intocri-o:masterfrom
saschagrunert:get-pages

Conversation

@saschagrunert
Copy link
Copy Markdown
Member

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?

None

@openshift-ci-robot openshift-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Mar 10, 2021
@openshift-ci-robot
Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 10, 2021
@saschagrunert saschagrunert force-pushed the get-pages branch 2 times, most recently from fe5b3f8 to a0dc6b8 Compare March 10, 2021 09:42
Comment thread scripts/get Outdated
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is cool, this way we don't have to hard code num pages to iterate on.

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]>
@openshift-ci-robot
Copy link
Copy Markdown

@saschagrunert: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/kata-jenkins 704b77b link /test kata-containers
Details

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. I understand the commands that are listed here.

@haircommander
Copy link
Copy Markdown
Member

/override ci/kata-jenkins
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 10, 2021
@openshift-ci-robot
Copy link
Copy Markdown

@haircommander: Overrode contexts on behalf of haircommander: ci/kata-jenkins

Details

In response to this:

/override ci/kata-jenkins
/lgtm

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.

@openshift-bot
Copy link
Copy Markdown

/retest

Please review the full test history for this PR and help us cut down flakes.

4 similar comments
@openshift-bot
Copy link
Copy Markdown

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Copy Markdown

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Copy Markdown

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Copy Markdown

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 10, 2021

@saschagrunert: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/openshift-jenkins/integration_crun_cgroupv2 704b77b link /test integration_cgroupv2

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit d6cc960 into cri-o:master Mar 10, 2021
@saschagrunert saschagrunert deleted the get-pages branch March 10, 2021 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants