codeOwner.ts 1.3 KB

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