release.tsx 4.3 KB

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