Skip to content

Replace automatic SMW rebuildData with user notification#92

Merged
yaronkoren merged 1 commit intomasterfrom
background-smw-rebuild
Feb 13, 2026
Merged

Replace automatic SMW rebuildData with user notification#92
yaronkoren merged 1 commit intomasterfrom
background-smw-rebuild

Conversation

@cicalese
Copy link
Contributor

@cicalese cicalese commented Feb 13, 2026

Summary

  • Removes the automatic rebuildData.php call from container startup
  • Replaces it with a notification message when SMW is newly set up, telling the user to run it manually
  • The SMW state snapshot logic is preserved for detection purposes

Problem

rebuildData.php ran synchronously during startup, blocking the web server, log permissions, and php-fpm from starting. On large wikis this could take hours, leaving the site completely down. Additionally, large wikis need control over rebuild options (--startidfile, page ranges, etc.) that can't be automated.

Approach

Instead of running rebuildData.php automatically, detect when SMW was newly set up (by comparing .smw.json before and after run_autoupdate) and print a message:

========================================================================
NOTE: Semantic MediaWiki was newly set up. You need to run rebuildData
to populate the SMW store. Use: canasta maintenance smw-rebuild
========================================================================

A CLI command (canasta maintenance smw-rebuild) will be added in a follow-up PR.

Fixes #91

Test plan

  • Build CanastaBase image with this change, then build Canasta image on top
  • Create a new installation with SMW enabled
  • Verify the notification message appears in docker compose logs
  • Verify the web server starts promptly without waiting for SMW rebuild
  • Verify SMW tables are created (by setupStore.php via update.php hooks) but data is not populated until the user runs rebuildData.php manually

Instead of running rebuildData.php automatically on container startup
(which can block for a very long time on large wikis), detect newly
set up SMW wikis and print a message telling the user to run it manually.

This gives users control over rebuildData options (e.g. --startidfile,
page ranges) which is important for large wikis where the rebuild needs
to be done in segments.

Fixes #91
@cicalese cicalese force-pushed the background-smw-rebuild branch from 82123ef to d96ebb1 Compare February 13, 2026 17:34
@cicalese cicalese changed the title Run SMW rebuildData.php in background to avoid blocking startup Replace automatic SMW rebuildData with user notification Feb 13, 2026
@github-actions
Copy link

🐳 The image based on d96ebb14 commit has been built with 1.43.6-20260213-92 tag as ghcr.io/canastawiki/canasta-base:1.43.6-20260213-92

Copy link
Member

@yaronkoren yaronkoren left a comment

Choose a reason for hiding this comment

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

That final note to the user might not be fully correct, but this looks good enough for now!

@yaronkoren yaronkoren merged commit 54d325e into master Feb 13, 2026
2 checks passed
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.

Move SMW rebuildData.php to background to avoid blocking container startup

2 participants