release.tsx 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. projects: ReleaseProject[];
  114. releaseFileCount: number;
  115. released: string;
  116. version: string;
  117. versionInfo: VersionInfo;
  118. };
  119. /**
  120. * Release health
  121. */
  122. export type Health = {
  123. adoption: number | null;
  124. crashFreeSessions: number | null;
  125. crashFreeUsers: number | null;
  126. durationP50: number | null;
  127. durationP90: number | null;
  128. hasHealthData: boolean;
  129. sessionsAdoption: number | null;
  130. sessionsCrashed: number;
  131. sessionsErrored: number;
  132. stats: HealthGraphData;
  133. totalProjectSessions24h: number | null;
  134. totalProjectUsers24h: number | null;
  135. totalSessions: number;
  136. totalSessions24h: number | null;
  137. totalUsers: number;
  138. totalUsers24h: number | null;
  139. };
  140. export type HealthGraphData = Record<string, TimeseriesValue[]>;
  141. export enum ReleaseComparisonChartType {
  142. CRASH_FREE_USERS = 'crashFreeUsers',
  143. HEALTHY_USERS = 'healthyUsers',
  144. ABNORMAL_USERS = 'abnormalUsers',
  145. ERRORED_USERS = 'erroredUsers',
  146. CRASHED_USERS = 'crashedUsers',
  147. CRASH_FREE_SESSIONS = 'crashFreeSessions',
  148. HEALTHY_SESSIONS = 'healthySessions',
  149. ABNORMAL_SESSIONS = 'abnormalSessions',
  150. ERRORED_SESSIONS = 'erroredSessions',
  151. CRASHED_SESSIONS = 'crashedSessions',
  152. SESSION_COUNT = 'sessionCount',
  153. USER_COUNT = 'userCount',
  154. ERROR_COUNT = 'errorCount',
  155. TRANSACTION_COUNT = 'transactionCount',
  156. FAILURE_RATE = 'failureRate',
  157. }
  158. export enum HealthStatsPeriodOption {
  159. AUTO = 'auto',
  160. TWENTY_FOUR_HOURS = '24h',
  161. }
  162. export type CrashFreeTimeBreakdown = {
  163. crashFreeSessions: number | null;
  164. crashFreeUsers: number | null;
  165. date: string;
  166. totalSessions: number;
  167. totalUsers: number;
  168. }[];