Repository navigation
Treat explicit default --dir as the default workflow directory in compile - #78312
Conversation
Compiling with --dir .github/workflows (as gh aw update/upgrade do) skipped action-failure expiry marker reconciliation and maintenance generation, emitting GH_AW_ACTION_FAILURE_ISSUE_EXPIRES_HOURS "168" instead of "0". Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
There was a problem hiding this comment.
Reviewed the changed lines and specialist pass. No actionable correctness, regression, performance, or maintainability issues found. The absolute-path concern is not applicable because --dir absolute paths are rejected by existing validation; the explicit-default maintenance generation is intentional per the PR description. Static review only; tests were not run.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.5K
Comment /review to run again
Comment MemoryPeek at saved memory (spec-review-history)History |
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the changes aligning explicit default-directory handling with implicit defaults.
No open issues 🎉
What changed in this PR
This PR makes explicit --dir .github/workflows behave like omitting --dir in gh aw compile, fixing compilation through gh aw update while preserving custom-directory behavior.
Changes:
- Centralize default-directory detection, including normalized path variants.
- Apply that detection to expiry reconciliation, generated workflows, and
--dependabotvalidation. - Extend regression coverage for explicit default-directory paths.
| File | Description |
|---|---|
pkg/cli/update_compile_test.go |
Verify expiry reconciliation for two explicit default-directory forms. |
pkg/cli/compile_validation.go |
Use shared default-directory detection for --dependabot validation. |
pkg/cli/compile_pipeline.go |
Enable default-directory post-processing when the directory is explicit. |
pkg/cli/compile_config.go |
Add a helper that recognizes empty and normalized default-directory paths. |
Review effort: Balanced (dynamic)
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd. The fix is correct and the regression test catches the bug. One test gap remains.
📋 Key Themes and Verification
Verification
- Targeted
pkg/clitests pass (TestUpdateCompilation_ReconcilesDefaultActionFailureExpiry, dependabot validation, compile validation).go vetis clean andgofmtreports no changes. - Mutation check: removing the
usesDefaultWorkflowDirpath check makes the newdir=".github/workflows"assertion fail, so the test guards the bug. - The helper matches the existing dependabot tests, which already accept
.github/workflowsand rejectcustom/workflows.
Key Themes
- Untested behavior change: the PR notes that explicit
--dir .github/workflowsnow generates maintenance workflows, but no test covers that. See the inline comment. - Possible gap, not verified: the Dependabot branch in
compile_pipeline.go(about line 999) still joins the rawconfig.WorkflowDir. An empty value may resolve manifests to the git root. It predates this PR and I did not reproduce it end to end, so treat it as a lead.
Positive Highlights
- ✅ One helper,
usesDefaultWorkflowDir(), replaces three inconsistent checks. - ✅ The test runs both
.github/workflowsand./.github/workflows/, covering path normalization.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~6 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| require.NotContains(t, string(lockContent), `GH_AW_ACTION_FAILURE_ISSUE_EXPIRES_HOURS: "168"`) | ||
|
|
||
| // An explicit default directory must compile identically to the implicit one. | ||
| for _, explicitDir := range []string{".github/workflows", "./.github/workflows/"} { |
There was a problem hiding this comment.
[/tdd] This loop only asserts expiry reconciliation, but the PR's behavior note says explicit --dir .github/workflows now also generates maintenance workflows. That change has no test. Asserting agentics-maintenance.yml does not work here, because the implicit compile does not produce it in this fixture either.
💡 Suggested test
Compare the full set of generated files between the implicit compile and each explicit-dir compile, for example by listing workflowsDir after each run and requiring the lists to match. This checks the parity claim directly without depending on which trigger generates the maintenance file.
@copilot please address this.
There was a problem hiding this comment.
Added a generated-file-set parity assertion for the implicit and both explicit default-directory compiles. The change is in commit `
There was a problem hiding this comment.
Added the generated-file-set parity assertion; commit HASH contains the change.
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "98f904d3ba3fd5cfff81c7d5b2263b9369355cae",
"kind": "requested",
"schema_version": "1",
"state": "f8bfa89e08d5a6ab3599dbb598f18373d562be3f247ad749a3c07196796b57a4",
"work": [
"d2dbb1d6b5c467958a4286bf4eeb0c970250fc8642b5b7a4801754db52532f04"
],
"workflow": "pr-sous-chef"
}
|
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
|
Category: bug
|
|
🎉 This pull request is included in a new release. Release: |
Compiling with an explicit
--dir .github/workflowsproduced different output than compiling with no--dir: the lock file keptGH_AW_ACTION_FAILURE_ISSUE_EXPIRES_HOURS: "168"instead of"0", and maintenance workflow generation was skipped.gh aw updatehits this path because its action-ref updater always passes the default directory explicitly.Cause
compile_pipeline.gousedconfig.WorkflowDir == ""to decide whether a compile targets the default directory, so naming the default directory explicitly was treated as a custom--dir.Change
CompileConfig.usesDefaultWorkflowDir(), which returns true for an empty dir or any path that cleans toconstants.GetWorkflowDir()(e.g../.github/workflows/).--dependabotcustom-dir validation.Behavior note
gh aw compile --dir .github/workflowsnow also generates maintenance workflows, matching the no---dirbehavior. Real custom directories are unchanged.Testing
Extended
TestUpdateCompilation_ReconcilesDefaultActionFailureExpiryto recompile with.github/workflowsand./.github/workflows/; it fails without the fix (dir=".github/workflows") and passes with it. Targetedpkg/clicompile/update/upgrade/maintenance tests pass.