Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 81 additions & 10 deletions bin/pushgate.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 20 additions & 2 deletions src/runner/deterministic-plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ export interface DeterministicCheckRunResult {
transcriptResult: DeterministicTranscriptCheckResult;
}

export interface DeterministicCheckDisplay {
label: string;
detail?: string;
}

export interface DeterministicCheckPlanEntry {
display: DeterministicCheckDisplay;
failFast: boolean;
run(
context: DeterministicCheckExecutionContext,
Expand Down Expand Up @@ -83,6 +89,9 @@ function buildBuiltInPolicyEntry(options: {
transformDetail?: (detail: string | undefined) => string | undefined;
}): DeterministicCheckPlanEntry {
return {
display: {
label: options.label,
},
failFast: false,
async run(context) {
const result = runBuiltInPolicies(
Expand Down Expand Up @@ -124,6 +133,10 @@ function buildGitleaksPluginEntry(
plugin: GitleaksPluginConfig,
): DeterministicCheckPlanEntry {
return {
display: {
detail: "gitleaks",
label: "Secrets scan",
},
failFast: plugin.fail_fast,
async run(context) {
const name = "plugin:gitleaks";
Expand Down Expand Up @@ -156,7 +169,12 @@ function buildGitleaksPluginEntry(
}

function buildConfiguredToolEntry(tool: ToolConfig): DeterministicCheckPlanEntry {
const label = humanizeIdentifier(tool.name);

return {
display: {
label,
},
failFast: tool.fail_fast,
async run(context) {
const selectedPaths = selectToolChangedFilePaths(
Expand All @@ -166,7 +184,7 @@ function buildConfiguredToolEntry(tool: ToolConfig): DeterministicCheckPlanEntry

if (tool.run === "changed_files" && selectedPaths.length === 0) {
return checkResult({
label: humanizeIdentifier(tool.name),
label,
result: {
name: tool.name,
status: "skipped",
Expand All @@ -191,7 +209,7 @@ function buildConfiguredToolEntry(tool: ToolConfig): DeterministicCheckPlanEntry
};

return checkResult({
label: humanizeIdentifier(tool.name),
label,
result,
});
},
Expand Down
2 changes: 1 addition & 1 deletion src/runner/deterministic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export async function runDeterministicChecks(
request.changedFileResolution,
);

transcript.writeStart(runPlan.length);
transcript.writeStart(runPlan.map((entry) => entry.display));

for (const entry of runPlan) {
const entryResult = await entry.run({
Expand Down
Loading
Loading