Story #8383: [EPIC] As a plugin writer I have the `repository`, `publication`, and `repository_version` fields on Distribution MasterModel
Remove `BaseDistribution` and associated objects from Pulp and the plugin API
These were deprecated with 3.12.
Things to do¶
DistributionFilterentirely from the code and the plugin API.
- Delete the
BasePathOverlapMixinobject and move its code into the
- Update the
DistributionSerializer.validate_base_pathto only consider the
Distributionmodel and not the
- Update the
DistributionSerializer.namevalidator to disinclude
- Update the Content app's
Handler._match_distributionto only match on
#5 Updated by daviddavis 3 months ago
- Status changed from ASSIGNED to NEW
- Assignee deleted (
I looked into this and there's a problem. Removing the BaseDistribution model forces us to create the migration that cleans up the base distribution table.
However, this migration causes all previous migrations that touch the base distribution table in anyway to fail:
django.db.migrations.exceptions.InvalidBasesError: Cannot resolve bases for [<ModelState: 'file.FileDistribution'>, <ModelState: 'rpm.RpmDistribution'>]
This is pretty much any migration involving distributions and it includes the migrations we created to move the data from the base distribution table to the distribution table. We can use
run_before to solve this problem but there are two things to consider.
First, we've already released plugins that are compatible with pulpcore 3.13. So we'd have to postpone removing BaseDistribution until at least 3.14. We could still remove BaseDistribution stuff from the plugin API though in 3.13.
Second, let's say we ship the base distribution removal migration in 3.14. In order to support 3.14, plugins will declare their that migrations
run_before this new migration but doing so will mean that these plugins won't work against 3.13 as
run_before checks for the migration, and this new migration won't be in 3.13 (see previous paragraph).
What we could do is either:
- Create a no-op migration in 3.13 that plugin migrations could pin to via
- Use an arbitrary migration that proceeds the base distribution removal migration (e.g.
#7 Updated by daviddavis 3 months ago
On the master branches for pulpcore and pulp_file, I went into the pulp_file migration
0009_move_data_to_new_master_distribution_model.py and added this line:
run_before = [('core', '0063_repository_retained_versions')]
Having both pulpcore and pulp_file installed, I ran
pclean and confirmed that pulp_file 0009 proceeded pulpcore 0063:
Applying core.0062_add_new_distribution_mastermodel... OK Applying file.0009_move_data_to_new_master_distribution_model... OK Applying core.0063_repository_retained_versions... OK Applying file.0010_auto_publish... OK
Then I uninstalled pulp_file, ran
pclean, reinstalled pulp_file, and finally ran migrate:
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration core.0063_repository_retained_versions is applied before its dependency file.0009_move_data_to_new_master_distribution_model on database 'default'.
So dalley was correct.
Please register to edit this issue