[PR #4078] [MERGED] Update migration manager to validate migration files #4042 #4159

Closed
opened 2026-04-25 00:18:36 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4078
Author: @advplyr
Created: 3/7/2025
Status: Merged
Merged: 3/7/2025
Merged by: @advplyr

Base: masterHead: validate_migration_files


📝 Commits (1)

  • c29935e Update migration manager to validate migration files #4042

📊 Changes

1 file changed (+15 additions, -1 deletions)

View changed files

📝 server/managers/MigrationManager.js (+15 -1)

📄 Description

Brief summary

Migration manager validates migration files on init.

Which issue is fixed?

Fixes #4042

In-depth Description

As seen in #4042 and #3510 sometimes files get created in the migrations folder.

When getting files inside the migrations folder dot files are already being ignored.

With this update any file that is not a .js file is ignored.
Also, the .js files that are found are validated first to make sure they contain a version string, if not an error is thrown. This will help identify issues with filenames in the future.

How have you tested this?

Tested by including non-js files, dot files, and js files without a proper name.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/4078 **Author:** [@advplyr](https://github.com/advplyr) **Created:** 3/7/2025 **Status:** ✅ Merged **Merged:** 3/7/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `validate_migration_files` --- ### 📝 Commits (1) - [`c29935e`](https://github.com/advplyr/audiobookshelf/commit/c29935e57b99582e83807d2d26dc3e39eaf81b92) Update migration manager to validate migration files #4042 ### 📊 Changes **1 file changed** (+15 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/managers/MigrationManager.js` (+15 -1) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary Migration manager validates migration files on init. ## Which issue is fixed? Fixes #4042 ## In-depth Description As seen in #4042 and #3510 sometimes files get created in the migrations folder. When getting files inside the migrations folder dot files are already being ignored. With this update any file that is not a `.js` file is ignored. Also, the `.js` files that are found are validated first to make sure they contain a version string, if not an error is thrown. This will help identify issues with filenames in the future. ## How have you tested this? Tested by including non-js files, dot files, and js files without a proper name. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:36 +02:00
adam closed this issue 2026-04-25 00:18:36 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4159