Skip to content

fix: remove label filter from issue dedup query#1180

Merged
Hweinstock merged 1 commit intoaws:mainfrom
Hweinstock:fix-dedup-label-filter
May 7, 2026
Merged

fix: remove label filter from issue dedup query#1180
Hweinstock merged 1 commit intoaws:mainfrom
Hweinstock:fix-dedup-label-filter

Conversation

@Hweinstock
Copy link
Copy Markdown
Contributor

@Hweinstock Hweinstock commented May 7, 2026

Description

The dedup logic in ci-failure-issue.yml filtered by labels (high-severity,ci) when checking for existing issues via listForRepo. If the token creating the issue does not have permission to apply labels, the issue is created without labels. On subsequent runs, the dedup query cannot find it (because it filters on labels that were never applied), causing duplicate issues.

This PR removes the labels parameter from the listForRepo call so dedup relies solely on title matching.

Related Issue

N/A — discovered during CI workflow re-runs.

Documentation PR

N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

Re-run the CI failure workflow and verify it does not create a duplicate issue when one already exists (regardless of whether labels were applied).

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

No source code changes — workflow-only fix. No unit/integ tests apply.

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

@github-actions github-actions Bot added size/xs PR size: XS agentcore-harness-reviewing AgentCore Harness review in progress labels May 7, 2026
Copy link
Copy Markdown

@agentcore-cli-automation agentcore-cli-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix — the root cause analysis is correct. I have one concern about the new dedup query that I think should be addressed before merging.

The repo currently has ~85 open issues and ~44 open PRs (≈129 total). Since listForRepo returns issues and PRs (PRs count as issues in this endpoint) and this call fetches only the first page with per_page: 100, the CI failure issue being deduped against will fall off the page as soon as there are >100 newer open issues/PRs. The previous labels: 'high-severity,ci' filter kept the result set small enough that a single page was always sufficient; removing it makes the existing single-page limitation a real correctness problem right now, not a theoretical one.

See the inline comment for options.

Comment thread .github/workflows/ci-failure-issue.yml Outdated
@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label May 7, 2026
@Hweinstock Hweinstock force-pushed the fix-dedup-label-filter branch from f7e45c1 to 2ec1065 Compare May 7, 2026 22:49
@github-actions github-actions Bot added size/xs PR size: XS and removed size/xs PR size: XS labels May 7, 2026
@Hweinstock Hweinstock closed this May 7, 2026
@Hweinstock Hweinstock reopened this May 7, 2026
@github-actions github-actions Bot added size/xs PR size: XS agentcore-harness-reviewing AgentCore Harness review in progress and removed size/xs PR size: XS labels May 7, 2026
Copy link
Copy Markdown

@agentcore-cli-automation agentcore-cli-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The switch to the search API addresses the >100-issues pagination concern from my previous review — thanks for iterating on this.

I have one remaining concern: the GitHub search API has a well-known indexing delay (typically seconds to a minute or more) between when an issue is created and when it becomes findable via search. This reintroduces a duplicate-issue risk that the previous listForRepo approach did not have, because listForRepo reads from the primary datastore and reflects newly-created issues immediately.

See inline comment for details and a couple of options.

Comment thread .github/workflows/ci-failure-issue.yml
@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label May 7, 2026
@Hweinstock Hweinstock force-pushed the fix-dedup-label-filter branch from 2ec1065 to ee8c7b6 Compare May 7, 2026 22:55
@github-actions github-actions Bot added size/s PR size: S and removed size/xs PR size: XS labels May 7, 2026
@Hweinstock Hweinstock closed this May 7, 2026
@Hweinstock Hweinstock reopened this May 7, 2026
@github-actions github-actions Bot added size/s PR size: S agentcore-harness-reviewing AgentCore Harness review in progress and removed size/s PR size: S labels May 7, 2026
Copy link
Copy Markdown

@agentcore-cli-automation agentcore-cli-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hybrid approach addresses both previous concerns cleanly:

  • The search API handles the general case efficiently regardless of repo size, solving the >100 issues/PRs pagination problem from the first review.
  • The listForRepo fallback sorted by created desc with per_page: 30 covers the search-indexing-delay race window from the second review — a freshly-created issue will be at the top of the recently-created list, well within 30 items even accounting for concurrent PR activity.

The exact-title check i.title === title on both paths correctly compensates for the substring behavior of search's in:title and also makes the fallback robust against PRs with similar titles (since listForRepo returns both issues and PRs).

workflowName is validated against /^[A-Za-z0-9 _()\-]+$/ before being interpolated into the search query, so no injection concern.

LGTM.

@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label May 7, 2026
@Hweinstock Hweinstock marked this pull request as ready for review May 7, 2026 23:01
@Hweinstock Hweinstock requested a review from a team May 7, 2026 23:01
@Hweinstock Hweinstock merged commit e247d99 into aws:main May 7, 2026
35 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants