ADR-020: Human-Required Label Strategy
Status
Accepted - 2025-10-01
Context
GitHub workflows often need to create issues and pull requests that require human attention. The traditional approach is to assign these items to specific users using the --assignee flag in GitHub CLI commands. However, this approach has several significant problems:
- Username Resolution Issues: GitHub's GraphQL API requires exact usernames, and organization names cannot be assigned to issues
- Dynamic User Context: Different workflows run in different contexts (different triggering users, repository owners)
- API Failures: Invalid usernames cause workflow failures with cryptic GraphQL errors like "Could not resolve to a User with the login of 'organization-name'"
- Maintenance Overhead: Hardcoded usernames become stale and need constant updates
- Cross-Repository Complexity: Template repositories used across multiple instances need flexible assignment
The original implementation used patterns like:
--assignee "${{ github.repository_owner }}" # Organization name (invalid)
--assignee "hardcoded-username" # Brittle and unmaintainable
This led to workflow failures that blocked critical automation processes.
Decision
Replace assignee-based task management with a Human-Required Label Strategy that uses GitHub's label system for task visibility and workflow management:
- Eliminate Assignees: Remove all
--assigneeflags from automated workflows - Human-Required Label: Use
human-requiredlabel to mark items needing attention - Label-Based Filtering: Team members can filter on labels to find work
- Robust Labeling: Labels never fail - no username resolution required
- Flexible Organization: Different label combinations for different priority/types
Rationale
Reliability Benefits
- No Username Resolution: Labels don't require user validation
- Never Fail: Invalid labels are ignored, not workflow-blocking errors
- Universal Compatibility: Works across all repositories and contexts
- Template-Friendly: No hardcoded usernames in template repositories
Workflow Management Benefits
- Better Filtering: Teams can create custom views using label combinations
- Priority Systems: Multiple priority labels (
high-priority,emergency) - Type Classification: Label-based categorization (
conflict,sync-failed,escalation) - Automated Processing: Workflows can query and act on labels reliably
Organizational Benefits
- Team Flexibility: Any team member can work on
human-requireditems - Load Balancing: No single person overwhelmed with assignments
- Scalable Process: Works regardless of team size or structure
- Clear Ownership: Labels indicate type and urgency without specific assignment
Implementation Details
Core Labels Used
From .github/labels.json (managed by ADR-008):
{
"name": "human-required",
"description": "Requires human intervention or review",
"color": "D73A49"
}
Supporting Labels
high-priority: Urgent items requiring immediate attentionconflict: Merge conflicts requiring manual resolutionescalation: Issues that have exceeded SLA timeoutssync-failed: Failed synchronization operationscascade-trigger-failed: Failed cascade workflow triggershuman-required: Items that need human review/action
Issue Lifecycle Labels (ADR-022)
upstream-sync: Issues related to upstream synchronizationcascade-active: Cascade integration currently in progresscascade-blocked: Cascade blocked by conflicts or issuesvalidated: Integration complete, validation successfultemplate-sync: Issues related to template updates
Workflow Implementation Pattern
Before (Problematic):
# Validate assignee before creating issue
ASSIGNEE="${{ github.actor }}"
if gh api users/"$ASSIGNEE" >/dev/null 2>&1; then
ASSIGNEE_FLAG="--assignee $ASSIGNEE"
else
ASSIGNEE_FLAG=""
fi
gh issue create \
--title "Issue requiring attention" \
--body "Issue details..." \
--label "some-label" \
$ASSIGNEE_FLAG
After (Robust with Lifecycle Tracking):
# Simple, reliable issue creation with lifecycle tracking
gh issue create \
--title "📥 Upstream Sync Ready for Review - $(date +%Y-%m-%d)" \
--body "$NOTIFICATION_BODY" \
--label "upstream-sync,human-required"
# Dynamic label updates during cascade lifecycle
gh issue edit "$ISSUE_NUMBER" \
--remove-label "human-required" \
--add-label "cascade-active"
Team Workflow Integration
GitHub Issue Filters:
# Find all items requiring human attention
label:human-required
# High priority items only
label:human-required label:high-priority
# Conflicts needing resolution
label:human-required label:conflict
# Failed automation items
label:human-required label:sync-failed
# Cascade lifecycle tracking
label:upstream-sync label:human-required # Needs manual cascade trigger
label:upstream-sync label:cascade-active # Integration in progress
label:upstream-sync label:cascade-blocked # Blocked by conflicts
label:upstream-sync label:production-ready # Ready for production merge
GitHub Project Automation:
# Project board rules
- label:human-required → "Needs Attention" column
- label:high-priority → "Urgent" column
- label:conflict → "Conflicts" column
Alternatives Considered
1. Enhanced User Validation
# Complex validation logic
if gh api users/"${{ github.actor }}" >/dev/null 2>&1; then
ASSIGNEE_FLAG="--assignee ${{ github.actor }}"
elif gh api users/"${{ github.repository_owner }}" >/dev/null 2>&1; then
ASSIGNEE_FLAG="--assignee ${{ github.repository_owner }}"
else
ASSIGNEE_FLAG="--assignee $(gh api /repos/:owner/:repo/collaborators --jq '.[0].login')"
fi
Pros: Maintains assignment approach
Cons: Complex, fragile, still fails in edge cases, API rate limiting
Decision: Rejected due to complexity and unreliability
2. Configuration-Based Assignment
Pros: Configurable per repositoryCons: Still requires username validation; manual setup; maintenance overhead
Decision: Rejected due to maintenance burden
3. External Assignment Service
Pros: Could handle complex assignment logic
Cons: Additional infrastructure; complexity; single point of failure
Decision: Rejected as over-engineering
4. Hybrid Approach (Assignment + Labels)
# Try assignment, fall back to labels
if [[ -n "${{ vars.DEFAULT_ASSIGNEE }}" ]]; then
--assignee "${{ vars.DEFAULT_ASSIGNEE }}"
fi
--label "human-required"
Pros: Best of both worlds
Cons: Still susceptible to assignment failures; increased complexity
Decision: Rejected in favor of label-only simplicity
Migration Strategy
Phase 1: Add Labels (Completed)
- Add
human-requiredlabel to all new issue/PR creation - Keep existing assignee logic temporarily
- Monitor for assignment failures
Phase 2: Remove Assignees (Completed)
- Remove all
--assigneeflags from workflows - Simplify issue/PR creation logic
- Update error handling to remove validation
Phase 3: Team Adoption
- Update team documentation for label-based workflows
- Create GitHub saved searches for common queries
- Configure project boards with label-based automation
Phase 4: Enhanced Labeling
- Add priority and category labels as needed
- Implement advanced filtering strategies
- Automate label lifecycle management
Consequences
Positive
- Reliability: Workflows never fail due to username issues
- Simplicity: Cleaner, simpler workflow code
- Flexibility: Teams can organize work however they prefer
- Scalability: Works across any size team or organization
- Maintainability: No hardcoded usernames to maintain
- Template-Friendly: Works identically across all repository instances
Negative
- No Direct Assignment: Individual accountability requires discipline
- Team Process Change: Teams must adapt to label-based workflows
- Notification Changes: No automatic assignment notifications
- Filter Learning: Team members need to learn effective label filtering
Neutral
- Different Workflow: Change in process, not necessarily better/worse
- GitHub Native: Uses GitHub features rather than external solutions
- Audit Trail: Labels provide visibility into issue classification
Team Workflow Recommendations
Individual Workflows
# Daily work queue - check for high priority items
https://github.com/org/repo/issues?q=is:open+label:human-required+label:high-priority
# Weekly triage - review all human-required items
https://github.com/org/repo/issues?q=is:open+label:human-required
# Conflict resolution focus
https://github.com/org/repo/issues?q=is:open+label:conflict+label:human-required
Project Board Setup
- Column: "Needs Attention" →
label:human-required - Column: "High Priority" →
label:high-priority - Column: "Conflicts" →
label:conflict - Column: "In Progress" → Remove
human-requiredwhen started
Notification Setup
# Team notification rules
- Watch repository for issues with specific labels
- Slack/Teams integration based on label filters
- Email notifications for high-priority items
Integration with Existing Systems
Label Management (ADR-008)
- Leverages centralized label definitions
- New labels added to
.github/labels.jsonduring initialization - Consistent across all repository instances
Workflow Patterns
- Sync workflow: Uses
upstream-sync,human-requiredfor manual cascade triggering with duplicate prevention - Cascade workflow: Uses lifecycle labels (
cascade-active,cascade-blocked,production-ready) - Monitor workflow: Uses
human-requiredfor trigger failures - Template sync: Uses
template-sync,human-requiredfor template updates
External Integrations
- Project Boards: Automatic card movement based on labels
- Slack/Teams: Filter notifications by label combinations
- GitHub Apps: Query issues by label patterns
Monitoring and Success Metrics
Key Metrics
- Issue Resolution Time: Time to close
human-requiredissues - Label Distribution: Frequency of different label combinations
- Team Engagement: Number of team members working on labeled issues
- Escalation Rate:
human-requireditems that becomehigh-priority
Success Indicators
- Zero workflow failures due to assignment issues
- Consistent issue resolution times
- Team adoption of label-based filtering
- Reduced manual workflow maintenance
Failure Detection
- Issues with
human-requiredlabel open > 7 days - High accumulation of
high-priorityitems - Team members not engaging with labeled items
Future Enhancements
Planned Improvements
- Smart Labeling: Automatic priority assignment based on issue content
- SLA Automation: Automatic escalation when items exceed time thresholds
- Load Balancing: Round-robin assignment simulation via label metadata
- Advanced Filtering: Saved searches for common workflow patterns
Integration Opportunities
- GitHub Projects: Enhanced automation based on label patterns
- External Tools: Integration with ticketing systems via labels
- Analytics: Dashboards showing team workflow efficiency
Related Decisions
- ADR-008: Centralized Label Management Strategy - Defines how labels are managed
- ADR-019: Cascade Monitor Pattern - Uses human-required labels for trigger failures
- ADR-022: Issue Lifecycle Tracking Pattern - Defines lifecycle label usage
- Sync Workflow Updates - Implements label-based task management
- Cascade Workflow Updates - Uses labels for conflict management
Success Criteria
- 100% workflow reliability (no assignment-related failures)
- Team adopts label-based filtering within 2 weeks
- Average resolution time for
human-requiredissues ≤ 48 hours - Zero maintenance overhead for user assignment management
- Template repository works identically across all instances
- Clear audit trail for all automated task creation