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

bradleyfalzon / gopherci
61%
master: 61%

Build:
Build:
LAST BUILD BRANCH: review-no-approve
DEFAULT BRANCH: master
Repo Added 22 Oct 2016 12:03PM UTC
Files 0
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

LAST BUILD ON BRANCH refreader
branch: refreader
CHANGE BRANCH
x
Reset
  • refreader
  • analyser-composition
  • build-summary
  • builddb
  • clone-path
  • commit-comment
  • debug
  • disable-private
  • docker
  • docs-errors
  • dominikh
  • dual-comments
  • error-handling
  • failed-diff
  • first-commit
  • fix-goveralls
  • fix-hardcoded
  • gcppubsub
  • godep
  • gopherci-env
  • gopherci.yml
  • graceful
  • ignore-gen
  • integration-test
  • logger
  • master
  • maxcommments
  • memlimit
  • msgs
  • pr-reviews
  • pr-reviews-default
  • preflight
  • pubsub-breaking
  • pubsub-timeout
  • push
  • refactor-analyser
  • reference-failures
  • remove-accountid
  • reporter
  • requeue
  • review-no-approve
  • senderid
  • show-env
  • syncronize
  • test
  • various
  • wbsecret
  • webui

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

Relevant lines Covered
Build:
Build:
1509 RELEVANT LINES 921 COVERED LINES
2.43 HITS PER LINE
Source Files on refreader
Detailed source file information is not available for this build.

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
269 refreader 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) ... push 27 May 2017 05:01AM UTC bradleyfalzon travis-ci pending completion  
See All Builds (294)
  • Repo 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