moodle: drop stale /var/lib/moodle paths, skip moodledata caches #1

Merged
marcos-mendez merged 5 commits from fix/moodle-dataroot into master 2026-09-26 06:25:17 -03:00
marcos-mendez commented 2026-09-26 06:15:47 -03:00 (Migrated from github.com)

Problem: the moodle profile still lists /var/lib/moodle (from 2010) while the appliance has kept its dataroot at /var/www/moodledata since 2012, so those lines match nothing; moodledata's cache, localcache, sessions and temp directories, which Moodle regenerates, go into every backup and bring stale sessions back on restore.

Diagnosis: the profile was never updated after the dataroot moved (DATAROOT in the appliance's conf.d/main).

Fix: remove the stale lines and exclude the four regenerated directories, as the magento and redmine profiles do for their caches. moodledata itself stays covered through /var/www in the core profile. The last commit makes tests/coverage.sh read COVERAGE_THRESHOLD, the variable the reusable workflow exports.

Tests: a profile is data, so the test is a lint (tests/check-profile.sh): given a profile and the appliance's path variables (tests/fixtures/moodle.conf), every path must be absolute, listed once and under one of those roots, with at least one under DATAROOT. tests/coverage.sh reports the share of profile lines the lint accounts for (4/4) and checks that the profile as it was before the fix (tests/fixtures/moodle-stale.profile) is rejected.

Serves BRIEF section 8 (Moodle is in the tier-1 catalog) under decision 0002 (tklbam family last, this is the one touched profile).

Problem: the moodle profile still lists /var/lib/moodle (from 2010) while the appliance has kept its dataroot at /var/www/moodledata since 2012, so those lines match nothing; moodledata's cache, localcache, sessions and temp directories, which Moodle regenerates, go into every backup and bring stale sessions back on restore. Diagnosis: the profile was never updated after the dataroot moved (DATAROOT in the appliance's conf.d/main). Fix: remove the stale lines and exclude the four regenerated directories, as the magento and redmine profiles do for their caches. moodledata itself stays covered through /var/www in the core profile. The last commit makes tests/coverage.sh read COVERAGE_THRESHOLD, the variable the reusable workflow exports. Tests: a profile is data, so the test is a lint (tests/check-profile.sh): given a profile and the appliance's path variables (tests/fixtures/moodle.conf), every path must be absolute, listed once and under one of those roots, with at least one under DATAROOT. tests/coverage.sh reports the share of profile lines the lint accounts for (4/4) and checks that the profile as it was before the fix (tests/fixtures/moodle-stale.profile) is rejected. Serves BRIEF section 8 (Moodle is in the tier-1 catalog) under decision 0002 (tklbam family last, this is the one touched profile).
Sign in to join this conversation.
No description provided.