import { Disposable, IDisposable, ReferenceCollection } from "../../../../../base/common/lifecycle.js"; import { IObservable } from "../../../../../base/common/observable.js"; import { ILogService } from "../../../../../platform/log/common/log.service.js"; import { ApiRequestOptions } from "@codingame/monaco-vscode-github-service-override/vscode/vs/platform/github/common/client/request"; import { RequiredPullRequestChecks } from "../../../../../platform/github/common/pullRequestRequiredChecks.js"; import { IStorageService } from "../../../../../platform/storage/common/storage.service.js"; import { GitHubCIOverallStatus, IGitHubCICheck } from "../../common/types.js"; import { GitHubApiClient } from "../githubApiClient.js"; import { GitHubPRCIFetcher } from "../fetchers/githubPRCIFetcher.js"; import { IPullRequestChecksSource } from "../fetchers/githubPRChecksSource.js"; export declare class GitHubPullRequestCIModelReferenceCollection extends ReferenceCollection { private readonly _checksSource; private readonly _logService; private readonly _storageService; private readonly _fetcher; constructor(apiClient: GitHubApiClient, _checksSource: IPullRequestChecksSource, _logService: ILogService, _storageService: IStorageService); protected createReferencedObject(key: string, owner: string, repo: string, prNumber: number, headSha: string): GitHubPullRequestCIModel; protected destroyReferencedObject(key: string, object: GitHubPullRequestCIModel): void; } /** CI status for a pull request head with coalesced refresh and periodic polling. */ export declare class GitHubPullRequestCIModel extends Disposable { readonly owner: string; readonly repo: string; readonly prNumber: number; readonly headSha: string; private readonly _fetcher; private readonly _logService; private readonly _storageService; private readonly _checksSource; private readonly _token; private readonly _checks; /** Every check run reported for the head, whether it counts or not. */ readonly checks: IObservable; private readonly _requiredChecksSubscription; private _requiredChecksHandle; private readonly _pullRequestChecks; /** The checks of this head as the shared pull request resources read them, or `undefined` while they load. */ private readonly _headChecks; /** * Which checks of the head count, and how they stand, decided as on every * other pull request surface (see {@link classifyRequiredPullRequestChecks}). * Its failed checks are the ones Fix Checks repairs. `undefined` while they * load. */ readonly requiredChecks: IObservable; /** The state of the checks that count (see {@link getRequiredPullRequestChecksStatus}), or loading. */ readonly overallStatus: IObservable; private readonly _fixRequested; /** * Whether the user has already requested a CI fix for this PR head SHA. * Resets automatically once a new commit lands (a new model is created for * the new head SHA) so the "Fix Checks" action surfaces again. */ readonly fixRequested: IObservable; private _refreshPromise; private _refreshPriority; private _refreshVersion; private _pollingClientCount; private readonly _pollScheduler; /** `${owner}/${repo}/${prNumber}` — stable across commits to the same PR. */ private readonly _prKey; constructor(owner: string, repo: string, prNumber: number, headSha: string, _fetcher: GitHubPRCIFetcher, _logService: ILogService, _storageService: IStorageService, _checksSource: IPullRequestChecksSource); /** * Remember that the user requested a CI fix for the current head SHA so the * "Fix Checks" action is suppressed until a new commit lands on the PR. */ markFixRequested(): void; private _readFixRequested; private _readFixRequestedMap; /** Refreshes CI checks. */ refresh(force?: boolean, options?: ApiRequestOptions): Promise; private _refresh; /** * Get annotations (structured logs) for a specific check run. */ getCheckRunAnnotations(checkRunId: number): Promise; /** * Follows which checks count, from the shared pull request resources, which * keep them current on their own. Until they are read, the checks' state is * loading. */ private _subscribeRequiredChecks; private _logRequiredChecksError; /** * Rerun a failed check by extracting the workflow run ID from its details URL * and calling the GitHub Actions rerun-failed-jobs API, then refresh status. */ rerunFailedCheck(check: IGitHubCICheck): Promise; /** * Start periodic polling. Each cycle refreshes CI check data. */ startPolling(intervalMs?: number): IDisposable; private _poll; } /** * Extract the GitHub Actions workflow run ID from a check run's details URL. * URLs follow the pattern: `https://github.com/{owner}/{repo}/actions/runs/{run_id}/job/{job_id}` */ export declare function parseWorkflowRunId(detailsUrl: string | undefined): number | undefined;