Repository navigation
Add label-scoped title deduplication for create-issue - #74941
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Reviewed the label-scoped title deduplication change. One medium issue found: whitespace-only filter labels can disable repository-level deduplication without warning. Other specialist candidates were not actionable or were contradicted by the documented independent semantics of creation labels and search filters.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
There was a problem hiding this comment.
🟡 Changes recommended
Untrusted issue-title interpolation in filter labels allows JSON injection that can override target-repo and disclose generated content to an attacker-controlled repository when the token has access.
1 open issue
What changed in this PR
Adds label-scoped title deduplication to create-issue, addressing #73008 by narrowing candidate searches without changing creation labels or title matching.
Changes:
- Adds
deduplicate-by-title-labelsto the schema, compiler configuration, and runtime types. - Applies all configured labels to both open and recently closed issue searches.
- Adds parsing, compilation, and runtime tests, plus reference documentation.
| File | Description |
|---|---|
pkg/workflow/safe_outputs_handler_registry_issues.go |
Passes filter labels to the runtime handler. |
pkg/workflow/create_issue.go |
Adds the Go configuration field. |
pkg/workflow/compile_outputs_issue_test.go |
Tests parsing and generated handler configuration. |
pkg/parser/schemas/main_workflow_schema.json |
Defines the optional label-filter array. |
docs/src/content/docs/reference/safe-outputs.md |
Explains filtering semantics and provides an example. |
docs/src/content/docs/reference/frontmatter-full.md |
Adds the option to the full reference. |
actions/setup/js/types/safe-outputs-config.d.ts |
Declares the configuration type. |
actions/setup/js/create_issue.test.cjs |
Tests filtering, quoting, and compatibility behavior. |
actions/setup/js/create_issue.cjs |
Adds label qualifiers to both candidate searches. |
Review effort: Balanced (auto)
| AddTemplatableBool("staged", templatableBoolPtrToStringPtr(c.Staged)). | ||
| AddTemplatableBoolOrInt("deduplicate_by_title", c.DeduplicateByTitle) | ||
| AddTemplatableBoolOrInt("deduplicate_by_title", c.DeduplicateByTitle). | ||
| AddStringSlice("deduplicate_by_title_labels", c.DeduplicateByTitleLabels) |
There was a problem hiding this comment.
Addressed in 5b1bbd1: the schema rejects ${{ expressions in deduplicate-by-labels items at compile time, and the compiler tests cover both exact and embedded expressions. This prevents untrusted event values from reaching the handler JSON.
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd and /grill-with-docs. No blocking defects found. Four suggestions are inline, mostly around test strength and one behavioral gap.
📋 Key Themes & Highlights
Key Themes
- Test strength: The label-quoting and AND-filter tests assert query strings only. A loop with no search calls would pass silently, so add a call-count guard.
- Silent no-op risk: A label listed in
deduplicate-by-title-labelsbut absent fromlabelsmeans the bot-created issues never match, so dedup does nothing for them. Consider a compile-time warning and a docs note. - Escaping assumption: The backslash and quote escaping is verified as a string transform only. Confirm it against GitHub search behavior.
Positive Highlights
- ✅ Omitted or empty filters keep the old unfiltered queries. The test covers both
undefinedand[]. - ✅ The 30-day closed window and repo boundary are preserved.
- ✅ The
config.deduplicate_by_title_labels ?? []fallback and theAddStringSlicebuilder skip empty lists, so no stray config key is emitted. - ✅ Go tests for config parsing and handler generation pass, and
gofmtis clean.
Validation Notes
go test ./pkg/workflow(targeted) passes.- The JS suite could not run here: the npm registry rejected the TLS certificate, so
vitestis unavailable. Syntax checks pass. Please confirmcreate_issue.test.cjsin CI. - Skill selection used the
pr-triageoutput directly, not the fallback heuristic.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again
|
|
||
| await handler({ title: "New title" }); | ||
|
|
||
| for (const [request] of mockGithub.rest.search.issuesAndPullRequests.mock.calls) { |
There was a problem hiding this comment.
[/tdd] This loop passes trivially if no search call is made, so it would not catch a regression that drops the label qualifiers entirely. Assert the expected call count before the loop.
💡 Suggested change
expect(mockGithub.rest.search.issuesAndPullRequests).toHaveBeenCalledTimes(2);The count check makes the loop a meaningful guard.
@copilot please address this.
There was a problem hiding this comment.
Added an explicit two-search-call assertion before the qualifier loop in 5b1bbd1, so the test cannot pass without executing the searches.
| expect(queries).toEqual(["repo:test-owner/test-repo is:issue is:open", expect.stringMatching(/^repo:test-owner\/test-repo is:issue is:closed closed:>=\d{4}-\d{2}-\d{2}$/)]); | ||
| }); | ||
|
|
||
| it.each(["open", "closed"])("should require all filter labels when searching %s issues", async state => { |
There was a problem hiding this comment.
[/tdd] The test name says it requires all filter labels, but the assertions only inspect query strings and never check AND matching. Rename it to describe what is asserted, for example: should append all filter labels to %s searches.
@copilot please address this.
There was a problem hiding this comment.
Renamed the query test to describe appending all filter labels in 5b1bbd1. Added behavioral AND-filter cases for both apply-time and MCP within-run deduplication.
| DeduplicateByTitle *TemplatableBoolOrInt `yaml:"deduplicate-by-title,omitempty"` // When true or 0, deduplicate by exact title match. When set to a positive integer N, also allow fuzzy matches up to edit distance N. When false or omitted, disable title-based deduplication. Accepts GitHub Actions expressions. | ||
| TargetRepoSlug string `yaml:"target-repo,omitempty"` // Target repository in format "owner/repo" for cross-repository issues | ||
| AllowedRepos []string `yaml:"allowed-repos,omitempty"` // List of additional repositories that issues can be created in | ||
| DeduplicateByTitleLabels []string `yaml:"deduplicate-by-title-labels,omitempty"` |
There was a problem hiding this comment.
[/grill-with-docs] Dedup labels are independent of creation labels, so a listed label missing from labels never appears on the issues this workflow creates. Those issues cannot match unless someone adds the label later, and dedup silently does nothing for them.
💡 Suggested change
Emit a compile-time warning when a deduplicate-by-title-labels entry is absent from labels. Also note the constraint in the safe-outputs reference, since the example already uses matching lists.
@copilot please address this.
There was a problem hiding this comment.
Documented that filter labels must be included in creation labels or supplied by the tool call for newly created issues to match future searches (5b1bbd1). Kept these settings independent; a compile-time warning based only on default labels would also flag valid tool-supplied labels.
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: 6b92ad8
|
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: 6b92ad8
|
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: 6b92ad8
|
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: 6b92ad8
|
|
@copilot rename deduplicate-by-title-labels to deduplicate-by-labels and have both feature act as AND filters |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in 5b1bbd1. Renamed the option to |
|
@copilot run pr-finisher skill |
…qualifiers Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: 5ef955a
|
…qualifiers Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Ran pr-finisher. Published the main merge (d589f23) and CI regression fix (477418c); all 3,901 tests in the previously failing shard pass locally. Remaining blockers: a pre-existing custom-linter error, CodeQL timeout, unresolved-but-answered review threads that available tools cannot resolve, and CI verification on the new HEAD. No PR merge or CI dispatch performed.
Merged latest main in d589f23 and fixed the stale timeout assertions in 477418c. The previously failing shard passes locally: 91 files, 3,901 tests. No CI was triggered and the PR was not merged. The final gate passes tests but hits a pre-existing custom-linter error at Sous-chef requested-head: 5ef955a |
|
@copilot enable this flag on a few AWs |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot resolve the merge conflicts in this pull request |
|
This PR has conflicts and a failing check that need your attention: Failing Checks
Branch StatusYour branch is CONFLICTING with main. Please update it: Sous-chef requested-state: 2a040bda5e5692f72b9582e6c8126a6547b82d712f4d061c66624ff7112db7b8
|
…qualifiers # Conflicts: # .github/workflows/daily-squid-image-scan.lock.yml # .github/workflows/daily-windows-defender-scan.lock.yml # .github/workflows/deep-report.lock.yml Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Merged latest main and regenerated the three conflicted workflow locks in 28f9416, preserving the feature and workflow opt-ins. All 357 workflows compile; focused Go deduplication tests and 558 impacted JS tests pass. The failing copilot job stopped on a backend HTTP 500 fetching job details, before repository work. No code fix or retry was needed. Final validation remains blocked by the pre-existing custom-linter finding at pkg/workflow/safe_outputs_handler_registry_issues.go:202; CodeQL timed out reading the merge diff. No PR merge or CI dispatch performed. Sous-chef requested-state: 2a040bda5e5692f72b9582e6c8126a6547b82d712f4d061c66624ff7112db7b8 |
|
🎉 This pull request is included in a new release. Release: |

Title deduplication searches all repository issues, regardless of creation labels. Broad, capped searches can miss matching titles outside the fetched pages.
deduplicate-by-title-labels, requiring all listed labels (AND) in both open and recently closed candidate searches.