Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 23, 2026

Campaign labels used the legacy campaign:<id> format. Go code already used z_campaign_<id>, but JavaScript code and documentation still referenced the old format. The z_ prefix ensures campaign labels sort last in GitHub's label lists.

Changes

JavaScript implementation:

  • Centralized prefix in CAMPAIGN_LABEL_PREFIX = "z_campaign_" constant
  • Added formatCampaignLabel() helper mirroring Go's pkg/stringutil/identifiers.go:FormatCampaignLabel()
  • Removed legacy GH_AW_TRACKER_LABEL environment variable support

Code example:

// Before
labels: [`campaign:${campaignId}`]

// After
const CAMPAIGN_LABEL_PREFIX = "z_campaign_";
function formatCampaignLabel(campaignId) {
  return `${CAMPAIGN_LABEL_PREFIX}${String(campaignId).toLowerCase().replace(/[_\s]+/g, "-")}`;
}
labels: [formatCampaignLabel(campaignId)]

Tests & documentation:

  • Updated 8 test expectations across 3 test files
  • Updated campaign specs, examples, and safe-outputs reference documentation
  • Updated comment in pkg/workflow/safe_output_validation_config.go

Notes

Go validation already rejects campaign: format. This PR completes the migration by aligning JavaScript and documentation with the established convention.

Original prompt

Catch and remove all legacy label references in campaign related code campaign:<id> and replace with new convention z_campaign_<id>. Make it robust and consider outsourcing in a campaign prefix variable or similar.


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

Copilot AI and others added 3 commits January 23, 2026 08:32
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
…efix

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove legacy label references in campaign code Migrate campaign labels from campaign:<id> to z_campaign_<id> format Jan 23, 2026
Copilot AI requested a review from mnkiefer January 23, 2026 08:47
@mnkiefer mnkiefer marked this pull request as ready for review January 23, 2026 08:49
@mnkiefer mnkiefer merged commit b67c055 into main Jan 23, 2026
140 checks passed
@mnkiefer mnkiefer deleted the copilot/remove-legacy-label-references branch January 23, 2026 08:51
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