/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import { MonoRepo, type Package } from "@fluidframework/build-tools"; import type { Context } from "./context.js"; /** * An async function that executes a release preparation check. The function returns a {@link CheckResult} with details * about the results of the check. * * Example checks might include: * * - Branch has no local changes * - The local branch is up to date with the remote * - Dependencies are installed locally * - No repo policy violations */ export type CheckFunction = ( /** * The repository context. */ context: Context, /** * The release group or package that is being checked. * * @privateRemarks * In this case the MonoRepo class represents a release group. This naming and conceptual conflict will be resolved in * future refactoring. */ releaseGroupOrPackage: MonoRepo | Package) => Promise; /** * The result of a failing {@link CheckFunction}. */ export interface CheckResultFailure { /** * A message explaining the failure. This value is displayed to the user when the check fails. */ message: string; /** * A terminal command that can be used to resolve the failure. This value is suggested to the user when the check * fails, with the expectation that running it will resolve the failed check. */ fixCommand?: string; /** * If true, the failure will stop all further checks. Setting this to `true` should be reserved for cases where * continuing might result in making unrecoverable changes to the branch or repository state. */ fatal?: true; } /** * The results of a {@link CheckFunction}. If a CheckResult is `true`, then the check succeeded. Otherwise the result is * a {@link CheckResultFailure}. */ type CheckResult = CheckResultFailure | undefined; /** * Checks that there are no local changes in the local repository. This failure is fatal to ensure changes aren't lost. * * @param context - The repository context. * @returns a {@link CheckResultSuccess} if there are no local changes. Otherwise, returns a {@link CheckResultFailure}. */ export declare const CheckNoLocalChanges: CheckFunction; /** * Checks that the dependencies for a release group or package are installed. Returns a failure result if any * dependencies are missing. */ export declare const CheckDependenciesInstalled: CheckFunction; /** * Checks that the local git repository has a remote for the microsoft/FluidFramework repo, and that the local branch is * up-to-date with the remote. Returns a failure result if such a remote is not found, or if the local branch is not * up-to-date. */ export declare const CheckHasRemoteBranchUpToDate: CheckFunction; /** * Returns true if the release group/package has no prerelease dependencies on other Fluid packages. */ /** * Checks that the release group or package has no prerelease dependencies on other Fluid packages. Returns a failure * result if prerelease dependencies are found. */ export declare const CheckHasNoPrereleaseDependencies: CheckFunction; /** * Checks that repository policies are all passing. Any failing policies will cause this function to return a failure * result. */ export declare const CheckNoPolicyViolations: CheckFunction; /** * Checks that all asserts are tagged. Any untagged asserts will return a failure result. */ export declare const CheckNoUntaggedAsserts: CheckFunction; export {}; //# sourceMappingURL=releasePrepChecks.d.ts.map