Skip to main content

CI Tool for adding status check results for individual components

Project description

CISTATUS

Demo

About

cistatus is a tool that can explicitly set the pull request check status into github pull requests. For example, if you have multiple checks within a single job but you wish to expose each of those steps as separate checks in github, you can use this tool to expose those extra steps.

cistatus can dig relevant information from the enviroment variables exposed by most ci systems. Currently supported:

  • Azure Devops
  • Travis
  • CircleCI
  • AppVeyor
  • Shippable
  • CodeBuild

This means that if cistatus is executed within build nodes of any of these systems, repository, pr and sha information is read from the environment variables.

Why

Use-case for writing this came out of frustration to expose multiple test reports into a github pull request itself from Azure DevOps pipeline builds. With cistatus, one could now have a overall status check exposed in the pull request - if needed - and then add additional checks that each can link into a specific result set without the need to go dig deep in the build artifacts or build logs.

Installation

pip install cistatus

Integration

cistatus has functionality to automatically detect the CI system that it's running on. This happens by checking of 'unique' environment variable of the said ci system and this requires no configuration from the user.

When CI system is detected, a commit sha, repository name and pr values are read off from corresponding environment variables of said ci environment. Eg, if you want to run cistatus from your local shell, only then you are required to pass in all mandatory command line arguments.

With this approach, when running the script from within any ci slave, you only need to pass in the status flag to set the checks' status.

Usage

[-h] [--repo REPO] [--sha SHA] [--pr PR] [--token TOKEN]
--status {pending,success,error,failure} [--url URL]
[--description DESCRIPTION] [--context CONTEXT]

Set Build Status

optional arguments:
  -h, --help            show this help message and exit
  --repo REPO           user/repo
  --sha SHA
  --pr PR
  --token TOKEN         Github API Token
  --status {pending,success,error,failure}
  --url URL             Job url
  --description DESCRIPTION
                        Job Description
  --context CONTEXT     Job context

--repo

This flag sets the github repository where the status of the pr should be set at. If cistatus detects that its running in any of the supported environments, this parameter is mandatory as value is read from appropriate environment file but it can still be overwritten from the command line.

--sha

This flag sets the the commit sha of the pr request. If cistatus detects that its running in any of the supported environments, this parameter is mandatory as value is read from appropriate environment file but it can still be overwritten from the command line.

--pr

This flag sets the pull requests number where status is set. If cistatus detects that its running in any of the supported environments, this parameter is mandatory as value is read from appropriate environment file but it can still be overwritten from the command line.

--token

This flag sets the personal authentication token. Value can be also set into GITHUB_ACCESS_TOKEN environment variable which is adviced if you do not want to leak the token into possibly public build logs.

--context

This flag sets the string shown as context of the check. Defaults to default

--description

This flag sets the longder description of the context. Defaults to CI Status

--url

This flag sets the url for "Details" link in context / description for the check.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cistatus-0.0.1.tar.gz (9.9 kB view details)

Uploaded Source

File details

Details for the file cistatus-0.0.1.tar.gz.

File metadata

  • Download URL: cistatus-0.0.1.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for cistatus-0.0.1.tar.gz
Algorithm Hash digest
SHA256 591f9b59764bffbc7b28b037d87880e6e686f822ae2dd563f9d50bd94bb2f6e9
MD5 92e64d908ab5f84af1f720d3ebc0838e
BLAKE2b-256 6e577b8cfe083ee1d91ea808722b6415d91cda25bf2d717669031658a8f79aed

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page