UNPKG

@atomist/sdm-pack-fingerprints

Version:

an Atomist SDM Extension Pack for fingerprinting code

77 lines (76 loc) 3.13 kB
import { AutoMergeMethod, AutoMergeMode } from "@atomist/automation-client/lib/operations/edit/editModes"; import { ExtensionPack, Fingerprint, Goal, PushImpact, SoftwareDeliveryMachine, TransformPresentation } from "@atomist/sdm"; import { MessageMaker } from "../checktarget/messageMaker"; import { ApplyTargetParameters } from "../handlers/commands/applyFingerprint"; import { Aspect, FingerprintDiffHandler, FingerprintHandler, FP } from "./Aspect"; export declare function forFingerprints(...s: string[]): (fp: FP) => boolean; /** * customize the out of the box strategy for monitoring when fingerprints are out * of sync with a target. * */ export interface FingerprintImpactHandlerConfig { complianceGoal?: Goal; complianceGoalFailMessage?: string; transformPresentation: TransformPresentation<ApplyTargetParameters>; messageMaker: MessageMaker; } /** * Setting up a PushImpactHandler to handle different strategies (FingerprintHandlers) involves giving them the opportunity * to configure the sdm, and they'll need all of the current active Aspects. */ export declare type RegisterFingerprintImpactHandler = (sdm: SoftwareDeliveryMachine, registrations: Aspect[]) => FingerprintHandler; export declare const DefaultTargetDiffHandler: FingerprintDiffHandler; /** * wrap a FingerprintDiffHandler to only check if the shas have changed * * @param handler the FingerprintDiffHandler to wrap */ export declare function diffOnlyHandler(handler: FingerprintDiffHandler): FingerprintDiffHandler; /** * Options to configure the Fingerprint support */ export interface FingerprintOptions { /** * Optional Fingerprint goal that will get configured. * If not provided fingerprints need to be registered manually with the goal. * @deprecated use pushImpactGoal instead */ fingerprintGoal?: Fingerprint; /** * Optional PushImpact goal that will get configured */ pushImpactGoal?: PushImpact; /** * Aspects we are managing */ aspects: Aspect | Aspect[]; /** * Register FingerprintHandler factories to handle fingerprint impacts * @deprecated embed handlers in Features */ handlers?: RegisterFingerprintImpactHandler | RegisterFingerprintImpactHandler[]; transformPresentation?: TransformPresentation<ApplyTargetParameters>; } export declare const DefaultTransformPresentation: TransformPresentation<ApplyTargetParameters>; /** * Options to configure the PullRequest creation */ export interface PullRequestTransformPresentationOptions { branchPrefix?: string; title?: string; body?: string; message?: string; autoMerge?: { method?: AutoMergeMethod; mode?: AutoMergeMode; }; } /** * Creates the default TransformPresentation for raising PullRequests */ export declare function createPullRequestTransformPresentation(options?: PullRequestTransformPresentationOptions): TransformPresentation<ApplyTargetParameters>; /** * Install and configure the fingerprint support in this SDM */ export declare function fingerprintSupport(options: FingerprintOptions): ExtensionPack;