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
4 changes: 4 additions & 0 deletions pkg/cli/actionlint.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ func runActionlintOnFilesWithOptions(ctx context.Context, lockFiles []string, ve
}

func reportActionlintResult(ctx context.Context, err error, output string, parseErr error, hasFindings bool) error {
actionlintLog.Printf("Reporting actionlint result: hasFindings=%t, err=%v, parseErr=%v", hasFindings, err, parseErr)
if hasFindings && parseErr == nil {
findingsErr := withActionlintFindings(err, output)
reportCompileScannerResult(ctx, "actionlint", findingsErr)
Expand Down Expand Up @@ -385,6 +386,7 @@ func runActionlintCommand(ctx context.Context, gitRoot string, lockFiles, relPat
cmd.Stdout = &stdout
cmd.Stderr = &stderr
err := cmd.Run()
actionlintLog.Printf("actionlint command finished: err=%v, ctxErr=%v", err, runCtx.Err())

return actionlintCommandResult{
stdout: stdout.String(),
Expand Down Expand Up @@ -470,10 +472,12 @@ func actionlintContextError(result actionlintCommandResult, lockFiles []string)
if actionlintStats != nil {
actionlintStats.IntegrationErrors++
}
actionlintLog.Printf("actionlint timed out after %s on %d file(s)", result.timeoutDuration, len(lockFiles))
return fmt.Errorf("actionlint timed out after %d minutes on %s - this may indicate a tooling or subprocess issue",
int(result.timeoutDuration.Minutes()), actionlintFileDescription(lockFiles))
}
if errors.Is(result.ctxErr, context.Canceled) {
actionlintLog.Print("actionlint was canceled before completion")
return errors.New("actionlint was canceled before completion (for example by Ctrl+C or caller cancellation)")
}
return nil
Expand Down
3 changes: 3 additions & 0 deletions pkg/cli/add_interactive_orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,11 @@ func (c *AddInteractiveConfig) resolveWorkflows() error {

resolved, err := ResolveWorkflows(c.Ctx, c.WorkflowSpecs, c.Verbose)
if err != nil {
addInteractiveLog.Printf("Failed to resolve workflows: %v", err)
return fmt.Errorf("failed to resolve workflows: %w", err)
}

addInteractiveLog.Printf("Resolved %d workflow(s)", len(resolved.Workflows))
c.resolvedWorkflows = resolved
return nil
}
Expand Down Expand Up @@ -345,6 +347,7 @@ func (c *AddInteractiveConfig) determineFilesToAdd() (workflowFiles []string, in
}
}

addInteractiveLog.Printf("Determined %d workflow file(s) to add", len(workflowFiles))
fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Workflow files ready to add:"))
for _, f := range workflowFiles {
fmt.Fprintf(os.Stderr, " • .github/workflows/%s\n", f)
Expand Down
4 changes: 4 additions & 0 deletions pkg/cli/add_package_manifest_includes.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,12 @@ func parseManifestIncludeMapping(mapping map[string]any, manifestPath string) (r
func cleanManifestRelativePath(p string) (string, error) {
slashed := filepath.ToSlash(p)
if slashed != "" && ((slashed[0] == '/' || slashed[0] == '\\') || filepath.IsAbs(p) || isWindowsDriveRelativePath(slashed)) {
addPackageManifestLog.Printf("Rejecting manifest path %q: absolute paths are not allowed", p)
return "", errors.New("absolute paths are not allowed")
}
cleaned := path.Clean(slashed)
if cleaned == "." || cleaned == ".." || strings.HasPrefix(cleaned, "../") {
addPackageManifestLog.Printf("Rejecting manifest path %q: path traversal outside the root is not allowed", p)
return "", errors.New("path traversal outside the root is not allowed")
}
return cleaned, nil
Expand Down Expand Up @@ -479,12 +481,14 @@ func expandManifestWildcardCandidates(include repositoryPackageInclude, parent s
return nil, err
}
if include.isMapping() {
addPackageManifestLog.Printf("Expanded wildcard %q under %s to %d file match(es)", include.Source, parent, len(expanded))
return expanded, nil
}
dirMatches, err := expandManifestWildcardMatches(include, parent, dirCandidates, isSupportedSkillDirPath)
if err != nil {
return nil, err
}
addPackageManifestLog.Printf("Expanded wildcard %q under %s to %d file match(es), %d dir match(es)", include.Source, parent, len(expanded), len(dirMatches))
return append(expanded, dirMatches...), nil
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/cli/add_package_manifest_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ func populateRepositoryPackageManifestDescription(manifest *repositoryPackageMan
if description, ok := stringValue(root["description"]); ok {
manifest.Description = description
if len(description) > 255 {
addPackageManifestLog.Printf("Manifest %s description is %d characters, exceeding the 255-character marketplace display limit", manifestPath, len(description))
return []string{fmt.Sprintf("Manifest %s description exceeds the 255-character marketplace display limit", manifestPath)}
}
}
Expand Down Expand Up @@ -332,9 +333,11 @@ func validateRepositoryPackageManifestIcon(icon string, resources []repositoryPa

// Look like a path or SVG file but not in resources?
if strings.HasSuffix(strings.ToLower(iconStr), ".svg") || strings.Contains(iconStr, "/") {
addPackageManifestLog.Printf("Rejecting manifest %s icon %q: looks like a resource path but is not declared in resources", manifestPath, iconStr)
return fmt.Errorf("invalid Agentic Workflow manifest %q: icon file %q must be declared in package resources", manifestPath, iconStr)
}

addPackageManifestLog.Printf("Rejecting manifest %s icon %q: does not match any recognized icon format", manifestPath, iconStr)
return fmt.Errorf("invalid Agentic Workflow manifest %q: icon %q is invalid: must be an emoji, a GitHub primer octicon name (e.g. :check-circle:), or an SVG file declared in package resources", manifestPath, iconStr)
}

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 @@ -41,6 +41,7 @@ func parseRepositoryPackageSpec(spec string) (*RepoSpec, bool, error) {
if cleanedPath == "." {
packagePath = ""
} else if cleanedPath == ".." || strings.HasPrefix(cleanedPath, "../") {
addPackageManifestLog.Printf("Rejecting repository package spec %q: package path %q escapes the repository root", spec, packagePath)
return nil, true, fmt.Errorf("invalid repository package path %q: path traversal outside the repository is not allowed. Use a path relative to the repository root. Example: packages/my-package", packagePath)
} else {
packagePath = cleanedPath
Expand Down Expand Up @@ -151,9 +152,11 @@ func resolveRepositoryPackageDefaultBranch(ctx context.Context, repoSlug, host s
// previously resolved package ref when available.
func repositoryPackageEffectiveRef(repoSpec *RepoSpec, pkg *resolvedRepositoryPackage) string {
if repoSpec != nil && repoSpec.Version != "" {
addPackageManifestLog.Printf("Using explicit repository package version %q", repoSpec.Version)
return repoSpec.Version
}
if pkg != nil && pkg.ResolvedRef != "" {
addPackageManifestLog.Printf("Using previously resolved repository package ref %q", pkg.ResolvedRef)
return pkg.ResolvedRef
}
return ""
Expand Down
Loading