New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for automatic publishing and distributing #467
Conversation
ca5fd43
to
591939e
Compare
|
You have a typo--should be |
d598704
to
38bb856
Compare
38bb856
to
3578742
Compare
|
Attached issue: https://pulp.plan.io/issues/7469 |
3fda22e
to
022e581
Compare
Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
022e581
to
6c1f800
Compare
|
test failure is just caused by the requirement of pulpcore 3.11 which doesn't exist yet. and I suppose it doesn't think the prerelease counts |
|
Make it depend on 3.11.dev and it should be fine |
6c1f800
to
c86c8b5
Compare
Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
| @@ -99,6 +129,7 @@ class FilePublicationSerializer(PublicationSerializer): | |||
| manifest = serializers.CharField( | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I remove the fields from the Publication model and proxy them through PublishSettings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question. I lean towards yes (to remove the duplicate data) but I don't have a strong opinion.
Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
747e04c
to
6be821d
Compare
Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
676334f
to
d3624b9
Compare
Abstract models across an API boundary between separate apps is a nightmare. Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
d3624b9
to
7dd9d8b
Compare
Abstract models across an API boundary between separate apps is a nightmare. Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
Abstract models across an API boundary between separate apps is a nightmare. Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
7dd9d8b
to
97b3b30
Compare
Abstract models across an API boundary between separate apps is a nightmare. Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
570daea
to
4c9f374
Compare
Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
Abstract models across an API boundary between separate apps is a nightmare. Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
4c9f374
to
b5ecf8b
Compare
bddfeee
to
56eaaa9
Compare
| FilePublishSettings = apps.get_model('file', 'filepublishsettings') | ||
|
|
||
| for publication in FilePublication.objects.iterator(): | ||
| publish_settings, _ = FilePublishSettings.objects.get_or_create( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, this is the recommended way to ignore partial return values. But does it work together with _ binding to gettext?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this particular case, there is no gettext import for it to conflict with, but in the general case, I don't know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, gettext would make the migrations really unstable.
| # Set the core "_publication" field with the value of the detail "publication" field | ||
| FileDistribution = apps.get_model('file', 'filedistribution') | ||
|
|
||
| distributions = list(FileDistribution.objects.all()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do this in chunks?
I think it would be very bad to get into troubles with memory in the middle of a migration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be really difficult to have enough distributions for that to be a problem (you'd need hundreds of thousands of them) but maybe I can write this better.
| ] | ||
|
|
||
| operations = [ | ||
| migrations.RunPython(migrate_distribution_fields), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please provide a down migration for this (reverse_code=migrate_distribution_fields_down)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like none of our other migrations provide down migrations, and this one would be particularly difficult since the core tables are involved also.
Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
56eaaa9
to
8f9de1c
Compare
Required PR: pulp/pulp_file#467 closes: #7626 https://pulp.plan.io/issues/7626
Required PR: pulp/pulpcore#1084 closes: #7469 https://pulp.plan.io/issues/7469
8f9de1c
to
df83e37
Compare
closes: #7469
https://pulp.plan.io/issues/7469