Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

YAML unmarshaling failed silently when reviewers was a string instead of array, causing all create-pull-request fields (expires, title-prefix, labels, draft) to be lost from handler config.

Problem

safe-outputs:
  create-pull-request:
    expires: 2d
    title-prefix: "[TEST]"
    reviewers: copilot  # String instead of array
  push-to-pull-request-branch:

Generated handler config:

"create_pull_request": {}  // All fields missing

Root Cause
String-to-array conversion for reviewers happened after YAML unmarshaling. Parser expected []string, got string, failed silently with zero values.

Changes

  • pkg/workflow/create_pull_request.go: Move reviewers string-to-array conversion before unmarshaling
  • pkg/workflow/compiler_safe_outputs_pr_expires_test.go: Add regression test

Impact
Fixed 5 workflows: poem-bot, tidy, q, github-mcp-tools-report, technical-doc-writer

After fix:

"create_pull_request": {
  "expires": 48,
  "title_prefix": "[TEST]",
  "labels": ["test", "automation"],
  "draft": false
}
Original prompt

Review the problem reported in #13285 description and fix it


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@pelikhan
Copy link
Contributor

pelikhan commented Feb 2, 2026

@copilot push-to-pull-request-branch should NOT support expires

Copilot AI and others added 2 commits February 2, 2026 15:08
…reate-pull-request

Root cause: YAML unmarshal error when reviewers field is a string instead of []string
The single string was being converted to array AFTER unmarshaling, causing unmarshal to fail silently

Solution: Pre-convert reviewers string to array BEFORE unmarshaling
This prevents YAML parser errors and allows all fields (expires, title-prefix, labels, etc.) to be correctly unmarshaled

Affected workflows: poem-bot, tidy, q, github-mcp-tools-report, technical-doc-writer
All now correctly include expires field in handler config

Related: #13285

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review February 2, 2026 15:16
Copilot AI changed the title [WIP] Fix issue reported in pull request 13285 Fix YAML unmarshal failure when reviewers is string in create-pull-request Feb 2, 2026
Copilot AI requested a review from pelikhan February 2, 2026 15:18
Copy link
Contributor Author

Copilot AI commented Feb 2, 2026

@copilot push-to-pull-request-branch should NOT support expires

Confirmed - push-to-pull-request-branch does not and should not have expires support.

The fix only affected create-pull-request where the expires field (along with title-prefix, labels, draft) was being lost due to a YAML unmarshal failure when reviewers was specified as a string.

Current implementation:

  • create-pull-request has Expires field in struct and schema
  • push-to-pull-request-branch does NOT have expires field in struct or schema
  • ✅ Handler config builder for push_to_pull_request_branch does NOT include expires

No code changes needed.

@pelikhan pelikhan merged commit 96c3e7c into main Feb 2, 2026
92 checks passed
@pelikhan pelikhan deleted the copilot/fix-reported-issue-13285 branch February 2, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants