Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot command and quoted bot-command in the same comment #2

Open
garg3133 opened this issue May 26, 2021 · 1 comment
Open

Bot command and quoted bot-command in the same comment #2

garg3133 opened this issue May 26, 2021 · 1 comment

Comments

@garg3133
Copy link
Owner

garg3133 commented May 26, 2021

If a bot-command is mentioned in a comment and the same bot command is quoted in the same comment, the action may not run that bot command because of how we parse the comments.

One use case for this might be someone replying to someone else:
" You need to use @zulipbot claim to claim an issue.
@zulipbot claim"

One solution for this might be to use matchAll() instead of match() in parseComment, so that we can get the starting index of the command and then we can check if the matched quoted command is found near to the command for which it is being checked for.

See logs for https://github.com/garg3133/git-github-demo/runs/2651318874?check_suite_focus=true

@garg3133
Copy link
Owner Author

garg3133 commented May 26, 2021

One more issue that can arise in the current implementation of bot-commands is that is someone write a bot-command in a comment, along with some other stuff and then someone else quote replies the complete comment, so the bot-commands will also run for that other person.

One solution for this might be to modify regex to check if the current line starts with the > symbol. This can be done by starting the regex with ^ and checking if there is a > symbol after that and if there is not, allowing any number of any characters before the actual bot command starts.

See logs for https://github.com/garg3133/git-github-demo/runs/2673329108?check_suite_focus=true
(Quotes remain active till ^\r\n$ appears, so we can check if the starting index of command is in-between the appearance of > and next ^\r\n$.

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

No branches or pull requests

1 participant