Skip to content

add metadata to title#298

Open
elfkuzco wants to merge 2 commits into
mainfrom
title-metadata
Open

add metadata to title#298
elfkuzco wants to merge 2 commits into
mainfrom
title-metadata

Conversation

@elfkuzco
Copy link
Copy Markdown
Contributor

@elfkuzco elfkuzco commented May 25, 2026

Rationale

This PR adds metadata information to CMS titles. This allows having a central store for common metadata for all books belonging to a title.

Changes

  • add various columns for storing metadata information
  • add warnings column for storing warning-level messages to books. These warnings do not prevent a book from being acted upon by shuttle or cms but they prevent the book from being moved to prod even if it's maturity is stable
  • update code to create/update title with necessary metadata
  • implement views to create/update title and to sync title metadata from a book's metadata
  • use title metadata as source of truth (if it exists) while generating catalog XML
Screenshot_20260526_160448 Screenshot_20260525_161544 Screenshot_20260525_161531 Screenshot_20260525_161522 Screenshot_20260525_161510

This closes #292

@elfkuzco elfkuzco self-assigned this May 25, 2026
@elfkuzco elfkuzco requested a review from benoit74 May 25, 2026 15:48
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

❌ Patch coverage is 97.14286% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.21%. Comparing base (fbc5c28) to head (cdd95f5).

Files with missing lines Patch % Lines
backend/src/cms_backend/api/routes/fields.py 75.00% 2 Missing ⚠️
backend/src/cms_backend/db/book.py 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #298      +/-   ##
==========================================
+ Coverage   81.52%   82.21%   +0.69%     
==========================================
  Files          58       58              
  Lines        2571     2694     +123     
  Branches      259      272      +13     
==========================================
+ Hits         2096     2215     +119     
- Misses        405      408       +3     
- Partials       70       71       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

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

Thank you!

First of all, we do not want to ask for metadata when creating a title, they will be populated by first book "entering" the title.

I'm also not convinced by the book warnings property naming ; wondering if issues is not a better naming at this stage, but I'm not totally bought by this.

Finally, I don't think that current UI is correct. I find the fact that we have the capability to "sync" book metadata to title in the book details a bit disturbing. First the "sync" word is confusing because it is hard to guess in which direction the copy will happen. Second the fact this must be done on the book while we edit title metadata is confusing as well. I also don't think that we should group metadata together in a "Metadata" section (aside from Title name, even if it is a metadata). I don't have strong proposition on how to move this forward, but I feel like we do not yet have correct solution.

Unless I missed it, we also miss a maintenance script to populate all title metadata from latest existing book.

@elfkuzco
Copy link
Copy Markdown
Contributor Author

I'm also not convinced by the book warnings property naming ; wondering if issues is not a better naming at this stage, but I'm not totally bought by this.

Alternative would be to have a boolean column for storing the different issues a book might have. Currently, we have has_error but that determines if shuttle or mill will act on book. And you mentioned that there will be many checks to display once M4 is completed

Will these checks have the same impact as has_error or will they just be for signalling only?

@elfkuzco
Copy link
Copy Markdown
Contributor Author

elfkuzco commented May 26, 2026

Finally, I don't think that current UI is correct. I find the fact that we have the capability to "sync" book metadata to title in the book details a bit disturbing. First the "sync" word is confusing because it is hard to guess in which direction the copy will happen. Second the fact this must be done on the book while we edit title metadata is confusing as well.

Alternative would be to move it to the title view but that would require selecting from the list of books available to know which one to update the metadata from. Is that better?

@elfkuzco
Copy link
Copy Markdown
Contributor Author

I also don't think that we should group metadata together in a "Metadata" section (aside from Title name, even if it is a metadata). I don't have strong proposition on how to move this forward, but I feel like we do not yet have correct solution.

Sorry, but I don't understand where you mean. There's no Metadata section in the title detail view in the UI.

@benoit74
Copy link
Copy Markdown
Contributor

Will these checks have the same impact as has_error or will they just be for signalling only?

Most will be for signalling why the book has been forced to go through staging and needs manual validation to go to prod.

I think the fact we add a list column is correct, I'm only not totally convinced by the naming. Let's start with this for now and we will fix later if needed.

Alternative would be to move it to the title view but that would require selecting from the list of books available to know which one to update the metadata from. Is that better?

Latest book always "wins" (no matter its flavour, all are expected to have same flavour).

Sorry, but I don't understand where you mean. There's no Metadata section in the title detail view in the UI.

Let's forget about this, I tried to build a mockup below for title edit form (order of metadata is wrong, title must be after name and before description):

IMG_20260526_143418
  • when metadata is identical to latest book, do not care to display anything
  • when metadata is different, add a badge (probably not in read, orangish is probably better, like a warning) + show latest book value + a "Use this" button

Feel free to be only very vaguely inspired from this, it is more to show my points that anything to follow

@elfkuzco
Copy link
Copy Markdown
Contributor Author

updated PR description to show the new screenshot of the title edit tab which incorporates buttons to update from the latest book

@elfkuzco elfkuzco requested a review from benoit74 May 26, 2026 15:09
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.

Handle more metadata at title level

2 participants