Repository navigation
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The refactor preserves behavior and adds focused coverage, with only a minor non-blocking control-flow simplification noted.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Refactors workflow resolution into focused modules while preserving existing behavior and APIs.
Changes:
- Splits resolution, local packages, assets, package specs, and wildcard handling.
- Adds targeted tests for resolution validation, package assets/specs, and dispatch parsing.
| File | Description |
|---|---|
pkg/cli/add_workflow_resolution.go |
Retains core resolution orchestration. |
pkg/cli/add_workflow_wildcard.go |
Extracts wildcard, dispatch, and redirect handling. |
pkg/cli/add_workflow_local_package.go |
Extracts local package resolution. |
pkg/cli/add_workflow_package_assets.go |
Extracts skill and agent discovery. |
pkg/cli/add_workflow_package_specs.go |
Extracts package-to-workflow spec generation. |
pkg/cli/add_workflow_resolution_test.go |
Tests invalid resolution inputs. |
pkg/cli/add_workflow_local_package_test.go |
Tests local manifest discovery. |
pkg/cli/add_workflow_package_assets_test.go |
Tests skill and agent discovery. |
pkg/cli/add_workflow_package_specs_test.go |
Tests package spec generation and fallbacks. |
pkg/cli/add_wildcard_test.go |
Adds dispatch parsing coverage. |
| for _, bootstrapProfile := range bootstrapProfiles { | ||
| resolutionLog.Printf("Bootstrap profile found: packageID=%s", bootstrapProfile.PackageID) | ||
| return bootstrapProfile, resolutionWarnings | ||
| } | ||
| return nil, resolutionWarnings |
There was a problem hiding this comment.
Updated in d7873a9: removed the loop and unreachable fallback, using the single profile from the case directly.
There was a problem hiding this comment.
Updated in d7873a9: removed the loop and unreachable fallback, using the single profile from the case directly.
|
@copilot
Failed checks:
|
…actor-cli-add-workflow-resolution Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.
|
|
✅ Ponytail Reviewer completed successfully! Warning Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs for details.
|
The three failed jobs all trace to the existing
The three failed jobs all trace to the existing |
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
ADR requiredThis PR triggers the design-decision gate because it adds more than 100 lines in a business-logic directory ( I did not find an existing ADR in the PR body, and the latest ADR on the branch ( Based on the PR description and diff, I added a draft ADR here:
Evidence used:
Next action: review and refine the draft ADR, then keep it with the PR as the design record for this refactor.
|
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment.
|
There was a problem hiding this comment.
Verdict
No blocking regressions stood out in the current head of this refactor.
What I checked
- The current head already removed the earlier unreachable-control-flow nit in
selectBootstrapProfile, so I did not repeat that comment. - The rest of the diff reads as mechanical extraction of local-package, asset, package-spec, and wildcard helpers rather than a semantic rewrite.
- The added tests cover the main moved seams: invalid resolution input,
workflow_dispatchparsing, local skill/agent discovery, and package spec generation.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 61.5 AIC · ⌖ 7.02 AIC · ⊞ 19.2K
Comment /review to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /codebase-design — approving with minor non-blocking suggestions.
📋 Key Themes & Highlights
Key Themes
- Two small cross-cutting-concern nits:
add_workflow_wildcard.gomixes redirect-following with wildcard expansion (name doesn't match full content), andRepoSpec{...}literals are duplicated 5x acrossadd_workflow_package_specs.go. - The split follows good module boundaries overall: local-package resolution, asset discovery, spec generation, and wildcard expansion are each cleanly separated with clear public/private surfaces.
- The previously flagged unreachable-fallback issue in
selectBootstrapProfile(case 1 loop) was already fixed in commit d7873a9.
Positive Highlights
- ✅ Each extracted file stays well under 400 lines with a single clear responsibility.
- ✅ Good new test coverage added for invalid resolution input, package-spec generation, local skill/agent discovery, and dispatch parsing — mitigates refactor risk.
- ✅ Public API surface (
ResolveWorkflows,WorkflowSpec, etc.) is unchanged; package-private sentinel (errNotHandled) correctly threads fallback logic across the new files. - ✅ Build passes (
go build ./pkg/cli/...) with no behavior regressions observed in the moved code.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 71.6 AIC · ⌖ 14.5 AIC · ⊞ 10K
Comment /matt to run again
| return expandedSpecs, true, nil | ||
| } | ||
|
|
||
| func resolveAddWorkflowSpecAndContent(ctx context.Context, initialSpec *WorkflowSpec, verbose bool) (*WorkflowSpec, *FetchedWorkflow, error) { |
There was a problem hiding this comment.
[/codebase-design] resolveAddWorkflowSpecAndContent (redirect-following) and expandLocalWildcard/expandLocalWildcardWorkflows are two distinct concerns sharing one file named add_workflow_wildcard.go. The name only signals the wildcard-expansion half.
💡 Suggestion
Consider moving resolveAddWorkflowSpecAndContent and checkWorkflowHasDispatchFromContent (redirect-following / fetch logic) into a separate add_workflow_redirect.go, keeping this file focused purely on wildcard glob expansion as the name promises. This keeps the new module boundaries as navigable as the split overall intends.
@copilot please address this.
| return parsedSpecs | ||
| } | ||
|
|
||
| func appendRepositoryPackageWorkflowSpecs(parsedSpecs []*WorkflowSpec, repoSpec *RepoSpec, pkg *resolvedRepositoryPackage) []*WorkflowSpec { |
There was a problem hiding this comment.
[/codebase-design] appendRepositoryPackageWorkflowSpecs and appendRepositoryPackageExtensionSpecs repeat the same RepoSpec{RepoSlug, Version, PackagePath} literal 5 times across this file (and similarly in appendLocalRepositoryPackageWorkflowSpecs). This duplication is a readability/maintenance risk if a new field is added to RepoSpec later.
💡 Suggestion
Factor out a small helper, e.g. func (r *RepoSpec) withVersion(version string) RepoSpec, or build the base RepoSpec once per call and reuse it when constructing each WorkflowSpec. Not blocking, but worth a follow-up cleanup now that the logic has its own file.
@copilot please address this.

pkg/cli/add_workflow_resolution.gohad grown to 1,214 lines and mixed remote resolution, local package handling, asset discovery, and wildcard expansion.