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

feature: wait for queued runs and an option to refresh runs from GitHub API #31

Merged
merged 10 commits into from
Jun 19, 2024

Conversation

vigneshmsft
Copy link
Contributor

@vigneshmsft vigneshmsft commented Dec 14, 2020

Hi 👋🏽
This PR adds support to consider queued runs in addition to in_progress when checking against a list of current runs.

Problem

When a run is first created in GitHub Actions, the status will be queued before moving to in_progress
When two runs are triggered within quick succession,
there is a chance that both the runs are queued with only millisecond difference and when this action
from within the second run tries to fetch a list of in_progress runs (where id < itself), the list can be empty because the previous run hasn't still progressed to in_progress in the API results.
We have seen this behaviour multiple times in our workflows.

Change Proposed

  1. Fetch both queued and in_progress runs
    This would allow the second run to see that a previous run has been queued and it should wait for it to complete.
  2. Add initial-wait-seconds input parameter
    This adds an option to fetch (again) the list of runs from the GitHub API, if no results are returned during the first poll.

Thanks

rebased: 13-Apr-2021

@AmirAvram
Copy link

Any timeline on a merge?
Stumbled upon it to with failure on production deployments (so very critical for us).

A positive value can be specified as value to this parameter
to instruct this action to wait and poll the GitHub API
if no in_progress runs are returned in the first attempt.
Refetch runs from GitHub API, If no runs are found
in the first attempt and initialWaitSeconds is specified
currently queued runs are not being picked up, which is causing issues
when multiple runs are queued concurrently.
1. initial-wait-seconds input parameter
2. fetch both queued and in_progress runs
@vigneshmsft
Copy link
Contributor Author

vigneshmsft commented Apr 13, 2021

npm run fmtcheck and prettier --write 'src/**/*.ts' '__tests__/**/*.ts' have different behaviours

@GideonShils
Copy link

Any updates on getting this one merged?

Copy link
Collaborator

@chenrui333 chenrui333 left a comment

Choose a reason for hiding this comment

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

looks like a good feature, need resolve the merge conflict

@chenrui333 chenrui333 changed the title Wait for queued runs and an option to refresh runs from GitHub API feature: wait for queued runs and an option to refresh runs from GitHub API Jun 19, 2024
Signed-off-by: Rui Chen <[email protected]>
@chenrui333 chenrui333 merged commit f1563c5 into softprops:master Jun 19, 2024
2 checks passed
@vigneshmsft vigneshmsft deleted the initial-wait-seconds branch June 20, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants