Options
All
  • Public
  • Public/Protected
  • All
Menu

GitRDoneBot

Index

Type aliases

Action

CommentResponse

GetResponse

PostORPutResponse

SuccessfulBotAction

Variables

Const logger

logger: Transform & { constructor: any; defaultMeta?: any; exceptions: ExceptionHandler; exitOnError: Function | boolean; format: Format; level: string; levels: Config.AbstractConfigSetLevels; log: LogMethod; profilers: object; silent: boolean; transports: Transport[]; add: any; child: any; clear: any; close: any; configure: any; isDebugEnabled: any; isErrorEnabled: any; isInfoEnabled: any; isLevelEnabled: any; isSillyEnabled: any; isVerboseEnabled: any; isWarnEnabled: any; profile: any; query: any; remove: any; startTimer: any; stream: any } & {} = LoggerFactory.getInstance()

Functions

BuildGetResponse

  • BuildGetResponse<T>(statusCode: number, body: T[] | T | undefined): GetResponse
  • Type parameters

    • T

    Parameters

    • statusCode: number

      HTTP status code

    • body: T[] | T | undefined

      Data payload received from HTTP GET request

    Returns GetResponse

    instance of the ApiResponse subclass that indicates success or failure of the HTTP request

BuildPostORPutResponse

  • Parameters

    • statusCode: number

      HTTP status code

    • Optional body: any

      (Optional) Data payload received from HTTP PUT/POST request

    Returns PostORPutResponse

    instance of the ApiResponse subclass that indicates success or failure of the HTTP request

allGoodGitPractice

composeNote

Const getBaseURI

  • getBaseURI(baseURI?: undefined | string): string

Const getBotUsername

  • getBotUsername(botName?: undefined | string): string

Const getMergeRequestEventData

Const getMrId

  • getMrId(event: any): number

Const getProjectId

  • getProjectId(event: any): number

Const getState

  • getState(event: any): string

Const getToken

  • getToken(token?: undefined | string): string
  • Environment variables should be retrieved with one of these helper functions so an appropriate error is thrown if the variable is missing from the environment.

    Parameters

    • Optional token: undefined | string

    Returns string

runBotActions

  • Uses information from Merge Request webhook event to invoke Bot Actions. Uses Bot Action response data to post user-facing comment and emoji on GitLab Merge Request that generated webhook event.

    Parameters

    • api: GitLabApi

      an instance of the GitLabApi class that wraps HTTP requests to and responses from the GitLab API

    • customConfig: CustomConfig

      defines threshold values for each of the Bot Actions

    • gitLabEvent: any

      GitLab webhook body

    • state: string

      the state of the incoming Merge Request event from GitLab

    Returns Promise<CommentResponse>

    object that implements LambdaResponse interface which uses specific types to indicate success or failure of posting comment on GitLab Merge Request

Object literals

Const BranchAgeDefaults

BranchAgeDefaults: object

actionName

actionName: string = "branchAgeAnalysis"

constructiveFeedbackOnlyToggleDefault

constructiveFeedbackOnlyToggleDefault: false = false

thresholdDefault

thresholdDefault: number = 7

thresholdMax

thresholdMax: number = 14

thresholdMin

thresholdMin: number = 1

thresholdName

thresholdName: string = "thresholdInDays"

Const CommitMessageDefaults

CommitMessageDefaults: object

actionName

actionName: string = "cmAnalysis"

constructiveFeedbackOnlyToggleDefault

constructiveFeedbackOnlyToggleDefault: false = false

thresholdDefault

thresholdDefault: number = 3

thresholdMax

thresholdMax: number = 100

thresholdMin

thresholdMin: number = 2

thresholdName

thresholdName: string = "thresholdBadCms"

Const DiffSizeDefaults

DiffSizeDefaults: object

actionName

actionName: string = "diffAnalysis"

constructiveFeedbackOnlyToggleDefault

constructiveFeedbackOnlyToggleDefault: false = false

thresholdDefault

thresholdDefault: number = 500

thresholdMax

thresholdMax: number = 500

thresholdMin

thresholdMin: number = 1

thresholdName

thresholdName: string = "thresholdInLinesOfDiff"

Const TooManyAssignedDefaults

TooManyAssignedDefaults: object

actionName

actionName: string = "tooManyMergeRequestsAnalysis"

constructiveFeedbackOnlyToggleDefault

constructiveFeedbackOnlyToggleDefault: false = false

thresholdDefault

thresholdDefault: number = 3

thresholdMax

thresholdMax: number = 10

thresholdMin

thresholdMin: number = 2

thresholdName

thresholdName: string = "thresholdNumberOfMergeRequests"

Generated using TypeDoc