circleci

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	WorkspacePathEnvVar          = "GITHUB_WORKSPACE"
	NightfallAPIKeyEnvVar        = "NIGHTFALL_API_KEY"
	CircleRepoNameEnvVar         = "CIRCLE_PROJECT_REPONAME"
	CircleOwnerNameEnvVar        = "CIRCLE_PROJECT_USERNAME"
	CircleCurrentCommitShaEnvVar = "CIRCLE_SHA1"
	CircleBeforeCommitEnvVar     = "EVENT_BEFORE"
	CirclePullRequestUrlEnvVar   = "CIRCLE_PULL_REQUEST"
	CircleBranchEnvVar           = "CIRCLE_BRANCH" // branch that triggered the workflow

	GithubBaseBranchEnvVar = "GITHUB_BASE_BRANCH" // optional user input variable if base branch is not master
	DefaultBaseBranchName  = "master"             // diff against base branch if workflow triggered by PR

	// right side is reserved for additions and unchanged lines
	// https://developer.github.com/v3/pulls/comments/#create-a-review-comment-for-a-pull-request
	GithubCommentRightSide = "RIGHT"
)

Variables

This section is empty.

Functions

func NewCircleCiService

func NewCircleCiService(token string) diffreviewer.DiffReviewer

NewCircleCiService creates a new CircleCi service

Types

type Service

type Service struct {
	GithubClient githubintf.GithubClient
	Logger       logger.Logger
	GitDiff      gitdiffintf.GitDiff
	PrDetails    prDetails
}

Service contains the github client that makes Github api calls

func (*Service) GetDiff

func (s *Service) GetDiff() ([]*diffreviewer.FileDiff, error)

GetDiff retrieves the file diff from the requested pull request

func (*Service) GetLogger

func (s *Service) GetLogger() logger.Logger

GetLogger gets the github service logger

func (*Service) LoadConfig

func (s *Service) LoadConfig(nightfallConfigFileName string) (*nightfallconfig.Config, error)

LoadConfig gets all config values from files or environment and creates a config

func (*Service) WriteComments

func (s *Service) WriteComments(comments []*diffreviewer.Comment) error

WriteComments posts the findings as annotations to the github check

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL