Skip to content

Migrate 6 config parsers from unmarshalConfig to parseConfigScaffold#28633

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/migrate-config-parsers-to-parseconfigscaffold
Draft

Migrate 6 config parsers from unmarshalConfig to parseConfigScaffold#28633
Copilot wants to merge 2 commits intomainfrom
copilot/migrate-config-parsers-to-parseconfigscaffold

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 26, 2026

Six safe-output config parsers were using the old manual unmarshalConfig pattern instead of the parseConfigScaffold generic scaffold already adopted by assign_to_agent.go and assign_to_user.go.

Affected handlers

  • parseIssuesConfigcreate_issue.go
  • parseDiscussionsConfigcreate_discussion.go
  • parsePullRequestsConfigcreate_pull_request.go
  • parseCommentsConfigadd_comment.go
  • parseAddReviewerConfigadd_reviewer.go
  • parseCloseEntityConfigclose_entity_helpers.go

Pattern change

// Before
var config CreateIssuesConfig
if err := unmarshalConfig(outputMap, "create-issue", &config, createIssueLog); err != nil {
    createIssueLog.Printf("Failed to unmarshal config: %v", err)
    config = CreateIssuesConfig{}
}
return &config

// After
config := parseConfigScaffold(outputMap, "create-issue", createIssueLog, func(err error) *CreateIssuesConfig {
    createIssueLog.Printf("Failed to unmarshal config: %v", err)
    return &CreateIssuesConfig{}
})
if config == nil {
    return nil
}
return config

All preprocessing steps (preprocessBoolFieldAsString, preprocessIntFieldAsString, etc.) are unchanged and still run before the scaffold call. The redundant explicit "Parsing … configuration" log lines were removed since the scaffold emits them. In close_entity_helpers.go, the "No configuration found for …" log on the absent-key path was also dropped to match the reference style.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw r ode_modules/.bin--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git get .cfg ode_modules/.bin--show-toplevel git (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq [.object.sha, .object.type] | @tsv "prettier" --write '../../../**/*.json' '!../../../pkg/workflow/js/**/*.json' --ignore-path ../.git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv pkg/mod/github.com/stretchr/testify@v1.11.1/require/doc.go pkg/mod/github.com/stretchr/testify@v1.11.1/require/forward_requirements.go cal/bin/node (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv h ../../../.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel x_amd64/vet /usr/bin/git ath ../../../.prtr (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git '**/*.ts' '**/*.git committer.name .cfg git rev-�� --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git se 2263625/b178/vetrev-parse ache/go/1.25.8/x--show-toplevel git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv ./../pkg/workflow/js/**/*.json' --ignore-path .cfg x_amd64/vet user.name (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json 2263625/b030/vet.cfg .cfg (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv --show-toplevel x_amd64/vet /usr/bin/git js/**/*.json' --bash (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv prettier --write /home/REDACTED/.local/bin/node **/*.ts **/*.json --ignore-path node /opt�� run format:pkg-json /home/REDACTED/.dotnet/tools/bash tierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv "prettier" --write '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.prettierignore -tests 2527523/b369/vet.cfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv "prettier" --write '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.pret--log-level=errogit -tests /opt/pipx_bin/sh (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv "prettier" --write '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.prettierignore -tests /home/REDACTED/go/bin/sh (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv .js' --ignore-path .prettierignore --log-level=error 2263625/b080/vet.cfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv "prettier" --write '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.prettierignore -tests 2527523/b123/vet.cfg (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv g_.a r node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv ./../pkg/workflow/js/**/*.json' --ignore-path .cfg x_amd64/compile user.name (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json 2263625/b032/vet.cfg 64/bin/sh (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv */*.ts' '**/*.json' --ignore-path ../../../.prettierignore 2263625/b079/vet.cfg .cfg (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq [.object.sha, .object.type] | @tsv prettier --write /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/.bin/sh **/*.ts **/*.json --ignore-path sh -c npx prettier --write '../../../**/*.json' '!../../../pkg/workflow/js/**/*.json' --ignore-path (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv se 2263625/b061/vet.cfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv --local core.hooksPath h (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq [.object.sha, .object.type] | @tsv --show-toplevel x_amd64/vet /usr/bin/git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv ignore-path ../../../.prettierignore (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq [.object.sha, .object.type] | @tsv ffold (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Migrate 6 config parsers to parseConfigScaffold Migrate 6 config parsers from unmarshalConfig to parseConfigScaffold Apr 26, 2026
Copilot AI requested a review from gh-aw-bot April 26, 2026 21:05
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

Hey @Copilot 👋 — thanks for this refactor to migrate the six config parsers from the manual unmarshalConfig pattern to the parseConfigScaffold generic scaffold! Consistent use of the shared scaffold across all handlers is a great maintainability improvement.

One thing worth noting before this is merged:

  • No test changes included — the diff touches 6 handler files but no corresponding test files are updated. Even for a pure refactor, it's worth verifying (or adding) a test case that exercises the nil return path now introduced via parseConfigScaffold — the pre-existing behaviour on unmarshal failure changed slightly (from returning a zero-value struct to returning nil).

If you'd like help, here's a prompt you can assign to your coding agent:

In the PR "Migrate 6 config parsers from unmarshalConfig to parseConfigScaffold", for each of the six modified handler files, locate its corresponding _test.go file and add or update a test case that:
1. Verifies the parser returns nil when parseConfigScaffold returns nil (key absent from outputMap).
2. Verifies the error-fallback closure returns an empty default config pointer (not nil) when unmarshaling fails.
Use existing test patterns in the package as a guide.

Generated by Contribution Check · ● 925.7K ·

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.

Migrate 6 config parsers from unmarshalConfig to parseConfigScaffold

2 participants