Skip to content
Snippets Groups Projects
Select Git revision
  • 2f432626f0b9981f5b424616351c9c0959c56774
  • main default protected
  • renovate/main-ghcr.io-renovatebot-base-image-10.x
  • renovate/main-ghcr.io-containerbase-devcontainer-13.x
  • next
  • revert-31645-feat/rename-gradle-wrapper-validation-action
  • renovate/main-redis-5.x
  • fix/36615b-branch-reuse-no-cache
  • chore/punycode
  • fix/36615-branch-reuse-bug
  • refactor/pin-new-value
  • feat/36219--git-x509-signing
  • feat/structured-logger
  • hotfix/39.264.1
  • feat/skip-dangling
  • gh-readonly-queue/next/pr-36034-7a061c4ca1024a19e2c295d773d9642625d1c2be
  • hotfix/39.238.3
  • refactor/gitlab-auto-approve
  • feat/template-strings
  • gh-readonly-queue/next/pr-35654-137d934242c784e0c45d4b957362214f0eade1d7
  • fix/32307-global-extends-merging
  • 41.31.1
  • 41.31.0
  • 41.30.5
  • 41.30.4
  • 41.30.3
  • 41.30.2
  • 41.30.1
  • 41.30.0
  • 41.29.1
  • 41.29.0
  • 41.28.2
  • 41.28.1
  • 41.28.0
  • 41.27.1
  • 41.27.0
  • 41.26.2
  • 41.26.1
  • 41.26.0
  • 41.25.1
  • 41.25.0
41 results

status-checks.spec.ts

Blame
  • index.ts 31.09 KiB
    import URL, { URLSearchParams } from 'url';
    import is from '@sindresorhus/is';
    
    import delay from 'delay';
    import { configFileNames } from '../../config/app-strings';
    import { RenovateConfig } from '../../config/common';
    import {
      PLATFORM_AUTHENTICATION_ERROR,
      REPOSITORY_ACCESS_FORBIDDEN,
      REPOSITORY_ARCHIVED,
      REPOSITORY_CHANGED,
      REPOSITORY_DISABLED,
      REPOSITORY_EMPTY,
      REPOSITORY_MIRRORED,
      REPOSITORY_NOT_FOUND,
    } from '../../constants/error-messages';
    import { PLATFORM_TYPE_GITLAB } from '../../constants/platforms';
    import { PR_STATE_ALL, PR_STATE_OPEN } from '../../constants/pull-requests';
    import { logger } from '../../logger';
    import { BranchStatus } from '../../types';
    import * as hostRules from '../../util/host-rules';
    import { HttpResponse } from '../../util/http';
    import { GitlabHttp, setBaseUrl } from '../../util/http/gitlab';
    import { sanitize } from '../../util/sanitize';
    import { ensureTrailingSlash } from '../../util/url';
    import {
      BranchStatusConfig,
      CommitFilesConfig,
      CreatePRConfig,
      EnsureCommentConfig,
      EnsureCommentRemovalConfig,
      EnsureIssueConfig,
      FindPRConfig,
      Issue,
      PlatformConfig,
      Pr,
      RepoConfig,
      RepoParams,
      VulnerabilityAlert,
    } from '../common';
    import GitStorage, { StatusResult } from '../git/storage';
    import { smartTruncate } from '../utils/pr-body';
    
    const gitlabApi = new GitlabHttp();
    
    type MergeMethod = 'merge' | 'rebase_merge' | 'ff';
    const defaultConfigFile = configFileNames[0];
    let config: {
      storage: GitStorage;
      repository: string;
      localDir: string;
      defaultBranch: string;
      baseBranch: string;
      email: string;
      prList: any[];
      issueList: any[];
      optimizeForDisabled: boolean;
      mergeMethod: MergeMethod;
    } = {} as any;
    
    const defaults = {
      hostType: PLATFORM_TYPE_GITLAB,
      endpoint: 'https://gitlab.com/api/v4/',
    };
    
    let authorId: number;
    
    export async function initPlatform({
      endpoint,
      token,