fix(github): require a handle boundary after @gittensory in mention parsing - #1345
Closed
galuis116 wants to merge 1 commit into
Closed
fix(github): require a handle boundary after @gittensory in mention parsing#1345galuis116 wants to merge 1 commit into
galuis116 wants to merge 1 commit into
Conversation
Contributor
|
Superagent did not find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1345 +/- ##
=======================================
Coverage 95.25% 95.25%
=======================================
Files 188 188
Lines 20314 20314
Branches 7319 7319
=======================================
Hits 19350 19350
Misses 378 378
Partials 586 586
🚀 New features to boost your workflow:
|
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1344.
parseGittensoryMentionCommandmatched the bot handle with no boundary after@gittensory, so the handle matched as a prefix of a longer GitHub username. A comment mentioning a different account such as@gittensory-botor@gittensory2was parsed as a bare@gittensory help, and the only caller then posted an unsolicited help reply on that thread.What changed
(?![\w-])boundary after@gittensoryin the mention regex. GitHub usernames are word characters + hyphen, so the lookahead rejects@gittensory-bot/@gittensory2/@gittensorybotwhile still matching bare@gittensory,@gittensory <command>, and punctuation boundaries.Scope
CONTRIBUTING.md; nosite//CNAME/VitePress.Validation
git diff --checknpm run typechecknpm run test:coveragelocally (github-commands suite green); the changed regex line is fully covered, including the now-rejected longer-handle cases and the retained positive cases.npm audit --audit-level=moderate@gittensory-bot/@gittensory2/@gittensorybot→ null, and a punctuation-boundary positive case.If any required check was skipped, explain why:
Safety
Notes
parseGittensoryMentionCommand(src/github/commands.ts); no schema, migration, or binding changes.