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
Modulemd upload and artifact scan #1403
Conversation
|
Hello @pavelpicka! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-09-05 14:58:49 UTC |
pulp_rpm/app/modulemd.py
Outdated
|
|
||
| import gi | ||
| gi.require_version('Modulemd', '2.0') | ||
| from gi.repository import Modulemd as mmdlib |
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.
from gi.repository import Modulemd as mmdlib #noqa
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.
done, thank you
3a8c090
to
098f086
Compare
pulp_rpm/app/serializers.py
Outdated
| @@ -165,6 +168,10 @@ class PackageSerializer(SingleArtifactContentSerializer): | |||
| rpm_header_end = serializers.IntegerField( | |||
| help_text=_("Last byte of the header"), | |||
| ) | |||
| rpm_modular = serializers.BooleanField( | |||
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.
If possible, it would be nice if this were instead a nullable foreign key pointing to the artifact that it belongs to instead of just a boolean. I'm not sure how that would work with lazy sync though?
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.
But, on the other hand, if a user tries to delete a module, we need to know what RPMs to delete, and if they try to delete a modular RPM we need to be able to deny them or delete the related units. That's a hard problem too.
|
|
||
| endpoint_name = 'modulemd' | ||
| queryset = Modulemd.objects.all() | ||
| serializer_class = ModulemdSerializer |
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.
Am I correct that this endpoint will create multiple modulemd from one modules.yaml file?
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.
yes it will create all modulemds which are listed in modulemd.yaml file.
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.
Since that's the case, I wonder if it should be called something that makes that more clear?
9fd6781
to
dcbf06f
Compare
|
@pavelpicka , does it work for both compressed and uncompressed modules.yaml files? |
|
Updated to support compressed modulemd.yaml and move upload endpoint to .../modulemd/upload |
8d4f3b6
to
aef2f2f
Compare
aa78902
to
b9e4fd3
Compare
Upload modulemd and scan for artifact which are already in pulp. Upload modulemd-defaults. Both at single point `http --form POST :24817/pulp/api/v3/content/modulemd/upload/ file@./modules.yaml.gz` and its views. Supports yaml or compressed yaml (.gz) and returning created resources. re #5072 https://pulp.plan.io/issues/5072
b9e4fd3
to
c451424
Compare
|
closing this PR as refactored to better support with #1468 |
Upload modulemd and scan for artifact which are already in pulp.
Upload modulemd-defaults. Both at single point
http --form POST :24817/pulp/api/v3/content/modulemd/upload/ file@./modules.yaml.gzand its viewsets.
http :24817/pulp/api/v3/content/rpm/modulemd/http :24817/pulp/api/v3/content/rpm/modulemd-defaults/Supports yaml or compressed yaml (.gz) and returning created resources.
re: #5072
https://pulp.plan.io/issues/5072