probot / ideas

Share ideas for new GitHub Apps built with Probot
96 stars 48 forks source link

idea: similar code search in Pull Request #50

Open Ikuyadeu opened 6 years ago

Ikuyadeu commented 6 years ago

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.

gr2m commented 6 years ago

yeah sounds good :)

Ikuyadeu commented 6 years ago

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

GitHub
Ikuyadeu/similar-code-searcher
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

Ikuyadeu commented 6 years ago

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

GitHub
Build software better, together
GitHub is where people build software. More than 27 million people use GitHub to discover, fork, and contribute to over 80 million projects.
gr2m commented 6 years ago

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?

Ikuyadeu commented 6 years ago

@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.

gr2m commented 6 years ago

Thanks for explaining, sounds good :)

Ikuyadeu commented 6 years ago

Thank you too 😄