Skip to content

Commit

Permalink
chore: document baseline details
Browse files Browse the repository at this point in the history
  • Loading branch information
WitoDelnat committed Jul 26, 2023
1 parent 760c028 commit 8fbeea7
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions packages/validation/src/MonokleValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,35 @@ const DEFAULT_PLUGIN_MAP = {
'kubernetes-schema': true,
};

type ValidateParams = {
/**
* The resources that will be validated.
*/
resources: Resource[];

/**
* The list of resources that recently got updated.
*
* @remarks Validators can use this information to skip non-modified resources.
*/
incremental?: Incremental;

/**
* A previous run which acts as the baseline for detected problems.
*
* @remark Providing a baseline will set run.baselineGuid and result.baselineStatus.
* @remark Newly fixed problems will be added as 'absent' results.
* When using baseline, it is important to properly filter or
* indicate absent results or they appear as false positives.
*/
baseline?: ValidationResponse;

/**
* A signal that can be used to abort processing.
*/
abortSignal?: AbortSignal;
};

export class MonokleValidator implements Validator {
/**
* The user configuration of this validator.
Expand Down Expand Up @@ -241,12 +270,7 @@ export class MonokleValidator implements Validator {
incremental,
baseline,
abortSignal: externalAbortSignal,
}: {
resources: Resource[];
incremental?: Incremental;
baseline?: ValidationResponse;
abortSignal?: AbortSignal;
}): Promise<ValidationResponse> {
}: ValidateParams): Promise<ValidationResponse> {
if (this._loading === undefined) {
this.load();
}
Expand Down

0 comments on commit 8fbeea7

Please sign in to comment.