Skip to content

About

Diff Helper for Continuous Integration (CI) Services

Resources

Stars

5 stars

Watchers

2 watching

Forks

Repository files navigation

CI Diff Helper

Diff Helper for Continuous Integration (CI) Services

pypi coverage versions Documentation Status

For an open source project, running unit tests, system tests, torture tests, fuzz tests, integration tests, code quality checks, etc. can quickly become a large task.

In order to limit the amount of time and resources that these jobs require, this tool provides a way to determine which files have changed and provides a Python API for these changes. In addition, this library provides the corresponding commit SHA (or other artifact) that is used as the diffbase.

The library supports (planned)

Install

$ pip install --upgrade ci-diff-helper

See It In Action

The test-app branch is set up to run every time a change is made. Check out the latest Travis builds in test-app, the latest CircleCI builds and the latest AppVeyor builds to see the computed values at work.

For example, in a Travis PR build:

Config object: <Travis (active=True)>
----------------------------------------
    active: True
      base: 'test-app'
    branch: 'test-app'
event_type: <TravisEventType.pull_request: 'pull_request'>
     in_pr: True
  is_merge: True
 merged_pr: None
        pr: 13
  repo_url: 'https://github.com/dhermes/ci-diff-helper'
      slug: 'dhermes/ci-diff-helper'
       tag: None
       ...

and in a Travis push build:

Config object: <Travis (active=True)>
----------------------------------------
    active: True
      base: u'84b14d000b75a47592116ff1a99dfcd38614dae3'
    branch: 'test-app'
event_type: <TravisEventType.push: 'push'>
     in_pr: False
  is_merge: True
 merged_pr: 13
        pr: None
  repo_url: 'https://github.com/dhermes/ci-diff-helper'
      slug: 'dhermes/ci-diff-helper'
       tag: None
       ...

A CircleCI PR build:

Config object: <CircleCI (active=True)>
----------------------------------------
  _pr_info: {...}
    active: True
      base: u'84b14d000b75a47592116ff1a99dfcd38614dae3'
    branch: 'pull/13'
     in_pr: True
  is_merge: False
        pr: 13
  provider: <CircleCIRepoProvider.github: 'github'>
  repo_url: 'https://github.com/dhermes/ci-diff-helper'
      slug: 'dhermes/ci-diff-helper'
       tag: None
       ...

and in a CircleCI push build:

Config object: <CircleCI (active=True)>
----------------------------------------
  _pr_info: {}
    active: True
      base: NotImplementedError('Diff base currently only supported in a PR from GitHub',)
    branch: 'test-app'
     in_pr: False
  is_merge: True
        pr: None
  provider: <CircleCIRepoProvider.github: 'github'>
  repo_url: 'https://github.com/dhermes/ci-diff-helper'
      slug: 'dhermes/ci-diff-helper'
       tag: None
       ...

An AppVeyor PR build:

Config object: <AppVeyor (active=True)>
----------------------------------------
    active: True
    branch: 'test-app'
  is_merge: True
  provider: <AppVeyorRepoProvider.github: 'github'>
       tag: None
       ...

and in an AppVeyor push build:

Config object: <AppVeyor (active=True)>
----------------------------------------
    active: True
    branch: 'test-app'
  is_merge: True
  provider: <AppVeyorRepoProvider.github: 'github'>
       tag: None
       ...

License

Apache 2.0 - See LICENSE for more information.

About

Diff Helper for Continuous Integration (CI) Services

Resources

Stars

5 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages