import type { BranchStatus } from '../../../types'; import type { BranchStatusConfig, CreatePRConfig, EnsureCommentConfig, EnsureCommentRemovalConfigByContent, EnsureCommentRemovalConfigByTopic, EnsureIssueConfig, EnsureIssueResult, FindPRConfig, Issue, MergePRConfig, PlatformParams, PlatformResult, Pr, RepoParams, RepoResult, UpdatePrConfig } from '../types'; import type { GerritLabelTypeInfo, GerritProjectInfo } from './types'; export declare const id = "gerrit"; declare let config: { repository?: string; head?: string; config?: GerritProjectInfo; labels: Record; gerritUsername?: string; }; export declare function writeToConfig(newConfig: typeof config): void; export declare function initPlatform({ endpoint, username, password, }: PlatformParams): Promise; /** * Get all state="ACTIVE" and type="CODE" repositories from gerrit */ export declare function getRepos(): Promise; /** * Clone repository to local directory * @param config */ export declare function initRepo({ repository, gitUrl, }: RepoParams): Promise; export declare function findPr(findPRConfig: FindPRConfig, refreshCache?: boolean): Promise; export declare function getPr(number: number): Promise; export declare function updatePr(prConfig: UpdatePrConfig): Promise; export declare function createPr(prConfig: CreatePRConfig): Promise; export declare function getBranchPr(branchName: string): Promise; export declare function getPrList(): Promise; export declare function mergePr(config: MergePRConfig): Promise; /** * BranchStatus for Gerrit assumes that the branchName refers to a change. * @param branchName */ export declare function getBranchStatus(branchName: string): Promise; /** * check the gerrit-change for the presence of the corresponding "$context" Gerrit label if configured, * return 'yellow' if not configured or not set * @param branchName * @param context renovate/stability-days || ... */ export declare function getBranchStatusCheck(branchName: string, context: string): Promise; /** * Apply the branch state $context to the corresponding gerrit label (if available) * context === "renovate/stability-days" / "renovate/merge-confidence" and state === "green"/... * @param branchStatusConfig */ export declare function setBranchStatus(branchStatusConfig: BranchStatusConfig): Promise; export declare function getRawFile(fileName: string, repoName?: string, branchOrTag?: string): Promise; export declare function getJsonFile(fileName: string, repoName?: string, branchOrTag?: string): Promise; export declare function addReviewers(number: number, reviewers: string[]): Promise; /** * add "CC" (only one possible) */ export declare function addAssignees(number: number, assignees: string[]): Promise; export declare function ensureComment(ensureComment: EnsureCommentConfig): Promise; export declare function massageMarkdown(prBody: string): string; export declare function deleteLabel(number: number, label: string): Promise; export declare function ensureCommentRemoval(ensureCommentRemoval: EnsureCommentRemovalConfigByTopic | EnsureCommentRemovalConfigByContent): Promise; export declare function ensureIssueClosing(title: string): Promise; export declare function ensureIssue(issueConfig: EnsureIssueConfig): Promise; export declare function findIssue(title: string): Promise; export declare function getIssueList(): Promise; export {};