Skip to content

fix(sync): skip stale workflows missing at ref instead of failing dispatch#44

Merged
aclark4life merged 1 commit into
mainfrom
fix/dispatch-skip-stale-workflows
Jul 14, 2026
Merged

fix(sync): skip stale workflows missing at ref instead of failing dispatch#44
aclark4life merged 1 commit into
mainfrom
fix/dispatch-skip-stale-workflows

Conversation

@aclark4life

Copy link
Copy Markdown
Collaborator

Problem

dbx sync --all-branches on a ref-based ci_rerun target (e.g. mongodb-6.0.x → main) surfaced noisy ⚠️ dispatch failed: HTTP 422 Workflow does not have 'workflow_dispatch' trigger errors for workflows like test-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 except that falls back to has_dispatch = True, then attempted the dispatch anyway → guaranteed 422.

Fix

Catch CalledProcessError separately 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 in docs/features/django-fork.rst.

…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.
@aclark4life
aclark4life merged commit 60e9444 into main Jul 14, 2026
8 of 12 checks passed
@aclark4life
aclark4life deleted the fix/dispatch-skip-stale-workflows branch July 14, 2026 16:32
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.

1 participant