GSoC Week 10

This week, I spent most of my time debugging the Pull Request worker.

Meeting Summary

Date: NA

No meeting was held this week.

Work Done This Week

  • GitHub Repository Metadata Worker:

    • Improved logging. The log file now includes the worker’s name and also logs exception tracebacks that help in debugging.
    • Error Handling. The worker doesn’t quit when it encounters an error while performing a task. It logs the error and moves onto the next task.
    • Added the ability to set the port the worker runs on by adding an entry for it augur.config.json
  • GitHub Pull Requests Worker:

    • Fixed a bug that caused the worker to raise an error when a PR with a milestone was encountered.
    • Fixed a bug that caused a Unique Key Violation in the DB when inserting Pull Request comments.
    • Improved logging. The log file now includes the worker’s name and also logs exception tracebacks that help in debugging.
    • Error Handling. The worker doesn’t quit when it encounters an error while performing a task. It logs the error and moves onto the next task.
    • Added the ability to set the port the worker runs on by adding an entry for it augur.config.json

Pull Requests:

Challenges Encountered

Fixing the bug that caused a ‘Unique Key Violation’ in the DB when inserting Pull Request comments was the most challenging task. I spent hours going through the PR worker’s code and testing it on various repositories just to realize that the error wasn’t in the code but the database.

The previous version of the PR worker used to manually set the primary key of each record inserted in the DB. This messed up the DB’s primary key counter. The latest version of the PR worker relies on the DB to autoincrement the primary key each time a new record is inserted. So, each time the PR worker tries to insert a comment, the autoincremented primary key already exists in the DB thus resulting in a ‘Unique Key Violation’ error.

The fix was pretty simple. All we needed to do was to set the DB’s primary key counter for the comments table to the max primary key in the comments table.

Future Work

  • Continue working on the Pull Request Worker.
  • Implement Pull Request related metrics.

gsoc

389 Words

2019-08-05 23:08 +0530