-
Notifications
You must be signed in to change notification settings - Fork 72
Processing pull requests
markstory edited this page Jan 21, 2013
·
4 revisions
This page is a brain dump of how a pull request should be processed and errors aggregated:
- Web process receives hook.
- Background job is queued for the repository + user + pull request number.
- Status code is returned based on job queue success.
-
.lintrc
file is downloaded for the queued repo.- If there is no
.lintrc
file an error is logged and job is completed as a failure.
- If there is no
-
.lintrc
file is parsed into a ReviewConfig object. - Using the user, repo & pull request number the changed files are fetched from github.
- The patch keys for each changed file are processed. A ChangedFiles object is created. This object gives accessors for reading filenames, lines changed, and commits lines changed in.
- The configured tools for the changed files.
- Each tool is iterated and run for all matching files. Tools are aware of which types of files they can handle and only process matching files.
- Errors are collected into an ErrorCollection object. Errors are tracked by file + line number.
- The existing comments for a pull request are loaded.
- New errors/comments are checked against the existing comment to prevent duplicates. Each new error is compared to the commit/file/line of existing comments and if the content matches a the error is discarded as a comment already exists.
- Once the new comments have been distilled. New comments are created using the commit/file/line.