Skip dynamic permission initialization during migrations#25743
Merged
enisn merged 1 commit intoJul 3, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts ABP Permission Management domain module startup behavior to avoid running the dynamic permission initializer during data-migration executions, aiming to reduce noisy logs when a database is not available.
Changes:
- Skips
PermissionDynamicInitializer.InitializeAsync(...)when running in a data migration environment. - Leaves normal runtime initialization behavior unchanged outside migration runs.
Comment on lines
+51
to
+56
| if (!context.ServiceProvider.IsDataMigrationEnvironment()) | ||
| { | ||
| var rootServiceProvider = context.ServiceProvider.GetRequiredService<IRootServiceProvider>(); | ||
| var initializer = rootServiceProvider.GetRequiredService<PermissionDynamicInitializer>(); | ||
| await initializer.InitializeAsync(true, _cancellationTokenSource.Token); | ||
| } |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #25743 +/- ##
==========================================
+ Coverage 48.84% 48.89% +0.04%
==========================================
Files 3733 3733
Lines 126277 126280 +3
Branches 9709 9710 +1
==========================================
+ Hits 61682 61739 +57
+ Misses 62764 62692 -72
- Partials 1831 1849 +18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
enisn
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
PermissionDynamicInitializerduring the data migration environment.Why
When
PermissionManagementOptions.IsDynamicPermissionStoreEnabledis enabled, the dynamic permission initializer can pre-cache permissions during application initialization. In migration runs without an available database, that path can produce unnecessary error logs.Impact
Migration execution no longer attempts dynamic permission initialization, avoiding noisy logs when the database is not available. Runtime behavior outside the migration environment is unchanged.
Validation
dotnet build modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo.Abp.PermissionManagement.Domain.csproj --no-restorecompleted with0 Error(s)and existing warnings.