10000 fix: Increase wait for janus workflow to begin by kelvin-chappell · Pull Request #574 · guardian/janus-app · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: Increase wait for janus workflow to begin #574

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kelvin-chappell
Copy link
Member

What is the purpose of this change?

Make it more likely that the janus workflow will have begun before looking for its ID.

What is the value of this change and how do we measure success?

We've seen various failures in recent months because of delays.
This should reduce the number of failures before we find a better solution.

@kelvin-chappell kelvin-chappell requested review from a team and Copilot May 14, 2025 12:57
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR aims to increase the wait time before checking for the janus workflow run ID in order to reduce failures due to timing issues.

  • Increased the sleep duration from 5 to 10 seconds in the workflow file.
  • Added explicit error handling when no workflow run is found.
Comments suppressed due to low confidence (1)

.github/workflows/trigger-private-janus-build.yml:112

  • [nitpick] Consider enhancing the error message to include additional context (e.g., current wait duration or timestamp) for more effective debugging.
if (!result.data.workflow_runs || result.data.workflow_runs.length === 0) {

@@ -92,7 +92,7 @@ jobs:
ref: 'main'
})

- run: sleep 5 # wait for event to register within github system
- run: sleep 10 # wait for event to register within github system
Copy link
Preview
Copilot AI May 14, 2025

Choose a reason for hiding this comment

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

[nitpick] Relying on a fixed sleep time can be brittle in variable environments; consider implementing a retry mechanism for improved robustness.

Copilot uses AI. Check for mistakes.

Copy link
Contributor

Choose a reason for hiding this comment

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

A retry mechanism sounds like a good idea - is this tricky to implement?

Copy link
Member Author

Choose a reason for hiding this comment

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

There doesn't appear to be any built-in functionality to retry a step apart from using custom actions.
So I've just wrapped the call in a repeated block.

@kelvin-chappell kelvin-chappell marked this pull request as draft May 16, 2025 14:40
@kelvin-chappell kelvin-chappell requested a review from Copilot May 16, 2025 14:52
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR aims to reduce failures by increasing the waiting period before querying for the Janus workflow ID.

  • Replaces a static sleep with an asynchronous retry mechanism using exponential backoff.
  • Introduces a new JavaScript function to repeatedly fetch the workflow ID with configurable delays.

@kelvin-chappell kelvin-chappell marked this pull request as ready for review May 16, 2025 15:03
Copy link
Contributor
@tjsilver tjsilver left a comment

Choose a reason for hiding this comment

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

👍

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

Successfully merging this pull request may close these issues.

2 participants
0