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 type BaseRelease = {
  41. dateCreated: string;
  42. dateReleased: string;
  43. ref: string;
  44. shortVersion: string;
  45. status: ReleaseStatus;
  46. url: string;
  47. version: string;
  48. };
  49. export type Release = BaseRelease &
  50. ReleaseData & {
  51. projects: ReleaseProject[];
  52. };
  53. export type ReleaseWithHealth = BaseRelease &
  54. ReleaseData & {
  55. projects: Required<ReleaseProject>[];
  56. };
  57. type ReleaseData = {
  58. authors: User[];
  59. commitCount: number;
  60. currentProjectMeta: {
  61. firstReleaseVersion: string | null;
  62. lastReleaseVersion: string | null;
  63. nextReleaseVersion: string | null;
  64. prevReleaseVersion: string | null;
  65. sessionsLowerBound: string | null;
  66. sessionsUpperBound: string | null;
  67. };
  68. data: {};
  69. deployCount: number;
  70. fileCount: number | null;
  71. firstEvent: string;
  72. lastEvent: string;
  73. // TODO(ts)
  74. newGroups: number;
  75. versionInfo: VersionInfo;
  76. adoptionStages?: Record<
  77. 'string',
  78. {
  79. adopted: string | null;
  80. stage: string | null;
  81. unadopted: string | null;
  82. }
  83. >;
  84. lastCommit?: Commit;
  85. lastDeploy?: Deploy;
  86. owner?: any;
  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. SESSION_DURATION = 'sessionDuration',
  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. }[];