Task #8386
closedStory #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
100%
Description
These were deprecated with 3.12.
Things to do¶
- Remove
BaseDistribution
,BaseDistributionViewset
,BaseDistributionSerializer
andDistributionFilter
entirely from the code and the plugin API. - Delete the
BasePathOverlapMixin
object and move its code into theDistributionSerializer
. - Update the
DistributionSerializer.validate_base_path
to only consider theDistribution
model and not theBaseDistribution
model. - Update the
DistributionSerializer.name
validator to disincludeBaseDistribution
- Update the Content app's
Handler._match_distribution
to only match onDistribution
and disincludeBaseDistribution
.
Updated by bmbouter over 3 years ago
- Subject changed from Remove `BaseDistribution`, `BaseDistributionViewset`, and `BaseDistributionSerializer` from plugin API to Remove `BaseDistribution` and associated objects from Pulp and the plugin API
- Description updated (diff)
Updated by daviddavis over 3 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to daviddavis
Updated by daviddavis over 3 years ago
- Status changed from ASSIGNED to NEW
- Assignee deleted (
daviddavis)
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
run_before
- Use an arbitrary migration that proceeds the base distribution removal migration (e.g.
0063_repository_retained_versions
)
Thoughts?
Updated by daviddavis over 3 years 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.
Updated by daviddavis over 3 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to daviddavis
Updated by pulpbot over 3 years ago
- Status changed from ASSIGNED to POST
Updated by daviddavis over 3 years ago
- Sprint/Milestone changed from 3.13.0 to 3.14.0
Today at pulpcore, we agreed to target 3.14 with this work.
Updated by daviddavis over 3 years ago
- Sprint/Milestone changed from 3.14.0 to 3.13.0
Adding back to 3.13 to discuss at next go/no-go meeting.
Updated by daviddavis over 3 years ago
- Sprint/Milestone changed from 3.13.0 to 3.14.0
Added by daviddavis over 3 years ago
Updated by daviddavis over 3 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulpcore|aed355fbc380a13a4a767e2627cbd54c7ff8f107.
Updated by daviddavis over 3 years ago
- Sprint/Milestone changed from 3.14.0 to 3.13.0
Updated by pulpbot over 3 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Remove BaseDistribution and associated objects
fixes #8386