(ctx context.Context, repoID string)
| 236 | } |
| 237 | |
| 238 | func (s *sqlDatabase) GetRepositoryByID(ctx context.Context, repoID string) (params.Repository, error) { |
| 239 | preloadList := []string{ |
| 240 | "Pools", |
| 241 | "Credentials", |
| 242 | "Endpoint", |
| 243 | "Credentials.Endpoint", |
| 244 | "GiteaCredentials", |
| 245 | "GiteaCredentials.Endpoint", |
| 246 | "Events", |
| 247 | } |
| 248 | repo, err := s.getRepoByID(ctx, s.conn, repoID, preloadList...) |
| 249 | if err != nil { |
| 250 | return params.Repository{}, fmt.Errorf("error fetching repo: %w", err) |
| 251 | } |
| 252 | |
| 253 | param, err := s.sqlToCommonRepository(repo, true) |
| 254 | if err != nil { |
| 255 | return params.Repository{}, fmt.Errorf("error fetching repo: %w", err) |
| 256 | } |
| 257 | return param, nil |
| 258 | } |
| 259 | |
| 260 | func (s *sqlDatabase) getRepo(_ context.Context, owner, name, endpointName string) (Repository, error) { |
| 261 | var repo Repository |
no test coverage detected