Compile reviewers field into create-pull-request handler config#16122
Merged
Compile reviewers field into create-pull-request handler config#16122
Conversation
- Add reviewers to handler config builder using AddStringSlice() - Add test case to verify reviewers in handler config JSON - Update existing test to include reviewers scenario - All tests passing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix reviewers config not compiled into handler config
Compile reviewers field into create-pull-request handler config
Feb 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a gap in the safe-outputs compiler where safe-outputs.create-pull-request.reviewers was parsed/used for tool description but not included in GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG, preventing handlers (and future enhancements) from accessing reviewers via the unified handler-config path.
Changes:
- Add
reviewersto thecreate_pull_requesthandler config builder (viaAddStringSlice). - Add a new table-driven unit test scenario for create-pull-request with reviewers.
- Add a dedicated unit test validating
reviewersappears in the handler config JSON.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/workflow/compiler_safe_outputs_config.go | Includes reviewers in the generated handler manager config for create_pull_request. |
| pkg/workflow/compiler_safe_outputs_config_test.go | Adds unit coverage for reviewers being present in GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG. |
Comments suppressed due to low confidence (1)
pkg/workflow/compiler_safe_outputs_config_test.go:410
- TestHandlerConfigReviewers can pass without asserting anything if the GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG line isn’t found or if the Split() doesn’t yield 2 parts (the test just falls through). Add a require/assert that the env var line was found and parsed (e.g., track a found flag and fail if it remains false) so this test can’t silently succeed on formatting changes or regressions.
// Extract and validate JSON
for _, step := range steps {
if strings.Contains(step, "GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG") {
parts := strings.Split(step, "GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: ")
if len(parts) == 2 {
jsonStr := strings.TrimSpace(parts[1])
jsonStr = strings.Trim(jsonStr, "\"")
jsonStr = strings.ReplaceAll(jsonStr, "\\\"", "\"")
var config map[string]map[string]any
err := json.Unmarshal([]byte(jsonStr), &config)
require.NoError(t, err, "Handler config JSON should be valid")
prConfig, ok := config["create_pull_request"]
require.True(t, ok, "Should have create_pull_request handler")
reviewers, ok := prConfig["reviewers"]
require.True(t, ok, "Should have reviewers field")
reviewerSlice, ok := reviewers.([]any)
require.True(t, ok, "Reviewers should be an array")
assert.Len(t, reviewerSlice, 3, "Should have 3 reviewers")
assert.Equal(t, "user1", reviewerSlice[0])
assert.Equal(t, "user2", reviewerSlice[1])
assert.Equal(t, "copilot", reviewerSlice[2])
}
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pelikhan
approved these changes
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
reviewersfield undersafe-outputs.create-pull-requestwas parsed from frontmatter and included in MCP tool descriptions, but never passed toGH_AW_SAFE_OUTPUTS_HANDLER_CONFIG.Changes
reviewersto the builder chain incompiler_safe_outputs_config.gousingAddStringSlice()(same pattern aslabels)TestHandlerConfigReviewersand table-driven test case to verify reviewers compile into handler config JSONExample
Frontmatter:
Before:
{ "create_pull_request": { "labels": ["automated"], "max": 1 } }After:
{ "create_pull_request": { "reviewers": ["alice", "bob"], "labels": ["automated"], "max": 1 } }The handler config now matches what the tool description advertises. Reviewers are assigned via post-steps using gh CLI; this change makes the configuration available for potential future handler enhancements.
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/usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name x_amd64/link g mpt_step_helper.rev-parse rep x_amd64/link -l PostSteps.*string pkg/workflow/gh_cli_mount_test.g-c=4 ode g ing.go cal/bin/grep bR/LHCTN74xI8q78test@example.com(http block)/usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name tions/setup/js/node_modules/.bin-lang=go1.25 g _generation.go rep grep -l 903831579/.github/workflows pkg/workflow/package_extraction_-nolocalimports nfig/composer/vendor/bin/git g(http block)/usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name bin/sh g _default_test.gorev-parse(http block)https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1/usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --write scripts/**/*.js ache/node/24.13.0/x64/bin/node .prettierignore p_types_test.go grep tail t-33�� sistency_GoAndJavaScript1035568869/001/test-comptest-logs/run-2 grep /tmp/go-build4018436941/b392/logger.test g afety_test.go ep /tmp/go-build4018436941/b392/logger.test(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v3/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha 3331577525 grep .cfg g or_tools_test.gorev-parse /home/REDACTED/.lo--show-toplevel git comm�� rite '../../../**/*.json' '!../../../pkg/workflo-s Add reviewers field to create-pull-request handl-w ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet g est.go ep ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha 8436941/b397/_pkg_.a grep ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile g b/gh-aw/pkg/mathrev-parse ache/node/24.13.--show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile -c 8436941/b401/_pkg_.a grep 8436941/b401=> ettierignore b/gh-aw/pkg/parsrev-parse tnet/tools/grep 8436941/b397/importcfg(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha --noprofile grep /opt/hostedtoolcache/go/1.25.0/x64/bin/sh g _token_test.go grep sh -c "prettier" --write 'scripts/**/*.js' --ignore-path .prettierigno-test.timeout=10m0s grep /node_modules/.bin/node g kdown_code_regiorev-parse /usr/local/sbin/--show-toplevel node(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha user.email test@example.com 8436941/b426/scripts.test g t.go /usr/local/sbin/--show-toplevel 8436941/b426/scripts.test e=/t�� t0 grep(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v5/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha celain --ignore-submodules | head -n 10 pkg/workflow/claude_engine_test.go x_amd64/vet g tegration_test.grun grep x_amd64/vet -l PostSteps.*strintest-logs/run-4 pkg/workflow/compile_outputs_label_test.go hutil.test g n_test.go ode-gyp-bin/sh hutil.test(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha : ${{ github.repository }} grep /usr/bin/git g s.go /snap/bin/grep git rev-�� --show-toplevel grep ache/node/24.13.0/x64/bin/node g ch_test.go rgo/bin/grep git(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha user.email test@example.com /usr/bin/git -c=4 -nolocalimports -importcfg git conf�� tup/sh/sanitize_path.sh' ':::/usr/bin:/usr/local/bin' && echo "$PATH" remote.origin.url /usr/bin/git th .prettierignogit _helpers_test.gorev-parse /opt/pipx_bin/gr--show-toplevel /usr/bin/git(http block)https://api.github.com/repos/actions/github-script/git/ref/tags/v8/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha l % st.go /usr/local/.ghcu--ignore-path g(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha go1.25.0 -c=4 -nolocalimports -importcfg /tmp/go-build4018436941/b383/importcfg -pack /tmp/go-build4018436941/b383/_testmain.go er d -n 10 go /sh g bels_test.go 64/bin/grep grep(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha ath ../../../.pr--ignore-path ckout_runtime_or.prettierignore k/_temp/ghcca-node/node/bin/grep g go grep acBMv-3pd88c -l g go grep g mand.go /usr/local/sbin/-test.paniconexit0 grep(http block)https://api.github.com/repos/actions/setup-go/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --noprofile grep /home/REDACTED/node_modules/.bin/sh g _token_test.go 64/bin/grep sh -c "prettier" --write 'scripts/**/*.js' --ignore-path .prettierignore l /home/REDACTED/work/gh-aw/gh-aw/node_modules/.bin/node ettierignore kdown_code_regiorev-parse /opt/pipx_bin/gr--show-toplevel node(http block)https://api.github.com/repos/actions/setup-node/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --noprofile stmain.go 0/x64/bin/node g _token_test.go /usr/local/sbin/--show-toplevel sh t-ha�� ithub/workflows/ai-moderator.md grep /home/REDACTED/work/gh-aw/gh-aw/actions/setup/node_modules/.bin/no-nilfunc ettierignore der_test.go rep node(http block)https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts/usr/bin/gh gh run download 1 --dir test-logs/run-1 pile_outputs_label_test.go ash g _warning_test.go/tmp/js-hash-test-2529214586/test-hash.js rep grep -l '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json pkg/workflow/skip_bots_test.go 0/x64/bin/node g _test.go cal/bin/grep grep(http block)https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifactsOriginal prompt
💡 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.