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

Remove the is_modular field from the Package model #3525

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dralley
Copy link
Contributor

@dralley dralley commented May 7, 2024

closes #3524

@dralley dralley marked this pull request as draft May 7, 2024 04:59
.only("pk")
).exclude(
pk__in=pulp_rpm.app.models.modulemd.Modulemd_packages.values_list("package", flat=True),
).only("pk")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This on the other hand might be tricky to do in a performant way. The through table is implicit so this doesn't actually work.

Copy link
Member

Choose a reason for hiding this comment

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

is it worth filtering modulemd within the current repo version?

pulp_rpm/app/depsolving.py Outdated Show resolved Hide resolved
@dralley
Copy link
Contributor Author

dralley commented May 7, 2024

TODO: online migration implications? Do we need to drop the reliance separately from the PR that removes the field from the DB?

modular_packages.update(module.packages.all().values_list("pk", flat=True))

nonmodular_packages = set(packages.values_list("pk", flat=True)) - modular_packages
nonmodular_packages = Package.objects.filter(pk__in=nonmodular_packages)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pedro-psb @ipanova Do either of you see a way to make this more efficient without table changes?

Making the ModulemdPackage table explicit rather than implicit would probably allow us to reduce the number of queries. I'm unsure if it's worth it though.

Copy link
Member

Choose a reason for hiding this comment

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

I did some research to see if I could come up with something but no luck.
There is prefetch_related, but I couldn't figure if this could fit in here.

Also, ideas of caching the context of the last repover crossed my mind, but I'm not aware of a suitable method for doing so.

@dralley dralley force-pushed the remove-is-modular branch 2 times, most recently from f109047 to 0557824 Compare May 21, 2024 23:53
@dralley dralley marked this pull request as ready for review May 21, 2024 23:53
@github-actions github-actions bot added the multi-commit Added when a PR consists of more than one commit label May 21, 2024
@dralley
Copy link
Contributor Author

dralley commented May 21, 2024

The failures aren't related to the PR, it's all about the certificate.

@dralley
Copy link
Contributor Author

dralley commented May 21, 2024

Removing the field from the model needs to be done in a later PR

@github-actions github-actions bot removed the multi-commit Added when a PR consists of more than one commit label May 22, 2024
@dralley dralley marked this pull request as draft May 22, 2024 00:59
@dralley
Copy link
Contributor Author

dralley commented May 22, 2024

Back to draft. Unfortunately it seems like Katello uses this field :(

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.

Remove the is_modular flag from the Package model
3 participants