您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

branch-like.ts 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2024 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. import { NewCodeDefinition } from './new-code-definition';
  21. import { QualityGateStatusCondition } from './quality-gates';
  22. import { Status } from './types';
  23. export interface Branch {
  24. analysisDate?: string;
  25. excludedFromPurge: boolean;
  26. isMain: boolean;
  27. name: string;
  28. status?: { qualityGateStatus: Status };
  29. }
  30. export interface MainBranch extends Branch {
  31. isMain: true;
  32. }
  33. export interface PullRequest {
  34. analysisDate?: string;
  35. base: string;
  36. branch: string;
  37. key: string;
  38. isOrphan?: true;
  39. status?: { qualityGateStatus: Status };
  40. target: string;
  41. title: string;
  42. url?: string;
  43. }
  44. export type BranchLike = Branch | PullRequest;
  45. export interface BranchTree {
  46. branch: Branch;
  47. pullRequests: PullRequest[];
  48. }
  49. export interface BranchLikeTree {
  50. mainBranchTree?: BranchTree;
  51. branchTree: BranchTree[];
  52. parentlessPullRequests: PullRequest[];
  53. orphanPullRequests: PullRequest[];
  54. }
  55. export type BranchParameters = { branch?: string } | { pullRequest?: string };
  56. export interface BranchWithNewCodePeriod extends Branch {
  57. newCodePeriod?: NewCodeDefinition;
  58. }
  59. export interface BranchStatusData {
  60. conditions?: QualityGateStatusCondition[];
  61. ignoredConditions?: boolean;
  62. status?: Status;
  63. }