S154 — migration 104: correct false rescan ENUM COMMENT - #741
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Compatibility | 1 high |
| BestPractice | 1 minor |
| Documentation | 14 minor |
| Comprehensibility | 3 minor |
| CodeStyle | 36 minor |
| Complexity | 2 medium |
🟢 Metrics 29 complexity · 0 duplication
Metric Results Complexity 29 Duplication 0
🟢 Coverage ∅ diff coverage · 0.00% coverage variation
Metric Results Coverage variation ✅ 0.00% coverage variation (-1.00%) Diff coverage ✅ ∅ diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (148fe3c) 66835 47960 71.76% Head commit (745df75) 66835 (+0) 47959 (-1) 71.76% (0.00%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#741) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
70ef324 to
745df75
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #741 +/- ##
============================================
- Coverage 72.59% 72.59% -0.01%
Complexity 22863 22863
============================================
Files 711 711
Lines 71267 71267
============================================
- Hits 51738 51737 -1
- Misses 19529 19530 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
S154 — migration 104: correct false
rescanENUM COMMENTWhy
library_scan_jobs.typecarries a column COMMENT claimingrescan=purge+rescan.rescandoes not purge the library. It re-reads every file from disk and thenprunes only the items whose source file is gone
(
LibraryManager::pruneRemovedItems(), behind a per-root presence guard). S149corrected this claim across 11 documentation pages; the SQL copy survived because
it lives inside an
ALTER, and it is the copy a DBA finds inSHOW FULL COLUMNS.What
New migration 104 re-issues the
MODIFY COLUMNwith a corrected COMMENT.scan, rescan, metadata, metadata_refresh, prune, clear_metadata, clear_artwork, delete_all, media_assets)and their ordinals,
NOT NULL,DEFAULT 'scan'and the inheritedutf8mb4_unicode_cicollation are copied byte-for-byte from the live schema.Only the COMMENT text changes.
COMMENTstring isexecutable SQL, not a full-line
--/#comment, soMigrationRunner::checksum()does not strip it. Re-wording 027/030/081/084/101 would change their checksums
and force the whole ALTER to re-apply on every deployed install. They stay
byte-identical; 104 corrects the state forward. (Contrast S147/S151, which safely
edited a full-line header comment in 084.)
all are superseded by 101's declaration and in turn by 104.
items_removed(
027) says "items removed (rescan)" — truthful: rescan does remove (prune) goneitems. No other behavioural COMMENT in the chain was found false.
Proof
tests/Integration/Common/Database/RescanEnumCommentGuardTest.phpruns against alive MySQL and pins:
information_schema.COLUMNS.COLUMN_TYPE);NOT NULL/DEFAULT 'scan'/ collation / every other column unchanged — onlytype.COLUMN_COMMENTmoved, and to exactly the string 104 declares (parsed fromthe migration, not duplicated);
c948944dfc1bbb4e82b0675efdb341e2(with a negative control that the stripped hash differs from the raw file md5).
The false "before" state is established by re-applying the real migration-101 file,
so the test proves against the artefact that ships today.
Fileset
migrations/104_library_scan_jobs_rescan_comment_correction.sql(new)tests/Integration/Common/Database/RescanEnumCommentGuardTest.php(new)tests/Unit/Common/Database/ScanJobsEnumMigrationTest.php(re-point latest ENUMdeclarer 101 → 104; assertion logic unchanged)
tests/Unit/Server/Http/RequestDynamicPropertyCensusExecutableTest.php(PHP-file census re-pin 1803 → 1804, measured)
CHANGELOG.md(Unreleased / Fixed)