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. }
  87. export type CurrentRelease = {
  88. environment: string;
  89. firstSeen: string;
  90. lastSeen: string;
  91. release: Release;
  92. stats: {
  93. // 24h/30d is hardcoded in GroupReleaseWithStatsSerializer
  94. '24h': TimeseriesValue[];
  95. '30d': TimeseriesValue[];
  96. };
  97. };
  98. export type ReleaseProject = {
  99. hasHealthData: boolean;
  100. id: number;
  101. name: string;
  102. newGroups: number;
  103. platform: PlatformKey;
  104. platforms: PlatformKey[];
  105. slug: string;
  106. healthData?: Health;
  107. };
  108. export type ReleaseMeta = {
  109. commitCount: number;
  110. commitFilesChanged: number;
  111. deployCount: number;
  112. projects: ReleaseProject[];
  113. releaseFileCount: number;
  114. released: string;
  115. version: string;
  116. versionInfo: VersionInfo;
  117. };
  118. /**
  119. * Release health
  120. */
  121. export type Health = {
  122. adoption: number | null;
  123. crashFreeSessions: number | null;
  124. crashFreeUsers: number | null;
  125. durationP50: number | null;
  126. durationP90: number | null;
  127. hasHealthData: boolean;
  128. sessionsAdoption: number | null;
  129. sessionsCrashed: number;
  130. sessionsErrored: number;
  131. stats: HealthGraphData;
  132. totalProjectSessions24h: number | null;
  133. totalProjectUsers24h: number | null;
  134. totalSessions: number;
  135. totalSessions24h: number | null;
  136. totalUsers: number;
  137. totalUsers24h: number | null;
  138. };
  139. export type HealthGraphData = Record<string, TimeseriesValue[]>;
  140. export enum ReleaseComparisonChartType {
  141. CRASH_FREE_USERS = 'crashFreeUsers',
  142. HEALTHY_USERS = 'healthyUsers',
  143. ABNORMAL_USERS = 'abnormalUsers',
  144. ERRORED_USERS = 'erroredUsers',
  145. CRASHED_USERS = 'crashedUsers',
  146. CRASH_FREE_SESSIONS = 'crashFreeSessions',
  147. HEALTHY_SESSIONS = 'healthySessions',
  148. ABNORMAL_SESSIONS = 'abnormalSessions',
  149. ERRORED_SESSIONS = 'erroredSessions',
  150. CRASHED_SESSIONS = 'crashedSessions',
  151. SESSION_COUNT = 'sessionCount',
  152. USER_COUNT = 'userCount',
  153. ERROR_COUNT = 'errorCount',
  154. TRANSACTION_COUNT = 'transactionCount',
  155. FAILURE_RATE = 'failureRate',
  156. SESSION_DURATION = 'sessionDuration',
  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. }[];