feat: Add retro workflow for retrospective analysis - #74
Conversation
There was a problem hiding this comment.
Review Complete: Looks Good to Merge
I've reviewed this PR and it looks excellent. Here's what I checked:
✅ Correctness
- Workflow configuration: Valid gh-aw syntax, properly structured frontmatter
- Schedule: Every 6 hours at
:17past the hour (good - avoids the:00/:30stampede) - Permissions: Read-only (contents, actions, issues, pull-requests) - appropriate for analysis
- Safe-outputs: Correctly configured with
max: 5for create-issue, auto-labels withagent/retro - Pre-fetch step: Well-written defensive bash with
set -euo pipefail, portable date command - Concurrency: Uses
run_id(allows parallel runs) - intentional per comments, race condition on duplicate issues is benign
✅ Code Quality
- Clear documentation in both YAML comments and prompt
- Follows patterns from existing workflows (ci-triage.md, queue-triage.md)
- Good design decisions explained in comments (e.g., concurrency strategy, cron timing)
- Duplicate prevention built into the agent prompt
- Actionable prompt with clear constraints and success criteria
✅ Safety
- Read-only GitHub access via MCP tools
- Reasonable limits (5 issues per run, 20 minute timeout)
- Safe bash tools only (cat, head, tail, grep, wc, ls, jq, date, sort, uniq)
- No destructive operations
✅ Functionality
Correctly implements all requirements from issue #73:
- ✅ Analyzes repos where deployed (default: bootc-dev/bcvk, configurable)
- ✅ Identifies patterns (recurring failures, performance issues, flaky tests)
- ✅ Files improvement issues
- ✅ Prevents duplicates
- ✅ Scheduled every 6 hours
✅ Repository Conventions
- No
Signed-off-by(correct per CLAUDE.md for AI-generated code) - Lockfile auto-generated correctly with proper metadata
- Resolves #73
- Follows same structure as other standalone workflows
Notes
- Default target repo "bootc-dev/bcvk" is documented as "Adopter-specific" - intentional for this demo repo
- PR is currently in draft status - ready to mark as ready for review when you're comfortable
This is high-quality work that's ready to merge.
| - cron: "17 */6 * * *" | ||
| workflow_dispatch: | ||
| inputs: | ||
| target_repos: |
There was a problem hiding this comment.
I think we should scan the whole bootc-dev org by default
| # No concurrency restriction: each scheduled run analyzes a snapshot of runs | ||
| # at that moment. Multiple retros racing is harmless — worst case, they both | ||
| # notice the same pattern and one's create-issue gets rejected as a duplicate | ||
| # (which the agent is already told to handle gracefully). |
There was a problem hiding this comment.
Mmm runs shouldn't last 6 hours but we also don't want multiple retros?
| network: defaults | ||
|
|
||
| tools: | ||
| bash: ["cat", "head", "tail", "grep", "wc", "ls", "jq", "date", "sort", "uniq"] |
There was a problem hiding this comment.
Why, this looks unnecessary
|
Also retro should only run in this repository not in any downstream ones I think, can we exclude the install from other repos or just skip? |
|
Also TODO auto-trigger agent/fixme label on human requesting changes |
|
Commit pushed:
|
Change the retro workflow to analyze runs in this repository (bootc-dev/gh-agentic-workflows) instead of downstream deployments. - Update default target repos from bootc-dev/bcvk to this repo - Update documentation to reflect self-analysis scope - Recompile retro.lock.yml Addresses reviewer feedback on PR #74. Assisted-by: AI
|
Fixed the scope of the retro workflow per reviewer feedback. Changes made:
The retro workflow will now analyze workflow runs in this repository's own gh-agentic-workflows deployment, rather than looking at downstream repos where the framework is deployed.
|
There was a problem hiding this comment.
Review: retro.md workflow
I've reviewed the new retrospective analysis workflow. The overall design is solid and follows the established patterns from ci-triage.md and queue-triage.md. However, there's a critical portability bug that needs to be fixed.
Critical Issue: Hardcoded Repository Name
Location: .github/workflows/retro.md:95
The pre-fetch step hardcodes the repository name instead of using the dynamic github.repository context:
# Current (line 95):
REPOS="bootc-dev/gh-agentic-workflows"Problem: This breaks the workflow if:
- The repository is forked
- The repository is renamed
- The workflow is copied to another deployment
Required Fix: Follow the same pattern as ci-triage.md and queue-triage.md:
- Add
REPOto the env block (after line 82):
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_REPOS: ${{ github.event.inputs.target_repos }}
LOOKBACK_DAYS: ${{ github.event.inputs.lookback_days || '7' }}
REPO: ${{ github.repository }}- Change line 95 to use the env var:
# Default: analyze this repository's workflow runs.
REPOS="$REPO"This follows the documented pattern from ci-triage.md (lines 167-170) where env vars are used instead of inlining ${{ github.* }} expressions in run blocks (due to a compiler bug that silently drops the rest of the env block).
What I Checked
✅ Structure: Follows the same pattern as existing workflows
✅ Concurrency: Correctly uses run_id to avoid the single-slot trap
✅ Permissions: Appropriate read-only permissions
✅ Safe-outputs: Correctly configured with create-issue, noop, and missing-data
✅ Pre-fetch logic: Well-designed with proper error handling and BSD/GNU date compatibility
✅ Prompt: Clear, well-structured, and follows repository patterns
✅ Cron schedule: Uses :17 to avoid load spikes (good)
✅ Bash allowlist: Reasonable tool selection for the task
Once the hardcoded repository name is fixed, this will be ready to merge.
|
Commit pushed:
|
Replace hardcoded repository name with ${{ github.repository }}
context to support forks, renames, and multi-repo deployments.
- Add REPO env var to pre-fetch step
- Use $REPO instead of hardcoded bootc-dev/gh-agentic-workflows
- Recompile retro.lock.yml
Addresses reviewer feedback on PR #74.
Assisted-by: AI
There was a problem hiding this comment.
Review Complete
The code implementation is solid and follows all repository conventions. However, the PR description contains stale information that needs correction before merge.
What I Checked
- ✅ Shell script length and error handling
- ✅ Workflow configuration and permissions
- ✅ Safe-outputs setup
- ✅ Follows existing workflow patterns (ci-triage.md, queue-triage.md)
- ✅ Agent prompt is clear and has proper constraints
- ✅ Commit messages are well-formatted
Required Fix
Update the PR description to accurately reflect that the workflow analyzes this repository by default, not bootc-dev/bcvk.
The "Multi-repo analysis" section currently says:
currently
bootc-dev/bcvk, configurable via workflow_dispatch
But the code (retro.md:96) actually defaults to ${{ github.repository }} (this repo).
Suggested replacement:
Repository analysis: Analyzes workflow runs in this repository (bootc-dev/gh-agentic-workflows) by default, with support for analyzing other repositories via the
target_reposworkflow_dispatch input.
This matters because the PR description will become the squash commit message in main's history—it must accurately describe what the workflow does.
Automated Fix Loop: Iteration Limit ReachedThe automated fix loop has reached its iteration limit of 3 commits and automated fixing has stopped. A human review is now required. To proceed, you can either:
The only way to continue the automated loop is to reduce the branch's commit count below 3 first (e.g., by squashing commits).
|
No I mean the retro workflow should run from the context of this repository, but scan all the other repos in the organization. |
e9fe83c to
d98f627
Compare
There was a problem hiding this comment.
Reviewed the retro workflow addition. The implementation is solid:
- Pre-fetch script properly validates inputs and handles edge cases
- Agent prompt is clear with well-defined constraints
- Security controls are appropriate (read-only + safe-outputs)
- Integration is complete (CI, justfile, labels, docs)
- Correctly excluded from aw.yml for host-only deployment
- Follows established patterns from ci-triage and queue-triage
Ready to merge.
| 3. **Analyze workflow runs** in each target repository: | ||
| - List workflow runs from the lookback window using GitHub MCP tools | ||
| - Identify patterns worth investigating: | ||
| - Recurring failures (same workflow/job failing repeatedly) | ||
| - Long-running workflows that could be optimized | ||
| - Flaky tests or intermittent issues | ||
| - Underutilized or overly complex workflows | ||
| - Error patterns in failed runs | ||
| - Look for opportunities to improve the agentic pipeline itself | ||
| (drafter/review/fix/merge) based on how it's performing in practice | ||
|
|
||
| 4. **Check for duplicate issues**: | ||
| - List existing open issues in the host repository (`gh-agentic-workflows`) | ||
| labeled `agent/retro` or related to the patterns you've identified | ||
| - Don't file an issue if an open one already covers the same improvement | ||
| - If an existing issue is stale or incomplete, note that in your analysis | ||
| but don't create a duplicate |
There was a problem hiding this comment.
I truly love how simple this is, yet with the current frontier models it feels like this could be enough to get solid results
Let gh-aw own the supported concrete model selection while this repository continues to pin the compiler version that interprets it. Assisted-by: AI Signed-off-by: Colin Walters <walters@verbum.org>
Run retrospective analysis centrally so improvements across bootc-dev repositories can be identified without installing another scheduled workflow downstream. Keep findings in this repository to make deduplication and follow-up consistent. Closes: #73 Assisted-by: AI Signed-off-by: Colin Walters <walters@verbum.org>
Consumers must compile this package with the same gh-aw release used here rather than independently adopting the latest compiler. Carry the selected pin in the included maintenance workflow, verify it before changing generated artifacts, and keep package updates distinct from compiler maintenance so local workflow customizations remain reviewable. Assisted-by: AI Signed-off-by: Colin Walters <walters@verbum.org>
d98f627 to
eb11415
Compare
There was a problem hiding this comment.
Reviewed the diff (retro.md/retro.lock.yml, the model-alias switch across all workflows, and the upgrade.yml/scripts refactor) plus the current PR branch checkout.
What looks good:
- retro.md correctly implements the org-wide scan from the host repo that was requested in review (discovers org repos via
gh api orgs/OWNER/repos, excludes the host repo by default, validatestarget_repos/lookback_dayson dispatch) and the README documents the GITHUB_TOKEN cross-repo access limitation honestly. - The
sonnetmodel-alias switch is applied consistently across every workflow .md/.lock.yml pair (verified hashes/env vars match). - scripts/gh-aw-version.mjs and scripts/setup-gh-aw.mjs are clean, well-factored, and tests/gh-aw-version.test.mjs covers them (plus the embedded upgrade.yml install script) thoroughly — I ran
node --test tests/gh-aw-version.test.mjslocally and all 6 tests pass.
What needs to change:
- The new tests/gh-aw-version.test.mjs is never executed by CI. ci.yml only runs
gh aw compile ... --approveplus the lock-drift check; there is nonode --test tests/(or equivalent) step, and justfile has notestrecipe either. Per REVIEW.md ("Tests are expected for all non-trivial changes"), these tests need to actually run somewhere automated, otherwise they'll silently bit-rot the first time gh-aw-version.mjs/setup-gh-aw.mjs/upgrade.yml change. Please add a step to ci.yml (and ideally ajust testrecipe) that runsnode --test tests/*.test.mjs.
|
The automated fix loop has reached its iteration limit (3 commits on this branch) and automated fixing has stopped. A human needs to review this PR and either:
Note: re-applying
|
Summary
Adds a new scheduled workflow (
retro.md) that performs retrospective analysis of workflow runs across repositories where gh-agentic-workflows is deployed.What it does
bootc-dev/bcvk, configurable via workflow_dispatch)agent/retroValidation
gh aw compile --approveretro.lock.ymllockfileci-triage.md,queue-triage.md)Implementation details
Resolves #73