Files
reverse-engineering-anything/scripts/ci/change-plan.d.mts
T
morluto ff6d1d8142 ci: run only the affected portable tests on pull requests (#11346)
* ci: run only the affected portable tests on pull requests

Pull-request CI now runs static checks, the build and the portable tests a change affects, selected from test imports (through test-only helpers), same-stem and directory-scanning tests, leaf-owner boundary tests and tests that name a changed path. Shared boundaries, untraced inputs, empty selections and selections above 150 files fall back to the complete fast suite. Main pushes, schedules, releases and ci:full keep the complete suite. The portable report verifies the exact selected inventory and the CI required gate accepts a selected plan only for a fast pull request with code changes.

* ci: own leaf-adapter tests by name and keep subset summaries diagnostic
2026-11-16 03:37:15 +08:00

49 lines
1.5 KiB
TypeScript

import type { TestSelectionPlan } from "./test-selection.d.mts";
export interface ChangePlanRequest {
readonly event: string | undefined;
readonly full: boolean;
readonly skipFull: boolean;
readonly base: string | undefined;
readonly head: string | undefined;
readonly baselineReason?: string | undefined;
}
/** The Git questions a plan asks; a failure propagates as a planning failure. */
export interface ChangePlanRepository {
readonly mergeBase: (base: string, head: string) => string;
readonly isAncestor: (ancestor: string, head: string) => boolean;
readonly changedFiles: (base: string, head: string) => readonly string[];
readonly readFile: (revision: string, path: string) => string;
readonly listFiles: (
revision: string,
directories: readonly string[],
) => readonly string[];
readonly readFiles: (
revision: string,
paths: readonly string[],
) => ReadonlyMap<string, string>;
}
export type ChangePlan = Readonly<Record<string, unknown>> & {
readonly tier: "full" | "fast" | "reused";
readonly matrix: {
readonly include: readonly {
readonly os: string;
readonly platform: string;
readonly architecture: string;
}[];
};
readonly files: readonly string[];
readonly reasons: readonly string[];
readonly testSelection: TestSelectionPlan;
readonly testShards: readonly string[];
};
export function planChanges(
request: ChangePlanRequest,
repository: ChangePlanRepository,
): ChangePlan;
export function gitRepository(cwd?: string): ChangePlanRepository;