Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues to get all the retryAttemps of an workflow #2004

Open
ananta-code opened this issue Jan 2, 2025 · 2 comments
Open

Issues to get all the retryAttemps of an workflow #2004

ananta-code opened this issue Jan 2, 2025 · 2 comments

Comments

@ananta-code
Copy link

ananta-code commented Jan 2, 2025

Describe the bug
I have a runner and which was retried 5 times and each runner has almost 25 jobs so when i use
repository.getWorkflowRun(runnerId/workflow_id), it is returning the ghWorkFlowRunner but newWorkFlowRun.listJobs().toList() doesn't have all the retried job info

To Reproduce
Steps to reproduce the behavior:

  1. Create a PR
  2. Cancel the first runner
  3. Retry the runner again and again
  4. newWorkFlowRun.listJobs().toList() should contain all the jobs irrespective of the retry attemps

Expected behavior
newWorkFlowRun.listJobs().toList() is only returning most recent retried jobs

Desktop (please complete the following information):

  • OS: iOS
  • Version 1.326

Additional context
Is there any way to get the runner specific to a runner id and retryAttempt.
I have monorepo so repository.queryWorkflowRuns().list() and then filter by runnerId and retry attempt is not feasible for me since we have more than 3000 runners getting executed everyday.

@bitwiseman
Copy link
Member

bitwiseman commented Jan 2, 2025

As noted in #2005

Is there a REST API endpoint that does what you're asking?

Here's the documentation for the endpoint used by queryWorkflowRuns(): https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository

If you call that without any filtering it will take a very long time indeed. Perhaps if you filter by created to exclude runs that happened outside a reasonable window?

Alternative. You can also start by filtering per workflow and they filter further: https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow

@ananta-code
Copy link
Author

As noted in #2005

Is there a REST API endpoint that does what you're asking?

Here's the documentation for the endpoint used by queryWorkflowRuns(): https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository

If you call that without any filtering it will take a very long time indeed. Perhaps if you filter by created to exclude runs that happened outside a reasonable window?

Alternative. You can also start by filtering per workflow and they filter further: https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow

How to find individual org.kohsuke.github libraries for each of the rest endpoints.
Is there any documentation for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants