/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import type { WebApi } from "azure-devops-node-api"; import type { BundleComparisonResult } from "../BundleBuddyTypes"; import type { IADOConstants } from "./Constants"; export declare class ADOSizeComparator { /** * ADO constants identifying where to fetch baseline bundle info */ private readonly adoConstants; /** * The ADO connection to use to fetch baseline bundle info */ private readonly adoConnection; /** * Path to existing local bundle size reports */ private readonly localReportPath; /** * Optional current PR build id to use, such as to tag for * later update when the baseline build has not completed */ private readonly adoBuildId; /** * Option to do fallback on commits when either there is no associated CI build or * it does not have the needed artifacts. Fallback is not attempted for other * issues, such as for a failed (but still present) CI build. This generator is * only used for fallback (it should not provide the first commit to check) */ private readonly getFallbackCommit; /** * The default number of most recent builds on the ADO pipeline to search when * looking for a build matching a baseline commit, and the default number of * fallback commits returned by the provided default fallback generator. The * most recent builds may not necessarily match the chain of commits, but * typically will when the pipeline only builds commits to main. */ private static readonly defaultBuildsToSearch; constructor( /** * ADO constants identifying where to fetch baseline bundle info */ adoConstants: IADOConstants, /** * The ADO connection to use to fetch baseline bundle info */ adoConnection: WebApi, /** * Path to existing local bundle size reports */ localReportPath: string, /** * Optional current PR build id to use, such as to tag for * later update when the baseline build has not completed */ adoBuildId: number | undefined, /** * Option to do fallback on commits when either there is no associated CI build or * it does not have the needed artifacts. Fallback is not attempted for other * issues, such as for a failed (but still present) CI build. This generator is * only used for fallback (it should not provide the first commit to check) */ getFallbackCommit?: ((startingCommit: string) => Generator) | undefined); /** * Naive fallback generator provided for convenience. It yields the commit directly * prior to the previous commit. */ static naiveFallbackCommitGenerator(startingCommit: string): Generator; /** * Create a size comparison message that can be posted to a PR * @param tagWaiting - If the build should be tagged to be updated when the baseline * build completes (if it wasn't already complete when the comparison runs) * @returns The size comparison result with formatted message and raw data. In case * of failure, the message contains the error message and the raw data will be undefined. */ createSizeComparisonMessage(tagWaiting: boolean): Promise; private tagBuildAsWaiting; private createComparisonFromZip; } //# sourceMappingURL=AdoSizeComparator.d.ts.map