Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

Fix: Scope Campaign Validation to Specific Files When Compiling

Summary

Fixed an issue where campaign validation was running on all campaigns regardless of which workflows were being compiled. The validation is now properly scoped:

  • When compiling specific non-campaign workflows → no campaign validation
  • When compiling specific campaign files → validates only those campaigns
  • When compiling all workflows → validates all campaigns

Changes Made

  • Modified compileSpecificFiles to track which specific campaign files are being compiled (list of paths instead of boolean)
  • Updated runPostProcessing to accept list of campaign files
  • Enhanced validateCampaigns to filter validation to specific campaign files when provided
  • Campaign validation now properly scoped based on compilation context:
    • Compiling all workflows in a directory → validates ALL campaigns
    • Compiling specific campaign files → validates ONLY those campaigns
    • Compiling non-campaign workflows → skips campaign validation entirely

Verification

Non-campaign workflows skip campaign validation:

$ ./gh-aw compile smoke-copilot
✓ Compiled 1 workflow(s): 0 error(s), 0 warning(s)

Specific campaign files validate only that campaign:

# Before: validated all 7 campaigns
$ ./gh-aw compile my-workflow.campaign.md
⚠ Campaign validation: found 7 problem(s) in campaign specs

# After: validates only the 1 campaign being compiled
$ ./gh-aw compile docs-quality-maintenance-project67.campaign.md
ℹ Validating 1 campaign spec(s)...
⚠ Campaign validation: found 6 problem(s) in campaign specs

All workflows still validates all campaigns:

$ ./gh-aw compile
⚠ Campaign validation: found 7 problem(s) in campaign specs
⚠ Compiled 127 workflow(s)

Files Modified

  • pkg/cli/compile_orchestration.go - Track campaign files list and pass to post-processing
  • pkg/cli/compile_post_processing.go - Accept campaign files list parameter
  • pkg/cli/compile_campaign.go - Filter validation to specific campaign files when provided
Original prompt

In the compile command, campaign validation should not be running for all campaigns when targetting a single workflow.

@pelikhan ➜ /workspaces/gh-aw (main) $ ./gh-aw compile smoke-copilot
✓ .github/workflows/smoke-copilot.md (64.6 KB)
⚠ Campaign validation: found 7 problem(s) in campaign specs
✓ Compiled 1 workflow(s): 0 error(s), 0 warning(s)

The message

⚠ Campaign validation: found 7 problem(s) in campaign specs

is wrong. We should not have attempted to validate all campaigns.


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

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incorrect campaign validation in compile command Skip campaign validation when compiling specific non-campaign workflows Jan 5, 2026
@pelikhan pelikhan marked this pull request as ready for review January 5, 2026 19:19
Copilot AI requested a review from pelikhan January 5, 2026 19:19
)

// initGitRepo initializes a git repository in the given directory
func initGitRepoForCampaignTest(t *testing.T, dir string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot delete test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deleted in f390df5

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Contributor

pelikhan commented Jan 5, 2026

@copilot when compiling a campaign by name, only validate that campaign file not all.

$ ./gh-aw compile my-workflow.campaign.md
⚠ Campaign validation: found 7 problem(s) in campaign specs
✓ Compiled 1 workflow(s)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 5, 2026

@copilot when compiling a campaign by name, only validate that campaign file not all.

$ ./gh-aw compile my-workflow.campaign.md...

Fixed in 59406f1. Now validates only the specific campaign file being compiled:

Before: All 7 campaigns validated

$ ./gh-aw compile my-workflow.campaign.md
⚠ Campaign validation: found 7 problem(s) in campaign specs

After: Only the 1 campaign being compiled is validated

$ ./gh-aw compile docs-quality-maintenance-project67.campaign.md
⚠ Campaign validation: found 6 problem(s) in campaign specs
✓ Compiled 1 workflow(s)

Copilot AI changed the title Skip campaign validation when compiling specific non-campaign workflows Scope campaign validation to specific files when compiling by name Jan 5, 2026
@pelikhan pelikhan merged commit 22b0aad into main Jan 5, 2026
129 of 130 checks passed
@pelikhan pelikhan deleted the copilot/fix-campaign-validation-issue branch January 5, 2026 19:39
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