Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/089481e9-f9fd-4391-aaee-f644fe18cb13 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixes false positive 'Compiled: No' after git clone/checkout. The mtime comparison was unreliable because git writes .lock.yml before .md during checkout, making .md appear newer. Now uses the same hash-based isCompiledUpToDate() check already used in status_command.go. Agent-Logs-Url: https://github.com/github/gh-aw/sessions/089481e9-f9fd-4391-aaee-f644fe18cb13 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
gh aw list
There was a problem hiding this comment.
Pull request overview
This PR fixes gh aw list incorrectly reporting workflows as not compiled after git clone/checkout by switching compiled-status detection from timestamp comparisons to a content-based frontmatter hash check (matching the logic used by gh aw status). It also updates several generated workflow lock files with safer shell quoting (and related regenerated metadata).
Changes:
- Replace mtime-based compiled detection in
gh aw listwithisCompiledUpToDate(frontmatter-hash based). - Regenerate/adjust multiple
.lock.ymlworkflows to consistently quote${RUNNER_TEMP}script paths (and refresh generated prompt/config markers). - Update
deep-report.lock.ymlmetadata and environment wiring as part of regeneration.
Show a summary per file
| File | Description |
|---|---|
pkg/cli/list_workflows_command.go |
Uses hash-based isCompiledUpToDate to make compiled status stable across git operations. |
.github/workflows/refactoring-cadence.lock.yml |
Quotes ${RUNNER_TEMP} script paths for safer execution; regenerated lock content. |
.github/workflows/design-decision-gate.lock.yml |
Same quoting/regeneration updates in the lock workflow. |
.github/workflows/deep-report.lock.yml |
Regenerated lock content (metadata hash/prompt markers) and updated env wiring. |
.github/workflows/architecture-guardian.lock.yml |
Same quoting/regeneration updates in the lock workflow. |
.github/workflows/approach-validator.lock.yml |
Same quoting/regeneration updates in the lock workflow. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 2
| if _, err := os.Stat(lockFile); err == nil { | ||
| // Check if up to date | ||
| mdStat, _ := os.Stat(file) | ||
| lockStat, _ := os.Stat(lockFile) | ||
| if mdStat.ModTime().After(lockStat.ModTime()) { | ||
| compiled = "No" | ||
| } else { | ||
| compiled = "Yes" | ||
| } | ||
| compiled = isCompiledUpToDate(file, lockFile) | ||
| } |
There was a problem hiding this comment.
Calling isCompiledUpToDate here computes a frontmatter hash by re-reading/parsing the workflow file (and creating a new import cache) even though this loop already reads the same file content immediately afterward to extract frontmatter fields. If this command can list many workflows, consider refactoring to reuse the existing read content and/or a shared parser.ImportCache across iterations to avoid redundant IO/parsing.
| if _, err := os.Stat(lockFile); err == nil { | ||
| // Check if up to date | ||
| mdStat, _ := os.Stat(file) | ||
| lockStat, _ := os.Stat(lockFile) | ||
| if mdStat.ModTime().After(lockStat.ModTime()) { | ||
| compiled = "No" | ||
| } else { | ||
| compiled = "Yes" | ||
| } | ||
| compiled = isCompiledUpToDate(file, lockFile) | ||
| } |
There was a problem hiding this comment.
Compiled status for gh aw list is now driven by isCompiledUpToDate. The hash comparison logic is unit-tested, but the list command tests currently only assert “no error” and don’t validate the compiled field. Consider adding a focused test that creates a temp workflow markdown + lock file and asserts the JSON output reports compiled: Yes/No as expected, to cover the wiring in this command.
|
@copilot review comments |
… test - Add isCompiledUpToDateWithCache to avoid creating a new ImportCache per workflow when listing many workflows - Use the shared cache in list_workflows_command.go - Add TestRunListWorkflows_CompiledField to verify Yes/No/N/A compiled output Agent-Logs-Url: https://github.com/github/gh-aw/sessions/4d0cb1fc-c323-4304-8a8e-69f93171f29a Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Addressed both reviewer comments in 17e6554:
|
gh aw listfalsely reported Compiled: No after everygit cloneorgit checkoutbecause git writes.lock.ymlbefore.mdalphabetically, making the source file appear newer by a few nanoseconds.Change
Replaced the mtime comparison in
list_workflows_command.gowith a content-based frontmatter hash check (matching the logic used bygh aw status), which compares thefrontmatter_hashembedded in the lock file's metadata against a freshly computed hash of the source frontmatter.A shared
parser.ImportCacheis created once before the loop and reused across all workflow iterations to avoid redundant allocations when listing many workflows.Legacy lock files without a
frontmatter_hashfall back to"Yes"to avoid false negatives.Testing
Added
TestRunListWorkflows_CompiledFieldwhich creates a temp workflow + lock file and asserts the JSON output reportscompiled: Yes(matching hash),No(mismatched hash), andN/A(no lock file), directly validating the wiring in the list command.