Skip to content

Conversation

@armanist
Copy link
Member

@armanist armanist commented Jan 22, 2026

This PR introduces a breaking refactor of the model layer (QtModelDbModel + base Model).
Database fetch methods now return new model instances, and create() resets model state to prevent identity leakage.

Please review any code that:

reuses model instances across operations

relies on implicit state mutation after first() / findOne() / findOneBy() / get()

assumes IDs are preserved between create() calls

See CHANGELOG.md for details.

Closes #372

@armanist armanist added this to the 3.0.0 milestone Jan 22, 2026
@armanist armanist added the help wanted Extra attention is needed label Jan 22, 2026
@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 90.86957% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.84%. Comparing base (f84b1b8) to head (50267de).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
src/Model/Traits/SoftDeletes.php 0.00% 8 Missing ⚠️
src/Model/Exceptions/ModelException.php 0.00% 4 Missing ⚠️
src/Model/DbModel.php 97.18% 2 Missing ⚠️
src/Console/Commands/KeyGenerateCommand.php 0.00% 1 Missing ⚠️
src/Console/Commands/MigrationMigrateCommand.php 0.00% 1 Missing ⚠️
src/Console/Commands/ModuleGenerateCommand.php 0.00% 1 Missing ⚠️
src/Libraries/Cron/CronLock.php 87.50% 1 Missing ⚠️
...es/Storage/Adapters/GoogleDrive/GoogleDriveApp.php 0.00% 1 Missing ⚠️
src/Libraries/Storage/UploadedFile.php 0.00% 1 Missing ⚠️
src/Model/Helpers/model.php 90.90% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #410      +/-   ##
============================================
+ Coverage     80.65%   80.84%   +0.18%     
- Complexity     2641     2669      +28     
============================================
  Files           237      238       +1     
  Lines          7020     7114      +94     
============================================
+ Hits           5662     5751      +89     
- Misses         1358     1363       +5     

☔ View full report in Codecov by Sentry.
📢 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.

@armanist armanist requested a review from charoyan88 January 23, 2026 12:37
@armanist armanist merged commit 3c5fbce into softberg:master Jan 23, 2026
6 checks passed
@armanist armanist deleted the 372-Refactor-Model-Architecture-Introduce-Base-Model-and-Database-Model-Separation branch January 23, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Model Architecture: Introduce Base Model and Database Model Separation

4 participants