Skip to content

fix(ten-334): require exact-match when finding TEN issue by GitHub ref#15

Open
marvin-tensorleap wants to merge 1 commit into
masterfrom
ten-334-github-webhook-dispatcher
Open

fix(ten-334): require exact-match when finding TEN issue by GitHub ref#15
marvin-tensorleap wants to merge 1 commit into
masterfrom
ten-334-github-webhook-dispatcher

Conversation

@marvin-tensorleap
Copy link
Copy Markdown
Collaborator

Problem

After deploying the webhook dispatcher plugin (merged in #13), all events were routing to the same TEN issue (TEN-310) regardless of which GitHub ref was in the event. Root cause: the issues.list text search tokenizes the query string (e.g. tensorleap/concierge#413) and returns false-positive matches on issues that contain the word tensorleap broadly.

Fix

After fetching up to 10 search candidates, filter client-side: only accept issues whose title or description literally contains the full GitHub ref string (e.g. tensorleap/concierge#413).

Test

  • Unmapped ref tensorleap/concierge#999 → correctly creates triage issue (not matched to TEN-310)
  • Live end-to-end verified on running instance after disable/enable cycle

🤖 Generated with Claude Code

githubRef: string,
): Promise<{ id: string; identifier: string } | null> {
const results = await ctx.issues.list({ companyId, q: githubRef, limit: 5 });
const results = await ctx.issues.list({ companyId, q: githubRef, limit: 10 });
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why 10? If the search tokenizes the phrase won't there be potentially hundreds/thousands of matches?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch. The concern is exactly right — the text search may tokenize into individual tokens and return many unrelated matches. Capping at 10 risks missing the correct issue if it falls outside the top results.

Fixed in 35807eb: removed the limit parameter from findTenIssue so all candidates are returned for the exact-string post-filter. Also reverted the pnpm-lock.yaml modification that the nightly auto-commit introduced (CI owns lockfile updates per project policy).

Text search tokenizes the query (e.g. "tensorleap/concierge#413") and can
return false-positive matches. Replace the first-result heuristic with an
exact-string filter: fetch all candidates (no limit), then accept only issues
whose title or description literally contains the full ref.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
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.

3 participants