Repository navigation
Fix required-labels parsing for reply-to-pr-review-comment and resolve-pr-review-thread - #62667
Conversation
…e-pr-review-thread Co-authored-by: pelikhan <[email protected]>
|
@copilot update safe output specs and tests, add compiled workflow integration tests |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Tests do not verify generated handler configuration or runtime enforcement of this security-sensitive filter.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Fixes label-filter parsing for two pull-request review safe outputs.
Changes:
- Parses shared filter configuration for reply and resolve operations.
- Adds parser-level tests for required labels.
| File | Description |
|---|---|
pkg/workflow/resolve_pr_review_thread.go |
Parses review-thread filters. |
pkg/workflow/reply_to_pr_review_comment.go |
Parses review-comment filters. |
pkg/workflow/reply_resolve_required_labels_test.go |
Tests required-label parsing. |
| t.Fatal("Expected reply-to-pull-request-review-comment configuration to be parsed") | ||
| } | ||
|
|
||
| requiredLabels := workflowData.SafeOutputs.ReplyToPullRequestReviewComment.RequiredLabels |
There was a problem hiding this comment.
Addressed in 091ce5b. Both handlers now have runtime tests that pass required_labels with a missing label and verify the reply/resolve API mutation is not called; the compiled handler config coverage remains in reply_resolve_required_labels_test.go.
|
Warning Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs for details.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "ab.chatgpt.com"See Network Configuration for more information.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.
|
…eply/resolve safe outputs Co-authored-by: pelikhan <[email protected]>
|
Warning Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs for details. Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment.
|
Updated in 6cf1c1... (latest commit): added |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs — the fix itself is correct and minimal (matches the existing ParseFilterConfig pattern used by dismiss_pull_request_review.go, update_pull_request.go, and mark_pull_request_as_ready_for_review.go), and I confirmed the handler-registry codegen (safe_outputs_handler_registry_pull_requests.go lines 180 and 214) already reads c.RequiredLabels for both resolve_pull_request_review_thread and reply_to_pull_request_review_comment, so this two-line change genuinely closes the bug described in #62663.
📋 Key Themes & Highlights
Key Themes
- Root cause correctly addressed: the parsers now call
ParseFilterConfig(configMap), consistent with the established pattern for filterable safe-outputs. - Regression tests added, but shallow: both new tests (
TestReplyToPullRequestReviewCommentRequiredLabels,TestResolvePullRequestReviewThreadRequiredLabels) stop at asserting the parsed Go struct field. They don't exercisecompiler.CompileWorkflow+ inspect the generated.lock.yml, which is the convention used elsewhere (e.g.TestPushToPullRequestBranchConfigParsing) and is what would actually catch a regression if the handler-registry wiring ever broke. One instance of this gap was already flagged by an existing review comment on line 57; I added a matching comment on the sibling test at line 111.
Positive Highlights
- ✅ Fix is surgical and follows existing conventions exactly — no unnecessary abstraction introduced.
- ✅ Both affected safe-output types are covered with a test, even if the assertion depth could be improved.
Not blocking, since the underlying fix is verified correct against the actual codegen path, but recommend strengthening the two new tests to assert against the compiled lock file before merge.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 28.5 AIC · ⌖ 14.5 AIC · ⊞ 10.1K
Comment /matt to run again
| t.Fatal("Expected resolve-pull-request-review-thread configuration to be parsed") | ||
| } | ||
|
|
||
| requiredLabels := workflowData.SafeOutputs.ResolvePullRequestReviewThread.RequiredLabels |
There was a problem hiding this comment.
[/diagnosing-bugs] Same gap as the sibling test above: this only asserts the parsed Go struct, not that required-labels survives the full compile pipeline into the generated .lock.yml handler config — which is the actual symptom described in #62663 (the value "silently disappeared before reaching the runtime handlers").
💡 Suggested end-to-end assertion
Follow the pattern used in push_to_pull_request_branch_test.go (TestPushToPullRequestBranchConfigParsing): call compiler.CompileWorkflow(mdFile), read the generated .lock.yml, and grep the safe_outputs/handler-registry section for required_labels: [automation, my-workflow] (or the equivalent JS handler config literal). That closes the loop from YAML frontmatter all the way to the artifact the runtime actually consumes, matching how regressions like this are normally caught.
if err := compiler.CompileWorkflow(mdFile); err != nil {
t.Fatalf("Failed to compile workflow: %v", err)
}
lockFile := stringutil.MarkdownToLockFile(mdFile)
lockContent, _ := os.ReadFile(lockFile)
if !strings.Contains(string(lockContent), "required_labels") {
t.Fatalf("expected required_labels to appear in generated lock file")
}@copilot please address this.
There was a problem hiding this comment.
Addressed by the compiled-workflow tests in reply_resolve_required_labels_test.go, which compile both safe-output types and assert required_labels and required_title_prefix reach the generated handler config. Runtime enforcement coverage was added in 091ce5b.
🏗️ ADR required — draft added for PR #62667ResultA draft ADR has been added to this PR because ADR enforcement is required and no existing ADR covering this decision was found. Evidence used
Draft ADR added
Next actionPlease review and refine the draft ADR so it accurately reflects the intended long-term architectural decision before merge.
|
There was a problem hiding this comment.
Impeccable Review — refactor_cleanup
Small, focused fix. Reviewed with harden/audit lenses (bug-fix scope).
Assessment: ✅ No blocking issues.
- Both
parseReplyToPullRequestReviewCommentConfigandparseResolvePullRequestReviewThreadConfignow callParseFilterConfig(configMap), correctly mirroring the pattern already used bypush-to-pull-request-branch,create-pull-request-review-comment, and other filterable safe-outputs. - Confirmed the handler-registry codegen (
safe_outputs_handler_registry_pull_requests.go) already readsc.RequiredLabels/c.RequiredTitlePrefixfor both output types, so this change closes the actual gap end-to-end (config → registry → runtime handler). - Build (
go build ./...) and the two new tests (TestReplyToPullRequestReviewCommentRequiredLabels,TestResolvePullRequestReviewThreadRequiredLabels) pass. - New tests stop at the parsed Go struct level (don't assert on the compiled
.lock.yml/handler config), matching the existing convention inpush_to_pull_request_branch_test.go(TestPushToPullRequestBranchWithRequiredLabels) — consistent with repo precedent, not a regression.
No further action requested.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 29.4 AIC · ⌖ 13.1 AIC · ⊞ 8.1K
|
@copilot run pr-finisher skill |
Co-authored-by: pelikhan <[email protected]>
|
The remaining review thread is still open on the current head:
Please complete the end-to-end coverage requested there, push the follow-up changes, and then run the Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "github.com"See Network Configuration for more information.
|
PR finisher completed. Added runtime missing-label enforcement tests in 091ce5b, replied to both review threads, merged current |
|
🎉 This pull request is included in a new release. Release: |

required-labelscompiled without warnings forreply-to-pull-request-review-commentandresolve-pull-request-review-threadbut was never enforced — the parsers for these two safe-outputs never read the field intoconfig.RequiredLabels, so the value silently disappeared before reaching the runtime handlers or the handler-registry codegen that was already wired to consume it.Changes
reply_to_pr_review_comment.go:parseReplyToPullRequestReviewCommentConfignow callsParseFilterConfig(configMap)to populateSafeOutputFilterConfig(RequiredLabels,RequiredTitlePrefix), matching the pattern used bypush-to-pull-request-branchand other filterable safe-outputs.resolve_pr_review_thread.go:parseResolvePullRequestReviewThreadConfiggets the sameParseFilterConfigcall.reply_resolve_required_labels_test.goassertingrequired-labelsin source YAML shows up in the compiled config'sRequiredLabelsfield for both types.No changes were needed downstream — the handler-registry codegen and runtime
.cjshandlers already readrequired_labels/RequiredLabelscorrectly; only the parsing step was missing.Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
github.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.