repositoryProjectPathConfig.ts 859 B

12345678910111213141516171819202122232425262728293031
  1. import type {
  2. Integration,
  3. Repository,
  4. RepositoryProjectPathConfig,
  5. } from 'sentry/types/integrations';
  6. import type {Project} from 'sentry/types/project';
  7. interface RepositoryProjectPathConfigArgs extends Partial<RepositoryProjectPathConfig> {
  8. integration: Pick<Integration, 'id' | 'provider'>;
  9. project: Pick<Project, 'id' | 'slug'>;
  10. repo: Pick<Repository, 'id' | 'name'>;
  11. }
  12. export function RepositoryProjectPathConfigFixture(
  13. params: RepositoryProjectPathConfigArgs
  14. ): RepositoryProjectPathConfig {
  15. const {project, repo, integration, ...rest} = params;
  16. return {
  17. id: '2',
  18. projectId: project.id,
  19. projectSlug: project.slug,
  20. repoId: repo.id,
  21. repoName: repo.name,
  22. integrationId: integration.id,
  23. provider: integration.provider,
  24. stackRoot: '',
  25. sourceRoot: '',
  26. defaultBranch: 'master',
  27. ...rest,
  28. };
  29. }