A container registry that uses the AT Protocol for manifest storage and S3 for blob storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

make sure we return annotations on multi-arch manifests

+22
+22
pkg/appview/db/queries.go
··· 310 310 } 311 311 312 312 // GetRepositoryMetadata retrieves metadata for a repository from its most recent manifest 313 + // Prioritizes manifests with non-empty metadata fields 313 314 func GetRepositoryMetadata(db *sql.DB, did string, repository string) (title, description, sourceURL, documentationURL, licenses, iconURL, readmeURL string, err error) { 314 315 var titleNull, descriptionNull, sourceURLNull, documentationURLNull, licensesNull, iconURLNull, readmeURLNull sql.NullString 315 316 317 + // Try to find a manifest with metadata first (prefer manifests with any non-empty annotation field) 316 318 err = db.QueryRow(` 317 319 SELECT title, description, source_url, documentation_url, licenses, icon_url, readme_url 318 320 FROM manifests 319 321 WHERE did = ? AND repository = ? 322 + AND ( 323 + (title IS NOT NULL AND title != '') 324 + OR (description IS NOT NULL AND description != '') 325 + OR (source_url IS NOT NULL AND source_url != '') 326 + OR (documentation_url IS NOT NULL AND documentation_url != '') 327 + OR (licenses IS NOT NULL AND licenses != '') 328 + OR (icon_url IS NOT NULL AND icon_url != '') 329 + OR (readme_url IS NOT NULL AND readme_url != '') 330 + ) 320 331 ORDER BY created_at DESC 321 332 LIMIT 1 322 333 `, did, repository).Scan(&titleNull, &descriptionNull, &sourceURLNull, &documentationURLNull, &licensesNull, &iconURLNull, &readmeURLNull) 334 + 335 + // If no manifest with metadata found, fall back to latest manifest (any type) 336 + if err == sql.ErrNoRows { 337 + err = db.QueryRow(` 338 + SELECT title, description, source_url, documentation_url, licenses, icon_url, readme_url 339 + FROM manifests 340 + WHERE did = ? AND repository = ? 341 + ORDER BY created_at DESC 342 + LIMIT 1 343 + `, did, repository).Scan(&titleNull, &descriptionNull, &sourceURLNull, &documentationURLNull, &licensesNull, &iconURLNull, &readmeURLNull) 344 + } 323 345 324 346 if err == sql.ErrNoRows { 325 347 // No manifests found - return empty strings