Skip to content

fix: prevent test suite timeout caused by real network calls in force-overwrite test#20428

Merged
pelikhan merged 3 commits intomainfrom
copilot/fix-github-actions-workflow-test-yet-again
Mar 10, 2026
Merged

fix: prevent test suite timeout caused by real network calls in force-overwrite test#20428
pelikhan merged 3 commits intomainfrom
copilot/fix-github-actions-workflow-test-yet-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 10, 2026

TestFetchDispatchWorkflows_ForceOverwritesConflict was blocking the entire pkg/cli test suite for ~3 minutes in CI. With force=true, the conflict check is bypassed and the code proceeds to parser.DownloadFileFromGitHub, which chains: raw URL fetch (30s timeout) → git archivegit clone — all against the real github/gh-aw repo — exhausting the 3m0s test timeout and leaving all parallel tests deadlocked waiting for goroutine 1.

Changes

  • pkg/cli/dispatch.go: Added a fileDownloadFn type and variadic downloaders ...fileDownloadFn parameter to fetchAndSaveRemoteDispatchWorkflows. All existing callers are unaffected; the default remains parser.DownloadFileFromGitHub.

  • pkg/cli/remote_workflow_test.go: Updated the failing test to inject a fast-failing mock downloader, which immediately returns an error and exercises the existing best-effort continue path — the behavior the test was designed to verify — without touching the network.

mockDownloader := func(_, _, _, _ string) ([]byte, error) {
    return nil, errors.New("download not available in unit tests")
}
err := fetchAndSaveRemoteDispatchWorkflows(content, spec, dir, false, true, nil, mockDownloader)
assert.NoError(t, err, "force=true should bypass conflict detection and return nil (download fails silently)")
Original prompt

Fix the failing GitHub Actions workflow test
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 66540326683
Job URL: https://github.com/github/gh-aw/actions/runs/22927178974/job/66540326683


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits March 10, 2026 23:24
…lows_ForceOverwritesConflict

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…blocking on real network calls

Add variadic fileDownloadFn parameter to fetchAndSaveRemoteDispatchWorkflows for
testability, allowing tests to inject a fast-failing mock instead of making real
network calls that block for ~3 minutes in CI.

The test TestFetchDispatchWorkflows_ForceOverwritesConflict uses force=true, which
bypasses the conflict check and proceeds to DownloadFileFromGitHub. In CI this
blocks ~3 minutes (raw URL 30s timeout + git archive + git clone), causing the
entire test suite to time out at 3m0s.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions workflow test fix: prevent test suite timeout caused by real network calls in force-overwrite test Mar 10, 2026
@pelikhan pelikhan marked this pull request as ready for review March 10, 2026 23:39
Copilot AI review requested due to automatic review settings March 10, 2026 23:39
@pelikhan pelikhan merged commit 63a74d0 into main Mar 10, 2026
@pelikhan pelikhan deleted the copilot/fix-github-actions-workflow-test-yet-again branch March 10, 2026 23:39
Copy link
Contributor

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

Prevents pkg/cli unit test suite timeouts by ensuring the force=true dispatch-workflow conflict test no longer triggers real network/Git operations, using an injectable downloader.

Changes:

  • Added an optional downloader injection point to fetchAndSaveRemoteDispatchWorkflows (defaulting to parser.DownloadFileFromGitHub).
  • Updated TestFetchDispatchWorkflows_ForceOverwritesConflict to inject a fast-failing mock downloader to avoid network calls.
  • Bumped GH_AW_VERSION across many workflow lockfiles.

Reviewed changes

Copilot reviewed 168 out of 168 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/cli/dispatch.go Adds optional downloader injection for dispatch-workflow fetching to enable network-free unit tests.
pkg/cli/remote_workflow_test.go Injects a mock downloader in the force-overwrite test to avoid real network calls/timeouts.
.github/workflows/ace-editor.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/agent-performance-analyzer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/agent-persona-explorer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/ai-moderator.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/archie.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/artifacts-summary.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/audit-workflows.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/auto-triage-issues.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/blog-auditor.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/bot-detection.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/brave.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/breaking-change-checker.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/changeset.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/chroma-issue-indexer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/ci-coach.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/ci-doctor.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/claude-code-user-docs-review.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/cli-consistency-checker.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/cli-version-checker.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/cloclo.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/code-scanning-fixer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/code-simplifier.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/codex-github-remote-mcp-test.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/commit-changes-analyzer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/constraint-solving-potd.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/contribution-check.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/copilot-agent-analysis.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/copilot-cli-deep-research.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/copilot-pr-merged-report.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/copilot-pr-nlp-analysis.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/copilot-pr-prompt-analysis.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/copilot-session-insights.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/craft.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-architecture-diagram.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-assign-issue-to-user.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-choice-test.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-cli-performance.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-cli-tools-tester.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-code-metrics.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-compiler-quality.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-copilot-token-report.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-doc-healer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-doc-updater.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-fact.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-file-diet.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-firewall-report.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-issues-report.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-malicious-code-scan.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-mcp-concurrency-analysis.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-multi-device-docs-tester.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-news.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-observability-report.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-performance-summary.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-regulatory.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-rendering-scripts-verifier.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-repo-chronicle.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-safe-output-optimizer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-safe-outputs-conformance.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-secrets-analysis.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-security-red-team.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-semgrep-scan.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-syntax-error-quality.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-team-evolution-insights.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-team-status.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-testify-uber-super-expert.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/daily-workflow-updater.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/dead-code-remover.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/deep-report.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/delight.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/dependabot-burner.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/dependabot-go-checker.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/dev-hawk.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/dev.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/developer-docs-consolidator.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/dictation-prompt.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/discussion-task-miner.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/docs-noob-tester.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/draft-pr-cleanup.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/duplicate-code-detector.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/example-permissions-warning.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/example-workflow-analyzer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/firewall-escape.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/firewall.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/functional-pragmatist.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/github-mcp-structural-analysis.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/github-mcp-tools-report.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/github-remote-mcp-auth-test.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/glossary-maintainer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/go-fan.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/go-logger.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/go-pattern-detector.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/gpclean.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/grumpy-reviewer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/hourly-ci-cleaner.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/instructions-janitor.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/issue-arborist.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/issue-monster.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/issue-triage-agent.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/jsweep.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/layout-spec-maintainer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/lockfile-stats.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/mcp-inspector.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/mergefest.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/metrics-collector.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/notion-issue-summary.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/org-health-report.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/pdf-summary.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/plan.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/poem-bot.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/portfolio-analyst.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/pr-nitpick-reviewer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/pr-triage-agent.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/prompt-clustering-analysis.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/python-data-charts.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/q.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/refiner.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/release.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/repo-audit-analyzer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/repo-tree-map.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/repository-quality-improver.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/research.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/safe-output-health.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/schema-consistency-checker.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/scout.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/security-alert-burndown.campaign.g.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/security-compliance.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/security-review.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/semantic-function-refactor.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/sergo.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/slide-deck-maintainer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/smoke-agent.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/smoke-claude.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/smoke-codex.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/smoke-copilot-arm.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/smoke-copilot.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/smoke-create-cross-repo-pr.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/smoke-gemini.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/smoke-multi-pr.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/smoke-project.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/smoke-temporary-id.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/smoke-test-tools.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/smoke-update-cross-repo-pr.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/smoke-workflow-call.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/stale-repo-identifier.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/static-analysis-report.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/step-name-alignment.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/sub-issue-closer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/super-linter.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/technical-doc-writer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/terminal-stylist.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/test-create-pr-error-handling.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/test-dispatcher.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/test-project-url-default.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/test-workflow.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/tidy.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/typist.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/ubuntu-image-analyzer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/unbloat-docs.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/video-analyzer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/weekly-editors-health-check.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/weekly-issue-summary.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/weekly-safe-outputs-spec-review.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/workflow-generator.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/workflow-health-manager.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/workflow-normalizer.lock.yml Bumps pinned GH_AW_VERSION.
.github/workflows/workflow-skill-extractor.lock.yml Bumps pinned GH_AW_VERSION.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +77 to +81
func fetchAndSaveRemoteDispatchWorkflows(content string, spec *WorkflowSpec, targetDir string, verbose bool, force bool, tracker *FileTracker, downloaders ...fileDownloadFn) error {
downloader := fileDownloadFn(parser.DownloadFileFromGitHub)
if len(downloaders) > 0 && downloaders[0] != nil {
downloader = downloaders[0]
}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

fetchAndSaveRemoteDispatchWorkflows accepts a variadic downloaders ...fileDownloadFn but only ever uses downloaders[0]. As written, passing multiple downloaders will be silently ignored, which is easy to misuse and hard to debug. Consider enforcing len(downloaders) <= 1 (return an error or panic in tests) and/or rename the parameter to singular to match the actual behavior.

Copilot uses AI. Check for mistakes.
Comment on lines 772 to 776
GH_AW_PHASE: agent
GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
GH_AW_VERSION: f11a70f
GH_AW_VERSION: 0238dc8
GITHUB_API_URL: ${{ github.api_url }}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

This PR’s title/description focus on fixing a unit test timeout, but this workflow lockfile also bumps GH_AW_VERSION (and the same change appears across many .github/workflows/*lock.yml files). If these version bumps are intentional, the PR description should mention why they’re needed; if not, consider reverting/splitting them to keep the change scoped to the test fix.

Copilot uses AI. Check for mistakes.
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.

3 participants