Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WEBDEV-7246: Extract item metadata #63

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

jbuckner
Copy link
Contributor

Now that we have the iaux-item-metadata package as the authoritative source of metadata, this removed the models from this repo and uses the models from that package.

Copy link

github-actions bot commented Jan 13, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://internetarchive.github.io/iaux-search-service/pr/pr-63/

Built to branch gh-pages at 2025-01-16 22:47 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link

codecov bot commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 95.81994% with 13 lines in your changes missing coverage. Please review.

Project coverage is 97.16%. Comparing base (a1303cc) to head (fe1b048).

Files with missing lines Patch % Lines
src/models/search-metadata.ts 93.58% 5 Missing ⚠️
src/models/hit-types/favorited-search-hit.ts 78.94% 4 Missing ⚠️
src/models/hit-types/web-archive-hit.ts 71.42% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           main      #63       +/-   ##
=========================================
+ Coverage      0   97.16%   +97.16%     
=========================================
  Files         0       22       +22     
  Lines         0     2754     +2754     
  Branches      0      217      +217     
=========================================
+ Hits          0     2676     +2676     
- Misses        0       66       +66     
- Partials      0       12       +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@latonv latonv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice consolidation & purge 👍

Comment on lines 80 to 86
* In bytes; computed during document construction, for collection items only.
* Optional.
*/
@Memoize() get collection_size(): typeof Metadata.prototype.collection_size {
@Memoize()
get collection_size(): typeof SearchMetadata.prototype.collection_size {
return this.rawMetadata?.fields?.collection_size != null
? new ByteField(this.rawMetadata.fields.collection_size)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking through these, it occurs to me that some of these fields are properties of search documents and not necessarily of actual item metadata. The distinction is probably not super meaningful given the way these are used, but figured it might be worth mentioning in case there's a desire to more clearly document the difference where these properties exist in the new item-metadata repo. (num_favorites is perhaps another example)

Comment on lines 8 to 11
export class SearchMetadata extends Metadata {
/**
* some extra fields for "favorited_search" hits
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for splitting these out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants