• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bradleyfalzon / gopherci / 269
61%
master: 61%

Build:
Build:
LAST BUILD BRANCH: review-no-approve
DEFAULT BRANCH: master
Ran 27 May 2017 05:01AM UTC
Jobs 1
Files 18
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
269

push

travis-ci

bradleyfalzon
Use merge-base in pull requests to determine the common ancestor

GopherCI generates its own diffs, not using GitHubs, for the main
reason that GitHub did not have a uniform way to fetch diffs and
we would like to support other platforms (GitLab) potentially later.
So whilst we could generate a diff perfectly fine, we kept doing so.

It's become apparent that we're not generating the diffs correctly
at all. We're creating a diff between HEAD of the PR and the latest
commit in the base branch, this isn't what GitHub is doing, so when
we post a comment to a particular line, the line numbers could be
wrong.

Initially it was thought we could just create a diff interface,
passing this into the Analyser, and never generating the diffs
ourselves, but apicompat needs to know the exact base ref. Previously
it was using FETCH_HEAD, as was git diff.

So, instead of using GitHub's diffs, we'd learn how to accurately
generate a diff by knowing the exact point where the branch for the
PR was created. We'd then pass this to apicompat as well.

To do this, we'll create a refReader interface, because a push already
knows the base ref, but a pull request does not. When invoking the
Analyse method, the caller will determine whether it should use
one of two new types implementing refReader.

A push will use a hard coded base ref that it obtains from the API
and a pull request will use git merge-tool to compare the two branches
FETCH_HEAD and HEAD to find the common ancestor.

Git diff and apicompat will then use the result of refReader.

In doing this, it requires the pull request cloner to clone a much
larger history, to ensure it captures enough history to find the
last common commit. This might be able to be optimised at a later
stage if it could know how many commits are in the pull request.

Fixes #84.

921 of 1509 relevant lines covered (61.03%)

2.43 hits per line

Jobs
ID Job ID Ran Files Coverage
1 269.1 (GOOGLE_APPLICATION_CREDENTIALS=/tmp/gcloud-GopherCI-dev.json) 27 May 2017 05:01AM UTC 0
61.03
Travis Job 269.1
Source Files on build 269
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #269
  • 60739d2c on github
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc