fix(sync): skip stale workflows missing at ref instead of failing dispatch#44
Merged
Merged
Conversation
…patch
Workflows returned from the Actions registry whose file has been renamed
or deleted no longer exist at the target ref. The dispatch pre-check
404'd on the contents fetch, fell back to attempting the dispatch, and
surfaced a 422 'Workflow does not have workflow_dispatch trigger' error.
Treat a 404/Not Found on the contents fetch as not-dispatchable and skip
it quietly ('skipped (not present on <ref>)'); other errors still fall
back to attempting the dispatch.
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.
Problem
dbx sync --all-brancheson a ref-basedci_reruntarget (e.g.mongodb-6.0.x → main) surfaced noisy⚠️ dispatch failed: HTTP 422 Workflow does not have 'workflow_dispatch' triggererrors for workflows liketest-python1.yml,test-python-atlas-geo.yml, etc.These are stale entries in the Actions registry — workflows whose file has since been renamed or deleted and no longer exists at the ref. The dispatch pre-check 404'd fetching the file contents, hit the generic
exceptthat falls back tohas_dispatch = True, then attempted the dispatch anyway → guaranteed 422.Fix
Catch
CalledProcessErrorseparately in the pre-check: a 404 / Not Found means the file isn't present at the ref, so skip it quietly with— skipped (not present on <ref>)instead of attempting. Other/transient errors still fall back to attempting the dispatch.Tests
Added
test_repo_sync_dispatch_skips_stale_workflow_missing_at_ref; all dispatch tests pass. Docs updated indocs/features/django-fork.rst.