Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/cli/add_package_manifest_includes.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func extractManifestIncludes(value any, manifestPath string) ([]repositoryPackag
seen[include] = struct{}{}
normalized = append(normalized, include)
}
addPackageManifestLog.Printf("Extracted %d includes entries from %s (%d warnings)", len(normalized), manifestPath, len(warnings))
return normalized, warnings, nil
}

Expand Down Expand Up @@ -299,6 +300,7 @@ func extractManifestSkillDirs(value any, manifestPath string) ([]string, []strin
seen[dir] = struct{}{}
normalized = append(normalized, dir)
}
addPackageManifestLog.Printf("Extracted %d skill directories from %s (%d warnings)", len(normalized), manifestPath, len(warnings))
return normalized, warnings
}

Expand Down Expand Up @@ -434,6 +436,7 @@ func normalizePackageInstallablePaths(includes []repositoryPackageInclude, packa
DestinationPath: destination,
})
}
addPackageManifestLog.Printf("Normalized %d package installable paths (package path=%q)", len(normalized), packagePath)
return normalized
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/cli/add_package_manifest_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ type repositoryPackageManifest struct {
}

func parseRepositoryPackageManifest(manifestPath string, content []byte) (*repositoryPackageManifest, []string, error) {
addPackageManifestLog.Printf("Parsing package manifest %s (%d bytes)", manifestPath, len(content))

root, name, err := parseRepositoryPackageManifestRoot(manifestPath, content)
if err != nil {
return nil, nil, err
Expand Down Expand Up @@ -101,6 +103,7 @@ func populateRepositoryPackageManifestVersions(manifest *repositoryPackageManife
}
currentVersion = semverutil.NormalizeGitDescribeSemver(currentVersion)
if semverutil.Compare(currentVersion, manifest.MinVersion) < 0 {
addPackageManifestLog.Printf("Manifest min-version %s exceeds current gh-aw version %s", manifest.MinVersion, currentVersion)
return fmt.Errorf("invalid Agentic Workflow manifest %q: min-version %q requires gh-aw %s or newer (current: %s). Upgrade gh-aw, or lower min-version in aw.yml to a version at or below the current one. Example:\nmin-version: %s", manifestPath, manifest.MinVersion, manifest.MinVersion, currentVersion, currentVersion)
}
}
Expand Down Expand Up @@ -203,6 +206,7 @@ func validateManifestInstallableWorkflowPrivacy(manifestPath string, installatio

privateValue, hasPrivate := ExtractWorkflowPrivateSetting(string(content))
if hasPrivate && privateValue {
addPackageManifestLog.Printf("Rejecting manifest %s: installable workflow %s sets private: true", manifestPath, installationSource)
return fmt.Errorf("invalid Agentic Workflow manifest %q: workflow %q sets private: true and cannot be included because private workflows cannot be added. Remove 'private: true' from the workflow frontmatter or exclude it from the manifest. Example:\n---\nprivate: false\n---", manifestPath, installationSource)
}
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/cli/add_package_manifest_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func parseRepositoryPackageSpec(spec string) (*RepoSpec, bool, error) {
repoSpec.Version = parts[1]
}

addPackageManifestLog.Printf("Parsed repository package spec %q as repo=%s path=%q version=%q", spec, repoSpec.RepoSlug, repoSpec.PackagePath, repoSpec.Version)
return repoSpec, true, nil
}

Expand Down Expand Up @@ -134,6 +135,7 @@ func resolveRepositoryPackageDefaultBranch(ctx context.Context, repoSlug, host s
}
return "", fmt.Errorf("repository %s on %s returned an empty default branch. Ensure the repository exists and is accessible", repoSlug, targetHost)
}
addPackageManifestLog.Printf("Resolved default branch for %s: %s", repoSlug, branch)
return branch, nil
}

Expand Down Expand Up @@ -163,6 +165,7 @@ func isGhAwRepository(repoSlug string) bool {
// hostname (for example "github.com" or a GHES host); when provided, gh API
// calls are executed against that host.
func resolveRepositoryPackageLatestRelease(ctx context.Context, repoSlug, host string) (string, error) {
addPackageManifestLog.Printf("Resolving latest release for %s (host=%q)", repoSlug, host)
deps := workflowUpdateDeps{
runReleasesAPI: func(innerCtx context.Context, repo string) ([]byte, error) {
args := []string{"api", fmt.Sprintf("/repos/%s/releases", repo), "--jq", ".[].tag_name"}
Expand Down
2 changes: 2 additions & 0 deletions pkg/cli/add_package_manifest_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func extractManifestResources(value any, manifestPath string) ([]repositoryPacka
seenDestinations[key] = resource.Source
resources = append(resources, resource)
}
addPackageManifestLog.Printf("Extracted %d resources entries from %s", len(resources), manifestPath)
return resources, nil
}

Expand Down Expand Up @@ -109,6 +110,7 @@ func normalizeLocalPackageResourcePaths(resources []repositoryPackageResource, p
for _, resource := range resources {
absolutePath := filepath.Clean(filepath.Join(packageDir, filepath.FromSlash(resource.Source)))
if err := validateLocalPackageMappingSource(absolutePath, packageDir, resource.Source); err != nil {
addPackageManifestLog.Printf("Rejecting local resource source %q outside package dir %q: %v", resource.Source, packageDir, err)
return nil, err
}
normalized = append(normalized, resolvedPackageResource{
Expand Down
4 changes: 4 additions & 0 deletions pkg/cli/add_package_manifest_skills.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
// contain a SKILL.md file but are not already covered by the manifest. Each skill folder
// is traversed recursively so that all nested files are included.
func resolvePackageSkillFiles(ctx context.Context, owner, repo, packagePath, ref, host string, explicitSkillDirs []string) ([]resolvedPackageSkillFile, []string, error) {
addPackageManifestLog.Printf("Resolving skill files for %s/%s (path=%q, ref=%s, %d explicit dirs)", owner, repo, packagePath, ref, len(explicitSkillDirs))

// Step 1: resolve manifest skills first (explicit dirs).
manifestSkillDirs := normalizeManifestSkillDirs(explicitSkillDirs, packagePath)
skillDirs, warnings, err := resolvePackageSkillDirs(ctx, owner, repo, packagePath, ref, host, manifestSkillDirs)
Expand Down Expand Up @@ -61,6 +63,7 @@ func resolvePackageSkillDirs(ctx context.Context, owner, repo, packagePath, ref,
if len(manifestSkillDirs) == 0 {
return nil, nil, err
}
addPackageManifestLog.Printf("Skills auto-scan failed, proceeding with %d manifest-declared dirs only: %v", len(manifestSkillDirs), err)
warnings = append(warnings, fmt.Sprintf("failed to auto-scan skills directory, proceeding with manifest skills only: %v", err))
}

Expand Down Expand Up @@ -164,6 +167,7 @@ func scanPackageSkillDirs(ctx context.Context, owner, repo, packagePath, ref, ho
}
}
}
addPackageManifestLog.Printf("Auto-scan found %d skill directories under %s/%s (path=%q)", len(skillDirs), owner, repo, packagePath)
return skillDirs, nil
}

Expand Down
Loading