release.tsx 4.1 KB

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