ideas icon indicating copy to clipboard operation
ideas copied to clipboard

idea: similar code search in Pull Request

Open Ikuyadeu opened this issue 7 years ago • 7 comments

Hello, thank you for good bot framework and good chance to join the developing bot.

I developed on my local.

a GitHub App built with probot that searches files similar to the deleted code in Pull Request.

For check with PullRequest submitter forgot to change the similar code. This function searches similar code with deleted lines.

Is it fitted for your GSoC topic? If so, I'll publish this.

Ikuyadeu avatar Mar 05 '18 08:03 Ikuyadeu

yeah sounds good :)

gr2m avatar Mar 05 '18 22:03 gr2m

@gr2m Thank you for interest. I published https://github.com/Ikuyadeu/similar-code-searcher

GitHub
Contribute to similar-code-searcher development by creating an account on GitHub.

It works in https://github.com/Ikuyadeu/similar-code-searcher/pull/1 like screenshot

Current TODO is

  • [ ] It detects same code that changed in Pull Request -> extract only not changed files
  • [ ] It can search only current repository, if you don't have the similar code it would not work. -> Search from all repository if the result is nothing

Ikuyadeu avatar Mar 06 '18 00:03 Ikuyadeu

I published prototype on https://github.com/apps/similar-code-searcher

GitHub
GitHub is where people build software. More than 27 million people use GitHub to discover, fork, and contribute to over 80 million projects.

Ikuyadeu avatar Mar 12 '18 04:03 Ikuyadeu

hey I think this could be really useful, but I’m not yet how it works :) I looked at https://github.com/Ikuyadeu/similar-code-searcher/pull/1

I would expect a comment to other open pull requests that change the same files / lines like my own pull request to make me aware of the others? Is that what you want to do or something else?

gr2m avatar Mar 18 '18 22:03 gr2m

@gr2m Thank you for the feedback! I think your idea is a very interesting function.

However, it is different to Similar Code Searcher In my submitted proposal, it is called Synchronous Change File Suggester. And it can extend duplicate-issues to duplicate-pulls. I think Synchronous Change File Suggester can be merged with Similar Code Searcher.

Implementing Synchronous Change File Suggester has two way,

  1. Learn past pull requests and suggestions by using association rule mining
  2. Just search a pull request that changed same file or line

The first plan looks useful for detect project specific patterns. The second plan is easy to implement.

In my plan, first, fix current Similar Code Searcher bugs. Second, implement Synchronous Change File Suggester. Finally, merge two functions.

Ikuyadeu avatar Mar 19 '18 00:03 Ikuyadeu

Thanks for explaining, sounds good :)

gr2m avatar Mar 19 '18 03:03 gr2m

Thank you too 😄

Ikuyadeu avatar Mar 19 '18 04:03 Ikuyadeu