Skip to content

Skip dynamic permission initialization during migrations#25743

Merged
enisn merged 1 commit into
devfrom
salihozkara/skip-dynamic-permission-init-during-migrations
Jul 3, 2026
Merged

Skip dynamic permission initialization during migrations#25743
enisn merged 1 commit into
devfrom
salihozkara/skip-dynamic-permission-init-during-migrations

Conversation

@salihozkara

Copy link
Copy Markdown
Member

What changed

  • Skips PermissionDynamicInitializer during the data migration environment.
  • Keeps normal application initialization behavior unchanged outside migration runs.

Why

When PermissionManagementOptions.IsDynamicPermissionStoreEnabled is 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-restore completed with 0 Error(s) and existing warnings.

@salihozkara salihozkara requested a review from enisn July 3, 2026 10:44
@salihozkara salihozkara added this to the 10.6-preview milestone Jul 3, 2026
@salihozkara salihozkara marked this pull request as ready for review July 3, 2026 10:45
Copilot AI review requested due to automatic review settings July 3, 2026 10:45
@salihozkara salihozkara changed the title [codex] Skip dynamic permission initialization during migrations Skip dynamic permission initialization during migrations Jul 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.89%. Comparing base (a563a88) to head (8b297c2).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@enisn enisn merged commit f2dde57 into dev Jul 3, 2026
6 checks passed
@enisn enisn deleted the salihozkara/skip-dynamic-permission-init-during-migrations branch July 3, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants