bradleyfalzon / gopherci

GopherCI was a project to help you maintain high-quality Go projects, by checking each GitHub Pull Request, for backward incompatible changes, and a suite of other third party static analysis tools.
https://gopherci.io
BSD 2-Clause "Simplified" License
102 stars 13 forks source link

Improve error handling on Analysis page #97

Closed bradleyfalzon closed 7 years ago

bradleyfalzon commented 7 years ago

DB StartAnalysis should take commitFrom, commitTo, and requestNumber:

Previously these fields were only added after a successful analysis.
This change makes those three required fields a part of the constructor
so no matter what failure scenario there is, those fields are still set.

The other option is to ensure a failed analysis still sets some of
these fields, but there may be some scenarios where those fields may
have been missed, such as a panic.

Analysis page fetching diff should not be a critical error:

The db.Analysis type contains a list of the issues per tool that were
stored in the database. We use these in two ways:

A) Provide it to web.DiffIssues function to combine a diff/patch with
the issue to show the issue inline.

B) Show a summary of the issues, grouped by tool.

If fetching the diff/patch fails, we can still show the issues per
tool, this contains all the information a user really requires.

Now, patches is only set in the template if there were issues *and*
there was no errors fetching the diff.

Relates to #88.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.7%) to 60.278% when pulling 7c6ccfe25e45b3001f385b32c65f32e5a20154f5 on error-handling into 837835d69d13716a0116969b5236d95689393dd6 on master.