release.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import {CommitFixture} from 'sentry-fixture/commit';
  2. import {HealthFixture} from 'sentry-fixture/health';
  3. import type {Health, ReleaseWithHealth} from 'sentry/types/release';
  4. import {ReleaseStatus} from 'sentry/types/release';
  5. export function ReleaseFixture(
  6. params?: Partial<ReleaseWithHealth>,
  7. healthParams?: Health
  8. ): ReleaseWithHealth {
  9. return {
  10. newGroups: 0,
  11. commitCount: 0,
  12. url: '',
  13. data: {},
  14. lastDeploy: {
  15. dateFinished: '',
  16. dateStarted: '',
  17. environment: '',
  18. id: '',
  19. name: '',
  20. url: '',
  21. version: '',
  22. },
  23. deployCount: 0,
  24. shortVersion: '',
  25. fileCount: 0,
  26. status: ReleaseStatus.ACTIVE,
  27. dateCreated: '2020-03-23T01:02:30Z',
  28. dateReleased: '',
  29. id: '',
  30. lastEvent: '2020-03-24T02:04:50Z',
  31. version: 'sentry-android-shop@1.2.0',
  32. firstEvent: '',
  33. lastCommit: CommitFixture(),
  34. authors: [],
  35. owner: null,
  36. versionInfo: {
  37. buildHash: null,
  38. version: {
  39. pre: null,
  40. raw: '1.2.0',
  41. major: 1,
  42. minor: 2,
  43. buildCode: null,
  44. patch: 0,
  45. components: 3,
  46. },
  47. description: '1.2.0',
  48. package: 'sentry-android-shop',
  49. },
  50. ref: '',
  51. projects: [
  52. {
  53. healthData: HealthFixture(),
  54. id: 4383603,
  55. name: 'Sentry-Android-Shop',
  56. slug: 'sentry-android-shop',
  57. platform: 'android',
  58. newGroups: 3,
  59. platforms: [],
  60. hasHealthData: true,
  61. ...healthParams,
  62. },
  63. ],
  64. currentProjectMeta: {
  65. nextReleaseVersion: '456',
  66. prevReleaseVersion: '123',
  67. firstReleaseVersion: '0',
  68. lastReleaseVersion: '999',
  69. sessionsUpperBound: null,
  70. sessionsLowerBound: null,
  71. },
  72. adoptionStages: {
  73. 'sentry-android-shop': {
  74. adopted: '2020-03-24T01:02:30Z',
  75. stage: 'replaced',
  76. unadopted: '2020-03-24T02:02:30Z',
  77. },
  78. },
  79. ...params,
  80. };
  81. }