add/remove language codes and refuse to publish books with invalid codes#318
add/remove language codes and refuse to publish books with invalid codes#318elfkuzco wants to merge 6 commits into
Conversation
|
fixing issues... |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #318 +/- ##
==========================================
- Coverage 83.17% 82.68% -0.50%
==========================================
Files 58 58
Lines 2912 2968 +56
Branches 276 293 +17
==========================================
+ Hits 2422 2454 +32
- Misses 415 431 +16
- Partials 75 83 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
benoit74
left a comment
There was a problem hiding this comment.
I'm sorry, I realize I've not been specific enough in the issue.
This language metadata issue should not totally block books but simply force them in staging with a new book issue kind, just like other book issues we already have (metadata mismatch, flavour mismatch). Since language metadata in catalog endpoint now anyway comes from the title, this will be OK.
But the issues list won't be cleared because we don't update language individually for books which would trigger |
Nope, either we set a correct language value in title (and book still has a bad language) or we update pycountry / env vars (and reprocess book to clear the issue). |
399e49f to
f25f393
Compare
|
had to rebase so i could get the features from the |
benoit74
left a comment
There was a problem hiding this comment.
We are getting closer, but Language ZIM metadata can be a comma-separated list of languages, and it looks like this PR is not ready for that (each language in the list must be valid)
benoit74
left a comment
There was a problem hiding this comment.
validate_language_code must support CSV of languages as well
currently, it's only used as the Title's language. Will a title's language be a CSV of languages? I don't use it for in book related schema as we don't update book languages yet. |
|
Title language is under normal condition strictly identical to book language, just like any title metadata coming from the book. The title language can hence be a CSV as well |
Rationale
This PR enhances the mill to ensure that a book's language metadata is a valid ISO639-3 language code. Additionally, it provides ability to extend the list of language codes and also disallow some that might be valid
Changes
DISALLOWED_LANGUAGE_CODESandCUSTOM_LANGUAGE_CODESto support removal and adding of language codes respectivelyThis closes #101