Skip to content

chore: campaign discovery via label-based approach#11070

Merged
mnkiefer merged 7 commits intomainfrom
copilot/add-agentic-campaign-labels
Jan 21, 2026
Merged

chore: campaign discovery via label-based approach#11070
mnkiefer merged 7 commits intomainfrom
copilot/add-agentic-campaign-labels

Conversation

Copy link
Contributor

Copilot AI commented Jan 21, 2026

Campaign discovery relied on ephemeral cache memory files, causing reliability issues across distributed executions. This replaces it with persistent GitHub labels.

Label System

Two-tier labeling for campaign items (issues, PRs, discussions):

  • agentic-campaign - Generic marker for all campaign content. Prevents non-campaign workflows from processing these items.
  • z_campaign_<id> - Campaign-specific identifier (e.g., z_campaign_security-q1-2025). Enables precise per-campaign queries.

Discovery Priority

// 1. Primary: Campaign-specific label
const campaignLabel = `z_campaign_${campaignId}`;
const result = await searchByLabel(campaignLabel, repos, orgs);

// 2. Secondary: Generic campaign label  
if (result.items.length === 0) {
  await searchByLabel("agentic-campaign", repos, orgs);
}

// 3. Fallback: Cache memory (deprecated, logs warning)
// 4. Fallback: Tracker-ID search

Changes

Infrastructure (Go)

  • Added label constants: AgenticCampaignLabel, CampaignLabelPrefix
  • Added FormatCampaignLabel() helper with sanitization (spaces → hyphens, lowercase)

Discovery (JavaScript)

  • Refactored campaign_discovery.cjs to prioritize label searches
  • Deprecated discoverFromMemory() with warnings

Templates

  • Epic issues now automatically receive both labels
  • Added "Campaign Label Requirements" documentation
  • Documented skip-if-match pattern for non-campaign workflows

Workflow Isolation

Non-campaign workflows filter out campaign items:

on:
  issues:
    types: [opened, labeled]
    skip-if-match:
      query: "label:agentic-campaign"
      max: 0

Backward Compatibility

Cache memory and tracker-ID discovery remain as fallbacks. No breaking changes.

Original prompt

Don't rely on cache memory for campaign discovery but use labels. Each campaign issue (epic or worker) should get a label "agentic-campaign


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 6 commits January 21, 2026 18:25
- Add AgenticCampaignLabel constant: "agentic-campaign"
- Add CampaignLabelPrefix constant: "z_campaign_"
- Add FormatCampaignLabel helper function to generate campaign-specific labels
- Add comprehensive tests for label generation

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Add "agentic-campaign" label to epic issue creation
- Add campaign-specific "z_campaign_<id>" label to epic issues
- Updated both .github/aw and pkg/cli/templates versions

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Deprecate cache-memory discovery (discoverFromMemory)
- Make label-based discovery the primary method
- Search first by campaign-specific label (z_campaign_<id>)
- Search second by generic "agentic-campaign" label
- Keep cache-memory and tracker-id as fallbacks with warnings
- Add comments explaining discovery order and deprecation

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Add Campaign Label Requirements section to orchestrator template
- Document requirement for "agentic-campaign" and "z_campaign_<id>" labels
- Explain worker responsibilities for adding labels to created issues/PRs
- Document how non-campaign workflows should skip campaign items using skip-if-match
- Updated both .github/aw and pkg/cli/templates versions

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Update TestBuildOrchestrator_TrackerIDMonitoring to check for "tracker-id AND labels" instead of just "tracker-id"
- Reflects updated Core Principles in orchestrator template

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
All requirements implemented:
- Replace cache memory with label-based discovery
- Add "agentic-campaign" label to campaign issues
- Add campaign-specific "z_campaign_<id>" labels
- Document how other workflows skip campaign items
- All tests passing

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add agentic campaign labels to campaign issues Replace cache memory campaign discovery with label-based approach Jan 21, 2026
Copilot AI requested a review from mnkiefer January 21, 2026 18:45
@mnkiefer mnkiefer marked this pull request as ready for review January 21, 2026 18:47
@mnkiefer mnkiefer changed the title Replace cache memory campaign discovery with label-based approach chore: campaign discovery via label-based approach Jan 21, 2026
@mnkiefer mnkiefer merged commit ff4f141 into main Jan 21, 2026
148 of 149 checks passed
@mnkiefer mnkiefer deleted the copilot/add-agentic-campaign-labels branch January 21, 2026 18:56
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