Skip to content

Fix CGO fuzz job compile failure by exposing shared test helpers to integration-tagged builds#34816

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-fuzz-workflow-failure
May 26, 2026
Merged

Fix CGO fuzz job compile failure by exposing shared test helpers to integration-tagged builds#34816
pelikhan merged 2 commits into
mainfrom
copilot/fix-fuzz-workflow-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 26, 2026

The CGO workflow’s fuzz matrix failed on main during FuzzSanitizeOutput, not due to fuzz findings but because pkg/workflow tests failed to compile under -tags integration. Shared helper symbols used by integration tests were excluded from that build context.

  • Root cause

    • Helper functions used across workflow tests (containsInNonCommentLines, extractJobSection, indexInNonCommentLines, boolPtr, strPtr) lived in _test.go files constrained by //go:build !integration, so they were unavailable when fuzz jobs compiled with integration tags.
  • Code changes

    • Removed restrictive !integration build constraints from:
      • pkg/workflow/compiler_test_helpers_test.go
      • pkg/workflow/test_helpers_shared_test.go
    • This keeps helpers test-only, but makes them visible to both default and integration-tagged test compilation paths.
  • Effect on workflow behavior

    • pkg/workflow test compilation no longer fails in integration-tagged fuzz job setup, allowing fuzz targets to execute instead of failing at compile time.
// before
//go:build !integration

package workflow

// after
package workflow

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix fuzz workflow failure on main for run #7862 Fix CGO fuzz job compile failure by exposing shared test helpers to integration-tagged builds May 26, 2026
Copilot AI requested a review from pelikhan May 26, 2026 01:18
@github-actions github-actions Bot mentioned this pull request May 26, 2026
@pelikhan pelikhan marked this pull request as ready for review May 26, 2026 01:22
Copilot AI review requested due to automatic review settings May 26, 2026 01:22
@pelikhan pelikhan merged commit b591689 into main May 26, 2026
@pelikhan pelikhan deleted the copilot/fix-fuzz-workflow-failure branch May 26, 2026 01:22
Copy link
Copy Markdown
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

This PR fixes a CGO fuzz workflow compilation failure by making shared pkg/workflow test helper functions available when tests are compiled with -tags integration. It does this by removing //go:build !integration constraints from helper-only _test.go files so integration-tagged fuzz targets can compile and run.

Changes:

  • Removed the !integration build constraint from shared workflow test helper files.
  • Ensured helper symbols (e.g., containsInNonCommentLines, extractJobSection, boolPtr, strPtr) are available to both default and integration-tagged test builds.
Show a summary per file
File Description
pkg/workflow/test_helpers_shared_test.go Removes !integration build tag so pointer/test helper utilities are available in integration-tagged test builds.
pkg/workflow/compiler_test_helpers_test.go Removes !integration build tag so compiler-related test helpers are available in integration-tagged test builds (needed by integration-tagged tests/fuzz targets).

Copilot's findings

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

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.

[CGO][FUZZ] Workflow failure on main - Run #7862

3 participants