Skip to content
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 #1229

Merged
merged 1 commit into from
Apr 7, 2021

Conversation

dralley
Copy link
Contributor

@dralley dralley commented Apr 2, 2021

@dralley
Copy link
Contributor Author

dralley commented Apr 2, 2021

@bmbouter @daviddavis

You'll notice that this implementation is a lot different (simpler) than it was before, and that I ditched PublishSettings objects entirely.

Basically, as I thought about it more and more, I talked myself out of the whole idea, despite being the one of the ones pushing for it initially. I went with autopublish + publish settings (flat, individual fields) on the repository instead.

There are many reasons why but the simplest is:

  • Most plugins either
    • don't even do publications at all, and therefore have no need to care about publish settings
    • only have one or two settings, which might even be the default 99.9% of the time, like "manifest" for the file plugin, or no publish time options at all like the python plugin

So adding this whole new thing in core, and trying to manage even more relationships, and making 75% of plugins more tricky to use for an architecture that would only benefit some very niche use cases (sharing publish settings) for maybe 1/3 of the plugins, just doesn't make a whole lot of sense to me anymore. The cure is worse than the disease I think.

There's other reasons too which I can explain on a call or something.

dralley added a commit to dralley/pulp_file that referenced this pull request Apr 2, 2021
dralley added a commit to dralley/pulp_file that referenced this pull request Apr 2, 2021
@pulpbot
Copy link
Member

pulpbot commented Apr 2, 2021

Attached issue: https://pulp.plan.io/issues/7626

dralley added a commit to dralley/pulp_file that referenced this pull request Apr 2, 2021
@dralley dralley force-pushed the auto-publish-distribute branch 2 times, most recently from 0da2d86 to 5f2779d Compare April 2, 2021 03:22
dralley added a commit to dralley/pulp_ansible that referenced this pull request Apr 2, 2021
dralley added a commit to dralley/pulp_rpm that referenced this pull request Apr 2, 2021
dralley added a commit to dralley/pulp_rpm that referenced this pull request Apr 2, 2021
dralley added a commit to dralley/pulp_rpm that referenced this pull request Apr 2, 2021
dralley added a commit to dralley/pulp_rpm that referenced this pull request Apr 2, 2021
dralley added a commit to dralley/pulp_rpm that referenced this pull request Apr 2, 2021
dralley added a commit to dralley/pulp_rpm that referenced this pull request Apr 2, 2021
functest_requirements.txt Outdated Show resolved Hide resolved
@@ -25,7 +25,7 @@ class Migration(migrations.Migration):
('content_guard', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.ContentGuard')),
('publication', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.Publication')),
('remote', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.Remote')),
('repository', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.Repository')),
('repository', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.Repository', related_name='distributions')),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not entirely sure, if this should be a new migration.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe this is an automatic one produced with 'makemigrations'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is modifying a migration that is on master, but not yet released. I'm not saying we should not do this, however, just asking.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm i see what you're saying - i think in the past practice we'd just have a migration on top instead of modifying an unreleased one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do that if there's a strong desire to. I just thought that since this work and Brian's is so closely linked, there's not a great need to create an entire new migration just for this one-line change that I probably should have asked for on his PR initially.

So, not a strong opinion, just convenience.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a strong opinion here.

@@ -0,0 +1 @@
Added a new callback method to `Repository` named `on_new_version()`, which runs when a new repository version has been created. This can be used for e.g. automatically publishing or distributing a new repository version after it has been created.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daviddavis How is this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Added a new callback method to `Repository` named `on_new_version()`, which runs when a new repository version has been created. This can be used for e.g. automatically publishing or distributing a new repository version after it has been created.
Added a new callback method to ``Repository`` named ``on_new_version()``, which runs when a new repository version has been created. This can be used for e.g. automatically publishing or distributing a new repository version after it has been created.

@dralley dralley merged commit 2679461 into pulp:master Apr 7, 2021
@dralley dralley deleted the auto-publish-distribute branch April 7, 2021 13:20
dralley added a commit to dralley/pulp_ansible that referenced this pull request Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants