codeOwner.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import {GitHubIntegration} from 'sentry-fixture/githubIntegration';
  2. import {Project} from 'sentry-fixture/project';
  3. import {Repository} from 'sentry-fixture/repository';
  4. import {RepositoryProjectPathConfig} from 'sentry-fixture/repositoryProjectPathConfig';
  5. import type {
  6. CodeOwner as TCodeOwner,
  7. OrganizationIntegration,
  8. Project as TProject,
  9. Repository as TRepository,
  10. } from 'sentry/types';
  11. interface CodeOwnerParams extends Partial<TCodeOwner> {
  12. integration?: OrganizationIntegration;
  13. project?: TProject;
  14. repo?: TRepository;
  15. }
  16. export function CodeOwner({
  17. project = Project(),
  18. repo = Repository(),
  19. integration = GitHubIntegration(),
  20. ...params
  21. }: CodeOwnerParams = {}): TCodeOwner {
  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: RepositoryProjectPathConfig({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. }