codeOwner.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import {GitHubIntegrationFixture} from 'sentry-fixture/githubIntegration';
  2. import {ProjectFixture} from 'sentry-fixture/project';
  3. import {RepositoryFixture} from 'sentry-fixture/repository';
  4. import {RepositoryProjectPathConfigFixture} from 'sentry-fixture/repositoryProjectPathConfig';
  5. import type {
  6. CodeOwner,
  7. OrganizationIntegration,
  8. Repository,
  9. } from 'sentry/types/integrations';
  10. import type {Project} from 'sentry/types/project';
  11. interface CodeOwnerParams extends Partial<CodeOwner> {
  12. integration?: OrganizationIntegration;
  13. project?: Project;
  14. repo?: Repository;
  15. }
  16. export function CodeOwnerFixture({
  17. project = ProjectFixture(),
  18. repo = RepositoryFixture(),
  19. ...params
  20. }: CodeOwnerParams = {}): CodeOwner {
  21. const integration = GitHubIntegrationFixture();
  22. return {
  23. id: '1225',
  24. raw: '',
  25. dateCreated: '2022-11-18T15:05:47.450354Z',
  26. dateUpdated: '2023-02-24T18:43:08.729490Z',
  27. codeMappingId: '11',
  28. provider: 'github',
  29. codeMapping: RepositoryProjectPathConfigFixture({project, repo, integration}),
  30. codeOwnersUrl: 'https://github.com/getsentry/sentry/blob/master/.github/CODEOWNERS',
  31. ownershipSyntax: '',
  32. errors: {
  33. missing_user_emails: [],
  34. missing_external_users: [],
  35. missing_external_teams: [],
  36. teams_without_access: [],
  37. users_without_access: [],
  38. },
  39. ...params,
  40. };
  41. }