ADR-008: Centralized Label Management Strategy
Status
Accepted - 2025-09-23
Context
The Fork Management Template uses GitHub labels extensively to track workflow states, issue types, and PR statuses across multiple automated workflows. Initially, each workflow created its own labels when first run:
sync.ymlcreated sync-related labelsinit.ymlcreated initialization labelsdependabot-validation.ymlcreated dependency labels- The new
cascade.ymlworkflow requires additional state-tracking labels
This distributed approach led to several issues: 1. Labels didn't exist until workflows ran, potentially breaking automation 2. No single source of truth for label definitions 3. Inconsistent label colors and descriptions 4. Difficult to maintain and document label usage 5. New workflows couldn't rely on labels existing
Decision
We will implement a centralized label management strategy where:
- All system labels are defined in
.github/labels.json - The initialization workflow creates all labels during repository setup
- Workflows should assume labels exist rather than create them. Two exceptions remain:
dependabot-validation.ymlandsync-template.ymlstill create the labels they need on first use, andadopt-fork.ymlrecreates the full set because an adopted repository never ran initialization. .github/labels.jsonis the label reference; there is no separate label document
Consequences
Positive
- Reliability: All labels exist from repository initialization
- Consistency: Single source of truth for label definitions
- Maintainability: Easy to add, update, or remove labels
- Automation: Workflows can depend on label existence
Negative
- Migration: Existing repositories need manual label sync
- Coupling: Workflows depend on initialization running first
Neutral
- Versioning: Label changes tracked in git history
- Customization: Users can modify labels.json for their needs
Implementation
Label Configuration File
{
"labels": [
{
"name": "cascade-active",
"description": "Currently processing through cascade pipeline",
"color": "0e8a16"
}
// ... more labels
]
}
Initialization Workflow Update
- name: Create all system labels
run: |
labels=$(cat .github/labels.json | jq -r '.labels[] | @base64')
for label in $labels; do
# Create each label from configuration
done
Workflow Usage Pattern
Related
- ADR-002: GitHub Actions Workflow Automation
- ADR-007: Initialization Workflow Bootstrap Process
- Label definitions:
.github/labels.jsonin the repository - Cascade Workflow