Skip to content

[WIP] Fix flaky test and update GitHub Actions to latest versions#11217

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/fix-flaky-test-and-update-actions
Closed

[WIP] Fix flaky test and update GitHub Actions to latest versions#11217
Copilot wants to merge 2 commits intomainfrom
copilot/fix-flaky-test-and-update-actions

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

Fix Flaky Test and Update GitHub Actions

Plan

  • Apply patch from workflow run 21237983259
    • Fix flaky test in pkg/cli/init_test.go (change defer to t.Cleanup)
    • Update GitHub Actions in .github/aw/actions-lock.json
    • Update action pins in pkg/workflow/data/action_pins.json
    • Update test expectations in pkg/workflow/action_pins_test.go
    • Recompile 70 workflow lock files
  • Fix logger name conflict in pkg/workflow/compiler_safe_outputs_config.go
  • Run tests to verify the fix (passed 5 consecutive runs)
  • Run make agent-finish to validate all changes
  • Final verification

Changes Made

  1. Fixed Flaky Test (pkg/cli/init_test.go)

    • Changed from defer to t.Cleanup() for directory restoration
    • Ensures working directory is restored before temp directory is cleaned up
    • Test now passes consistently (verified with 5 consecutive runs)
  2. Fixed Logger Name Conflict (pkg/workflow/compiler_safe_outputs_config.go)

    • Renamed compilerSafeOutputsLog to compilerSafeOutputsConfigLog
    • Resolves duplicate logger declaration with compiler_safe_outputs.go
  3. Updated GitHub Actions (27 actions updated)

    • actions/setup-node: v6.1.0 → v6.2.0
    • actions/setup-go: v6.1.0 → v6.2.0
    • anchore/sbom-action: v0.20.x → v0.22.0
    • And 24 more actions
  4. Updated Test Expectations (pkg/workflow/action_pins_test.go)

    • Updated expected versions to match new action pins
  5. Recompiled Workflows (70 .lock.yml files)

    • All workflows recompiled with updated action versions
Original prompt

This section details on the original issue you should resolve

<issue_title>[ca] Fix flaky test and update GitHub Actions to latest versions</issue_title>
<issue_description>## Summary

This PR addresses CI failures by fixing a flaky test and updating all GitHub Actions to their latest versions.

Changes Made

1. Fixed Flaky Test

File: pkg/cli/init_test.go

  • Issue: TestCreateCampaignLabel was failing intermittently with "getwd: no such file or directory"
  • Root Cause: The test was running in parallel and using defer to restore the working directory. However, t.Cleanup() (which removes the temp directory) was running before the deferred function, causing os.Getwd() to fail when called from a deleted directory.
  • Fix: Changed from defer to t.Cleanup() for directory restoration, ensuring it runs before the temp directory is removed.

2. Updated GitHub Actions

Files: .github/aw/actions-lock.json, pkg/workflow/data/action_pins.json

  • Ran gh aw update to update all action pins to latest versions
  • 27 actions updated, including:
    • actions/setup-node: v6.1.0 → v6.2.0
    • actions/setup-go: v6.1.0 → v6.2.0
    • anchore/sbom-action: v0.20.x → v0.22.0
    • actions/ai-inference: v2 → v2.0.5
    • docker/build-push-action: v6 → v6.18.0
    • haskell-actions/setup: v2.9.1 → v2.10.3
    • ruby/setup-ruby: v1.275.0 → v1.286.0
    • And 20 more actions

3. Updated Test Expectations

File: pkg/workflow/action_pins_test.go

  • Updated test expectations to match new action versions
  • Changed expected versions from v6.1.0 to v6.2.0 for setup-node and setup-go

4. Recompiled Workflows

Files: 70 .lock.yml files in .github/workflows/

  • Recompiled all workflows to reflect updated action pins
  • All workflows compile successfully

Validation

Formatting: make fmt - All code formatted
Linting: make lint - All linters pass
Test Fix: TestCreateCampaignLabel now passes consistently
Action Pin Tests: All action pin tests pass with updated versions
Workflow Compilation: All 133 workflows compile successfully

Notes

AI generated by CI Cleaner


[!NOTE]
This was originally intended as a pull request, but the git push operation failed.

Workflow Run: View run details and download patch artifact

The patch file is available in the agent-artifacts artifact in the workflow run linked above.

To apply the patch locally:

# Download the artifact from the workflow run https://github.com/githubnext/gh-aw/actions/runs/21237983259
# (Use GitHub MCP tools if gh CLI is not available)
gh run download 21237983259 -n agent-artifacts

# The patch file will be at agent-artifacts/tmp/gh-aw/aw.patch after download
# Apply the patch
git am agent-artifacts/tmp/gh-aw/aw.patch
Show patch preview (500 of 1580 lines)
From cf3ed5950f1609025afe52b42e2ffd2d14e009b7 Mon Sep 17 00:00:00 2001
From: CI Cleaner Bot <ci-cleaner@github.com>
Date: Thu, 22 Jan 2026 06:38:29 +0000
Subject: [PATCH] Fix flaky test in TestCreateCampaignLabel and update GitHub
 Actions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This commit addresses CI failures by:

1. **Fixed flaky test**: TestCreateCampaignLabel was failing due to cleanup
   order issues in parallel tests. The test was calling os.Getwd() in a
   defer after the temp directory had been cleaned up. Fixed by using
   t.Cleanup() to restore the working directory before temp dir cleanup.

2. **Updated GitHub Actions**: Ran 'gh aw update' to update all action pins
   to their latest versions, including:
   - actions/setup-node: v6.1.0 → v6.2.0
   - actions/setup-go: v6.1.0 → v6.2.0
   - anchore/sbom-action: v0.20.x → v0.22.0
   - actions/ai-inference: v2 → v2.0.5
   - And 23 other action updates

3. **Updated test expectations**: Updated action_pins_test.go to match
   the new action versions in the expectations.

4. **Recompiled workflows**: Recompiled all workflow lock files to reflect
   the updated action pins.

Changes:
- Fixed: pkg/cli/init_test.go (cleanup order in parallel tests)
- Updated: .github/aw/actions-lock.json (27 action updates)
- Updated: pkg/workflow/data/action_pins.json (synced from actions-lock)
- Updated: pkg/workflow/action_pins_test.go (test expectations)
- Updated: 70 workflow lock files (recompiled with new action versions)

All formatting and linting checks pass.
---
 .github/aw/actions-lock.json                  | 131 +++++++-----------
 .../agent-performance-analyzer.loc...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes githubnext/gh-aw#11204

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan closed this Jan 22, 2026
Copilot AI requested a review from pelikhan January 22, 2026 07:35
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