Repository navigation
Split storage from models.py into models_future - #1476
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe pull request moves S3 storage and manual-upload models into ChangesStorage models
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Refactor Suggested reviewers:
|
✅ Deploy Preview for antenna-preview canceled.
|
✅ Deploy Preview for antenna-ssec canceled.
|
|
|
ccac90d to
a3aec65
Compare
a3aec65 to
7e171c2
Compare
|
@kra great start! If this passed the CI tests then I think its safe to merge |
…from main.models to models_future.storage. Use strings to references classes in (django.db.models.)ForeignKey calls to avoid circuar references, since main.models needs to import this module. main.models re-exports models moved to models_future under their same models.* names for compatibilty with existing migrations. I'd rather update the migrations, but that's a much broader change and I didn't want to think about what implications I might be missing. I didn't update any references to ami.main.models.S3StorageSource to use ami.main.models_future.storage. I feel like that's the right thing to do, but the name "models_future" makes that questionable? We probably should just do that to make our embarrasment more obvious? Maybe when we've moved enough to name main.models to main.models_legacy, at which point we'll need to deal with existing migrations? Tested with `docker compose -f docker-compose.ci.yml run --rm django python manage.py makemigrations --check --dry-run`
11aae91 to
55f218f
Compare
…was squash-merged #1461 landed on main as one squash commit, so its files reached main with no history link to this branch's earlier merges of the #1461 branch. Each add/add conflict was resolved by keeping this branch's side, which is #1461's final version of the file plus #1469's changes: main's copy of every conflicting file except ami/ml/results/tests.py equals the #1461 head this branch had merged. That test file takes main's version, which adds the test for #1461's last commit (the read-only results admin). Main's other changes (#1476, #1420, #1495) merged cleanly. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QT59KePky4u4nbCsTAggtc
Summary
Move classes S3StorageSource, SourceImageUpload, and related methods from main.models to models_future.storage.
List of Changes
This is based off of the branch in #1470.
Moves code from ami.main.models to ami.main.models_future, with minor edits, and adds tests to models_future.
Related Issues
Relates to #260.
Detailed Description
Move classes S3StorageSource, SourceImageUpload, and related methods from main.models to models_future.storage.
Use strings to references classes in (django.db.models.)ForeignKey calls to avoid circuar references, since main.models needs to import this module.
main.models re-exports models moved to models_future under their same models.* names for compatibilty with existing migrations. I'd rather update the migrations, but that's a much broader change and I didn't want to think about what implications I might be missing.
I didn't update any references to ami.main.models.S3StorageSource to use ami.main.models_future.storage. I feel like that's the right thing to do, but the name "models_future" makes that questionable? We probably should just do that to make our embarrasment more obvious? Maybe when we've moved enough to name main.models to main.models_legacy, at which point we'll need to deal with existing migrations?
How to Test the Changes
docker compose -f docker-compose.ci.yml run --rm django python manage.py makemigrations --check --dry-runSummary by CodeRabbit