Skip to content

[task] Improve runtime setup error message context #4091

Description

@github-actions

Objective

Enhance error messages in pkg/workflow/runtime_setup.go to provide better context and actionable guidance. Currently, the file contains generic "failed to" error messages that wrap underlying errors without sufficient context.

Context

Related to #4085 - Repository Quality Improvement Report on Workflow Compilation Error Messages.

Runtime setup errors impact users working with custom workflow steps. Better error messages will help users debug configuration issues more efficiently.

Approach

Update error messages to provide better context for wrapped errors:

  1. "failed to parse custom steps" → Explain what custom steps are and show example
  2. "failed to marshal deduplicated steps" → Explain deduplication and its purpose
  3. Add context about which part of runtime setup failed
  4. Provide examples of valid runtime configurations

Even for wrapped errors, add meaningful context about what was being attempted and why it matters.

Files to Modify

  • Update: pkg/workflow/runtime_setup.go
  • Update: pkg/workflow/runtime_setup_test.go (add error message tests)

Example Transformations

Before:

fmt.Errorf("failed to parse: %w", err)

After:

fmt.Errorf("failed to parse custom workflow steps from frontmatter. Custom steps must be valid GitHub Actions step syntax. Example:\nsteps:\n  - name: Setup\n    run: echo 'hello'\nError: %w", err)

Before:

fmt.Errorf("failed to marshal: %w", err)

After:

fmt.Errorf("failed to marshal deduplicated workflow steps. Step deduplication removes duplicate step definitions to optimize workflow size. Error: %w", err)

Acceptance Criteria

  • Wrapped errors include context about what operation was being attempted
  • Error messages explain the impact or purpose of the failed operation
  • Suggestions for resolution are provided where applicable
  • Examples of valid configurations included for parsing errors
  • Tests verify error messages contain explanatory context

Priority

Medium - Improves debugging experience for users with custom workflow steps.
Related to #4085

AI generated by Plan Command for discussion #4085

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions