Repository navigation
INTPYTHON-1025 Add retrigger-ci action - #140
Merged
Jibola merged 17 commits intoOct 8, 2026
Merged
Conversation
Re-run a downstream repository's CI after this repository changed something it depends on, such as a force-pushed fork branch it checks out by ref. Takes the downstream repo and a ci_rerun JSON spec with three kinds: evergreen (retry comment on a pull request), pr (re-queue the runs on a pull request head commit), and ref (dispatch the workflows on a branch or tag). The action mints the downstream-scoped App token itself, so callers pass only app_id and private_key.
1 of 10 tasks
Reimplements `dbx sync --all-branches`'s downstream CI re-run, and takes
that command's ci_rerun config shape unchanged so a mapping copies
across verbatim instead of being translated.
The value's type selects the behaviour: a string dispatches the test
workflows on a ref, an integer re-runs every workflow run on a PR's head
commit, and {pr, evergreen} does the PR re-run and also comments
'evergreen retry'. Lists and several downstream repos are supported.
Re-triggering is best-effort, as in dbx: a stale PR number or an API
error warns and is skipped, so one bad entry cannot mask the branches
that re-triggered correctly.
Python rather than bash: the type dispatch, list handling, and
workflow_dispatch inspection were the parts hardest to review as shell.
- gh_error raised IndexError on whitespace-only stderr, which escapes
Skip and aborts the run the best-effort handling exists to protect.
- A value that was neither a ref nor a {"pr": N} object parsed to
nothing and exited clean, reporting success on an untested
downstream. A digit-only string read as a git ref.
- The de-duplication the comment claimed did not exist, so a repeated
entry dispatched twice and posted two identical comments.
- workflow_pattern went into the jq regex unescaped, so a '.' matched
any character and could widen the scope past the test workflows.
- retry_evergreen treated a failed state lookup as open and commented
on closed pull requests.
connorsmacd
reviewed
Sep 30, 2026
GromNaN
reviewed
Oct 2, 2026
aclark4life
force-pushed
the
INTPYTHON-1025-retrigger-ci
branch
2 times, most recently
from
October 7, 2026 22:08
a0d4e07 to
2e0d7f0
Compare
Quote the workflow-filter regex for the jq string layer. The "\-" in
re.escape("test-python") is not a valid jq escape, so a ref dispatched nothing.
Grant the token contents:read, which reads each workflow definition at the ref,
and skip on 403 rather than dispatching blind into a 422.
Paginate a PR's workflow runs, warn when only some re-queue, and fail when
every entry was skipped.
Drop the retry-window string match: GitHub does not document the wording.
Run the built jq program under real jq in the tests.
aclark4life
force-pushed
the
INTPYTHON-1025-retrigger-ci
branch
from
October 7, 2026 22:11
2e0d7f0 to
209b95a
Compare
Collaborator
Author
|
@GromNaN @connorsmacd Thanks! Latest review comments addressed in 209b95a |
GromNaN
approved these changes
Oct 7, 2026
GromNaN
left a comment
Collaborator
There was a problem hiding this comment.
Approved. The two blocking items from my review are fixed and verified: the jq program now compiles under real jq (the suite runs it, 20 passing) and the token grants contents: read.
Non-blocking follow-ups if you touch this again:
os.environ["CI_RERUN"]raisesKeyErrorwhen unset;.getwould be safer.- A few test cases were dropped (empty
ci_rerun, duplicates, Evergreen on a closed PR), so that coverage is gone. - The tests stub
gh, so live behavior (App permissions, actual dispatch) stays unvalidated until the end-to-end run on mongodb-forks/django#21.
connorsmacd
approved these changes
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
INTPYTHON-1025
Changes in this PR
Adds the
retrigger-ciaction. A downstream repository's CI pins a fork branchat a ref, so a force-push changes what it builds against without re-triggering
anything.
ci_rerunmaps each downstreamowner/nameto a target, and the value's typeselects the behaviour: a ref dispatches the test workflows, a PR number re-runs
that PR's runs, and the object form also retries Evergreen. See the README. The
shape matches the mapping the existing sync tooling uses, so one copies across
verbatim.
Re-triggering is best-effort. A stale PR number, a closed pull request, or an
API error warns and is skipped, so one bad entry cannot mask the branches that
re-triggered correctly.
Test Plan
test-retrigger-cijob.subprocess.runisstubbed, so no token or network access is needed.
Checklist
Checklist for Author
Checklist for Reviewer