release.tsx 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. import type {PlatformKey} from 'sentry/data/platformCategories';
  2. import type {TimeseriesValue} from './core';
  3. import type {Commit} from './integrations';
  4. import type {User} from './user';
  5. export enum ReleaseStatus {
  6. ACTIVE = 'open',
  7. ARCHIVED = 'archived',
  8. }
  9. export type SourceMapsArchive = {
  10. date: string;
  11. fileCount: number;
  12. id: number;
  13. name: string;
  14. type: 'release';
  15. };
  16. export type Artifact = {
  17. dateCreated: string;
  18. dist: string | null;
  19. headers: {'Content-Type': string} | {};
  20. id: string;
  21. name: string;
  22. sha1: string;
  23. size: number;
  24. };
  25. export type Deploy = {
  26. dateFinished: string;
  27. dateStarted: string;
  28. environment: string;
  29. id: string;
  30. name: string;
  31. url: string;
  32. version: string;
  33. };
  34. export type VersionInfo = {
  35. buildHash: string | null;
  36. description: string;
  37. package: string | null;
  38. version: {raw: string};
  39. };
  40. export interface BaseRelease {
  41. dateCreated: string;
  42. dateReleased: string;
  43. id: string;
  44. ref: string;
  45. shortVersion: string;
  46. status: ReleaseStatus;
  47. url: string;
  48. version: string;
  49. }
  50. export interface Release extends BaseRelease, ReleaseData {
  51. projects: ReleaseProject[];
  52. }
  53. export interface ReleaseWithHealth extends BaseRelease, ReleaseData {
  54. projects: Required<ReleaseProject>[];
  55. }
  56. interface ReleaseData {
  57. authors: User[];
  58. commitCount: number;
  59. currentProjectMeta: {
  60. firstReleaseVersion: string | null;
  61. lastReleaseVersion: string | null;
  62. nextReleaseVersion: string | null;
  63. prevReleaseVersion: string | null;
  64. sessionsLowerBound: string | null;
  65. sessionsUpperBound: string | null;
  66. };
  67. data: {};
  68. deployCount: number;
  69. fileCount: number | null;
  70. firstEvent: string;
  71. lastEvent: string;
  72. // TODO(ts)
  73. newGroups: number;
  74. versionInfo: VersionInfo;
  75. adoptionStages?: Record<
  76. string,
  77. {
  78. adopted: string | null;
  79. stage: string | null;
  80. unadopted: string | null;
  81. }
  82. >;
  83. lastCommit?: Commit;
  84. lastDeploy?: Deploy;
  85. owner?: any;
  86. userAgent?: string;
  87. }
  88. export type CurrentRelease = {
  89. environment: string;
  90. firstSeen: string;
  91. lastSeen: string;
  92. release: Release;
  93. stats: {
  94. // 24h/30d is hardcoded in GroupReleaseWithStatsSerializer
  95. '24h': TimeseriesValue[];
  96. '30d': TimeseriesValue[];
  97. };
  98. };
  99. export type ReleaseProject = {
  100. hasHealthData: boolean;
  101. id: number;
  102. name: string;
  103. newGroups: number;
  104. platform: PlatformKey;
  105. platforms: PlatformKey[];
  106. slug: string;
  107. healthData?: Health;
  108. };
  109. export type ReleaseMeta = {
  110. commitCount: number;
  111. commitFilesChanged: number;
  112. deployCount: number;
  113. isArtifactBundle: boolean;
  114. projects: ReleaseProject[];
  115. releaseFileCount: number;
  116. released: string;
  117. version: string;
  118. versionInfo: VersionInfo;
  119. };
  120. /**
  121. * Release health
  122. */
  123. export type Health = {
  124. adoption: number | null;
  125. crashFreeSessions: number | null;
  126. crashFreeUsers: number | null;
  127. durationP50: number | null;
  128. durationP90: number | null;
  129. hasHealthData: boolean;
  130. sessionsAdoption: number | null;
  131. sessionsCrashed: number;
  132. sessionsErrored: number;
  133. stats: HealthGraphData;
  134. totalProjectSessions24h: number | null;
  135. totalProjectUsers24h: number | null;
  136. totalSessions: number;
  137. totalSessions24h: number | null;
  138. totalUsers: number;
  139. totalUsers24h: number | null;
  140. };
  141. export type HealthGraphData = Record<string, TimeseriesValue[]>;
  142. export enum ReleaseComparisonChartType {
  143. CRASH_FREE_USERS = 'crashFreeUsers',
  144. HEALTHY_USERS = 'healthyUsers',
  145. ABNORMAL_USERS = 'abnormalUsers',
  146. ERRORED_USERS = 'erroredUsers',
  147. CRASHED_USERS = 'crashedUsers',
  148. CRASH_FREE_SESSIONS = 'crashFreeSessions',
  149. HEALTHY_SESSIONS = 'healthySessions',
  150. ABNORMAL_SESSIONS = 'abnormalSessions',
  151. ERRORED_SESSIONS = 'erroredSessions',
  152. CRASHED_SESSIONS = 'crashedSessions',
  153. SESSION_COUNT = 'sessionCount',
  154. USER_COUNT = 'userCount',
  155. ERROR_COUNT = 'errorCount',
  156. TRANSACTION_COUNT = 'transactionCount',
  157. FAILURE_RATE = 'failureRate',
  158. }
  159. export enum HealthStatsPeriodOption {
  160. AUTO = 'auto',
  161. TWENTY_FOUR_HOURS = '24h',
  162. }
  163. export type CrashFreeTimeBreakdown = {
  164. crashFreeSessions: number | null;
  165. crashFreeUsers: number | null;
  166. date: string;
  167. totalSessions: number;
  168. totalUsers: number;
  169. }[];