You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The regex used in extractIssueNumbers (inside src/inngest/functions/process-pr-event.ts) contains a second alternative that matches any bare #N token. As a result, a PR body such as "Related to #42" or "See discussion in #7" triggers the same XP award path as "Fixes #42", even though no issue is actually being closed.
(?:close[sd]?|fixe[sd]?|resolve[sd]?)\s+#(\d+) - closing keywords followed by an issue number (correct intent)
#(\d+) - any bare #N reference anywhere in the PR body (unintended)
Wherever extractIssueNumbers passes results to tryLinkByIssueRef, the second alternative causes every issue mentioned in passing to enter the XP award pipeline alongside genuinely resolved issues.
Impact
Any PR body that references an issue number for context (code review discussion, related-work links, changelog notes) will incorrectly trigger XP awards for that issue.
On a busy repository with many cross-references, this inflates XP balances for all participants systematically and silently.
Because the idempotency key is (user_id, source, ref_id), the erroneous award is committed on first merge and cannot be cleanly corrected by re-running the event.
Steps to Reproduce
Open a PR with body: Refactors the auth flow. See #10 for background.
If cross-repository closing syntax (owner/repo#N) is needed in future, it should be added explicitly with the same keyword guard rather than by broadening the bare-ref alternative.
Severity
High - Silent, systematic XP inflation on every merged PR that mentions an issue number in passing. The impact compounds over time as the repository grows.
Summary
The regex used in
extractIssueNumbers(insidesrc/inngest/functions/process-pr-event.ts) contains a second alternative that matches any bare#Ntoken. As a result, a PR body such as "Related to #42" or "See discussion in #7" triggers the same XP award path as "Fixes #42", even though no issue is actually being closed.Affected File
src/inngest/functions/process-pr-event.tsRoot Cause
The regex has two alternatives separated by
|:(?:close[sd]?|fixe[sd]?|resolve[sd]?)\s+#(\d+)- closing keywords followed by an issue number (correct intent)#(\d+)- any bare#Nreference anywhere in the PR body (unintended)Wherever
extractIssueNumberspasses results totryLinkByIssueRef, the second alternative causes every issue mentioned in passing to enter the XP award pipeline alongside genuinely resolved issues.Impact
(user_id, source, ref_id), the erroneous award is committed on first merge and cannot be cleanly corrected by re-running the event.Steps to Reproduce
Refactors the auth flow. See #10 for background.Expected Behaviour
Only closing-keyword matches should produce issue links. The second bare-reference alternative should be removed:
If cross-repository closing syntax (
owner/repo#N) is needed in future, it should be added explicitly with the same keyword guard rather than by broadening the bare-ref alternative.Severity
High - Silent, systematic XP inflation on every merged PR that mentions an issue number in passing. The impact compounds over time as the repository grows.