Brief Description of Work Done during First Month of GSoC Project- Probots and GitLab to GitHub Integration
Hey All, I am Kartik and I had been selected for the GSoC Project Probots and Gitlab to GitHub Integration and so far I have completed 1 month of this project out of 3 months and I would like to share with the CiviCRM Community of the work-done during this project. For more info. regarding project details, you can refer here https://civicrm.org/blog/kartik1000/gsoc-project-probots-and-gitlab-github-integration.
So, to begin with, one of the issues I faced, in the beginning, was how to test the working of the civi-bot that already exists in civi-core by adding more code to it related to issues I aimed to solve. So, with much discussion with @eileen and Saurabh, we decided to create a dev-bot from the forked repo of probot-civicrm and use it for our purposes of testing. The code-repo for the same bot is present here with different issues I solved existing as different merged branches. Another issue I faced in setting up the dev-bot was hosting the bot. For the bot to be active always, we need to host it as a node-js application, the most suitable option for which are Heroku and glitch. For the simplicity of the glitch, I decided to use it for my purpose. The other issue that I faced was to keep the bot always active for that either one can use the ping method every 5 minutes or use the service of uptime robot.
- The first issue I decided to complete was to make sure that we issue newcomer's message and information only to the new contributor and not keep posting the same message to every contributor. For this, I added simple logic of checking how many PRs have been made by the contributor, if the count is 1 then issue newcomer's message. It just required to fetch this information using the existing GitHub APIs. For the same reasons, I had to modify our existing template as well. The reviewing standards will be posted on every PR irrespective of it being a new contributor or not.
This is an example of how a PR created by a new contributor looks like after making the required changes.
- The second issue I worked on is to merge the existing stale-bot with the existing civi-bot. Stale-bot closes PRs and issues which have been inactive for some time. It first labels PR as stale/wontfix and then after some-time, if the PR is still in-active then it closes the PR. This task was not too difficult as well since the entire open-source repo for the stale-bot already exists but since it is old many of its functions were depreciated and needed to be updated from the GitHub APIs and few other modifications were required. So, this task was also accomplished and tested as well.
Till now I have learnt a lot of new things from this project especially how powerful the GitHub APIs are which allow the user to receive almost any information regarding their repository. In the upcoming months, I hope to learn even more new things. The entire code for the civicrmdev-bot is present in this repository. We plan to merge these features in the existing civi-bot in some time so that they can be used in CiviCRM-core. I request to all the community members if you have any ideas or thoughts on what other things I can do to automate our workflow during the remaining project, please comment them on this issue and thanks to all!