Skip to content

[plan] Add proactive staleness warnings with actionable guidance #6184

@github-actions

Description

@github-actions

Objective

Enhance gh aw status output to provide clear, actionable guidance when workflows are stale or uncompiled. Add color-coded status, "Action Needed" column, summary line with bulk commands, and optional fix script generation.

Context

Current status output shows "Compiled: No" but provides no guidance on what to do next. Users must figure out commands themselves, leading to confusion and inconsistent workflow states.

Approach

1. Enhance WorkflowStatus Struct

Add new field:

ActionNeeded  string   `json:"action_needed" console:"header:Action Needed,omitempty"`

Generate commands based on staleness type:

  • Never compiled: "Run: gh aw compile workflow.md"
  • Stale (hash): "Run: gh aw compile workflow.md (content changed)"
  • Stale (timestamp): "Run: gh aw compile workflow.md (timestamp mismatch)"
  • Up-to-date: "" (empty)

2. Add Summary Footer

After status table, print:

⚠️  5 workflows need compilation
  Run: gh aw compile --all

Or if all up-to-date:

✓ All workflows are up-to-date

3. Add Color Coding

Using console package:

  • Green: Compiled == "Yes" (up-to-date)
  • Yellow: Compiled contains "Stale"
  • Red: Compiled == "No" (never compiled)

4. Add --fix-suggestions Flag

Generate executable shell script:

gh aw status --fix-suggestions > fix-workflows.sh

Output:

#!/bin/bash
# Generated by gh aw status --fix-suggestions
gh aw compile workflow1.md
gh aw compile workflow2.md
git add .github/workflows/*.lock.yml
echo "Done! Review changes with: git diff --cached"

Files to Modify

  • pkg/cli/status_command.go - Enhance output and add features
  • pkg/console/*.go - Add color formatting utilities if needed
  • pkg/cli/status_command_test.go - Test new output format

Acceptance Criteria

  • Status output includes "Action Needed" column
  • Commands are copy-paste ready
  • Summary line shows total needing compilation
  • Color-coded output for terminal display
  • --fix-suggestions generates valid shell script
  • Verbose mode explains staleness reason
  • Tests verify output format correctness
  • Documentation updated with examples
    Related to [plan] Workflow Lifecycle Management & Staleness Detection Improvements #6181

AI generated by Plan Command for discussion #6133

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions