Skip to content

add script to populate cms database#153

Merged
elfkuzco merged 1 commit intocms-upgradefrom
populate-cms-database
Feb 13, 2026
Merged

add script to populate cms database#153
elfkuzco merged 1 commit intocms-upgradefrom
populate-cms-database

Conversation

@elfkuzco
Copy link
Copy Markdown
Contributor

@elfkuzco elfkuzco commented Feb 12, 2026

Rationale

This PR adds a script that scans through warehouses, finds zim files and tries to populate CMS database with books/titles based on zim_info retreived from file

Changes

  • create utils/zim.py for keeping zim-related functions (copied from zimfarm/worker)
  • add script to populate cms database from zim files in local warehouses

This closes #144

@elfkuzco elfkuzco linked an issue Feb 12, 2026 that may be closed by this pull request
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.31%. Comparing base (f6df578) to head (1d0cedc).
⚠️ Report is 3 commits behind head on cms-upgrade.

Additional details and impacted files
@@             Coverage Diff              @@
##           cms-upgrade     #153   +/-   ##
============================================
  Coverage        80.31%   80.31%           
============================================
  Files               43       43           
  Lines             1702     1702           
  Branches           149      149           
============================================
  Hits              1367     1367           
  Misses             291      291           
  Partials            44       44           

☔ 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.

@elfkuzco elfkuzco requested a review from benoit74 February 12, 2026 08:34
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.

I did not test this but we can anyway fix this after merge should we detect a bug.

Question: will this script be packaged inside the Docker image? It should, in a specific folder just like on Zimfarm (for convenience to access them easily from the container). And any reason to not have a maint-scripts folder in repo just like on Zimfarm?

Comment thread backend/populate_cms_database.py Outdated
@elfkuzco elfkuzco requested a review from benoit74 February 12, 2026 15:26
@elfkuzco elfkuzco self-assigned this Feb 13, 2026
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.

LGTM

@elfkuzco elfkuzco force-pushed the populate-cms-database branch from efdea31 to 1d0cedc Compare February 13, 2026 09:24
@elfkuzco elfkuzco merged commit 7afcf6d into cms-upgrade Feb 13, 2026
4 checks passed
@elfkuzco elfkuzco deleted the populate-cms-database branch February 13, 2026 09:36
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.

Populate CMS database with existing collections

2 participants