circleci

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 16 Imported by: 0

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() diffreviewer.DiffReviewer

NewCircleCiService creates a new CircleCi service

func NewCircleCiServiceWithGithubComments added in v0.0.5

func NewCircleCiServiceWithGithubComments(token, baseUrl string) diffreviewer.DiffReviewer

NewCircleCiServiceWithGithubComments creates a new CircleCi service with an authenticated Github client

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