Skip to content

Retry gh workflow dispatches in nightly-sync job on transient API errors - #9759

Closed
timosachsenberg wants to merge 1 commit into
developfrom
claude/laughing-wozniak-foh970
Closed

timosachsenberg wants to merge 1 commit into
developfrom
claude/laughing-wozniak-foh970

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Investigated the "nightly build CI" and found the actual nightly build matrix (openms-ci-full on the nightly branch) has been green every night — all build/test/package/deploy jobs (Linux, macOS, Windows, ARM, docs, KNIME, installer) passed on 2026-07-18.

The failure was in the orchestrator, Update nightly from develop (.github/workflows/update_nightly.yml), which fast-forwards nightly to develop and then dispatches the downstream workflows (CI, wheels, Bioconda, container images). On 2026-07-18 its last step failed:

could not create workflow dispatch event: HTTP 500: Failed to run workflow dispatch
  (.../actions/workflows/44484323/dispatches)
##[error]Process completed with exit code 1.

This is a transient GitHub API error on the gh workflow run containerdeploy.yml --ref nightly call, not a code/test defect — everything before it (the nightly branch fast-forward, and dispatching openms-ci-full, pyopenms-wheels-cibuildwheel, and Deploy to Bioconda) had already succeeded that run. But because GitHub Actions steps stop the job on the first failing step, a single flaky dispatch call aborts the whole job and (had it happened earlier in the sequence) would have silently skipped the remaining dispatches too.

Fix

Added .github/scripts/gh_dispatch_retry.sh, a small retry-with-backoff wrapper around gh workflow run <workflow> --ref <ref> (5 attempts, linear backoff), and updated each of the five dispatch steps in update_nightly.yml to use it. A dispatch call now only fails the job after 5 unsuccessful attempts, which tolerates one-off API hiccups like the one observed while still surfacing a genuine, persistent failure (no error suppression — the job still fails loudly if the API stays down).

Test plan

  • python3 -c "import yaml; yaml.safe_load(open('.github/workflows/update_nightly.yml'))" — YAML parses
  • bash -n .github/scripts/gh_dispatch_retry.sh — script syntax check
  • Next scheduled/triggered run of "Update nightly from develop" exercises the new retry path in production

Co-Authored-By: Claude Sonnet 5 [email protected]


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of nightly update automation by automatically retrying workflow dispatches after transient failures.
    • Added clearer failure reporting when all retry attempts are unsuccessful.
    • Preserved existing conditions and targets for nightly CI, cache, wheel, package, and container update jobs.

The nightly build orchestrator (update_nightly.yml) failed on 2026-07-18
because `gh workflow run containerdeploy.yml` hit a transient GitHub API
HTTP 500, aborting the job outright even though the actual nightly build
matrix (openms-ci-full on the nightly branch) built and tested cleanly.
Wrap each downstream `gh workflow run` dispatch in a shared retry-with-
backoff script so a one-off API hiccup no longer fails the whole pipeline.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Bg6MhKkxUPexR4NwYcVJUX
@github-actions

Copy link
Copy Markdown
Contributor

@timosachsenberg The following names might be missing from the AUTHORS file:

  • Claude

Please consider applying the following patch:

--- AUTHORS	2026-07-19 03:40:10.761091608 +0000
+++ AUTHORS.new	2026-07-19 03:40:15.695046095 +0000
@@ -27,6 +27,7 @@
  - Chris Bielow
  - Christian Ehrlich
  - Christie Mathews
+ - Claude
  - Clemens Groepl
  - Cornelia Friedle
  - Daniel Jameson

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Nightly dispatch reliability

Layer / File(s) Summary
Retrying workflow dispatch wrapper
.github/scripts/gh_dispatch_retry.sh
Adds up to five dispatch attempts with increasing delays and emits a GitHub Actions error on final failure.
Nightly workflow dispatch integration
.github/workflows/update_nightly.yml
Routes five downstream nightly dispatches through the wrapper while preserving existing conditions, refs, and token configuration.

Possibly related PRs

  • OpenMS/OpenMS#9756: Refactors the same nightly workflow dispatches through a retry wrapper.

Poem

A bunny retries when workflows delay,
Five hops through the clouds till they’re on their way.
With tokens held tight and an error cry,
Nightly jobs leap smoothly sky-high.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: adding retry logic for GitHub workflow dispatches to handle transient API errors.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/laughing-wozniak-foh970

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (1)
.github/scripts/gh_dispatch_retry.sh (1)

6-7: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add argument validation to prevent cryptic errors.

Because set -u is enabled, if the script is ever executed with fewer than two arguments, it will fail with an unhelpful unbound variable error before it can do anything. Validating the argument count makes the script more robust and self-documenting.

♻️ Proposed fix
+if [ "$#" -ne 2 ]; then
+  echo "Usage: $0 <workflow> <ref>" >&2
+  exit 1
+fi
+
 workflow="$1"
 ref="$2"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/scripts/gh_dispatch_retry.sh around lines 6 - 7, Add argument-count
validation before the workflow and ref assignments in gh_dispatch_retry.sh,
requiring at least two arguments and exiting with a clear usage message when
they are missing. Preserve the existing assignments for valid invocations.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/scripts/gh_dispatch_retry.sh:
- Around line 6-7: Add argument-count validation before the workflow and ref
assignments in gh_dispatch_retry.sh, requiring at least two arguments and
exiting with a clear usage message when they are missing. Preserve the existing
assignments for valid invocations.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 92508cb7-ff85-4854-977f-5bea79491e0c

📥 Commits

Reviewing files that changed from the base of the PR and between 3c2d585 and 9920f7e.

📒 Files selected for processing (2)
  • .github/scripts/gh_dispatch_retry.sh
  • .github/workflows/update_nightly.yml

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