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 synchronizing oracle repos using ULN #1896
Conversation
|
WARNING!!! This PR is not attached to an issue. In most cases this is not advisable. Please see our PR docs for more information about how to attach this PR to an issue. |
5cd2f92
to
a022c56
Compare
pulp_rpm/app/models/repository.py
Outdated
| @@ -51,6 +51,12 @@ class RpmRemote(Remote): | |||
| TYPE = "rpm" | |||
| sles_auth_token = models.CharField(max_length=512, null=True) | |||
|
|
|||
| uln_user = models.CharField(max_length=512, null=True) | |||
|
|
|||
| uln_pwd = models.CharField(max_length=512, null=True) | |||
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 noticed there are username and password fields in the Remote base class from pulpcore.
My question is if those are in use for anything specific, or could we repurpose them for this change (instead of adding uln_user and uln_pwd)?
Also, why are they part of the Remote base class? Are they really needed for every type of remote in every plugin?!
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.
@dkliban I wonder if you could give some input on this question. Given I just watched a headers field being added to the remote base class, I guess this base class contains anything that might be of interest to more than one type of remote. I presume the existing username and password fields are intended in the same way, and we could have users use those instead of adding uln_user and uln_pwd. Is that right?
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.
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.
Just some thoughts on the server URL fields. These are not meant to be set in stone, but a starting point for discussion.
5928a45
to
9023acb
Compare
ee79b4e
to
2106cf6
Compare
edfb245
to
87ad605
Compare
|
@bmbouter Thanks for the hint, it turns out I forgot to pass on |
38741fb
to
9f1facd
Compare
pulp_rpm/app/models/repository.py
Outdated
|
|
||
| TYPE = "uln" | ||
| uln_server_base_url = models.CharField( | ||
| max_length=512, default="https://linux-update.oracle.com/" |
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.
This is currently the final item on the list of things I think I could improve about this PR:
I feel a bit uncomfortable defaulting to some Oracle URL right in the DB. I could just not do that, make uln_server_base_url a required field in the serializer, and leave everything to the user, but that would not be very user friendly. I think 99.9% of the time, users are going to want to use a single instance wide uln_server_base_url, and based on my research (Oracle is the only one I can find in the wild using ULN for content delivery) 99.8% of the time the value will be https://linux-update.oracle.com/.
So I have two questions (@goosemania, @bmbouter, or any one else with relevant knowledge):
- Is there some existing mechanism to let users configure instance wide default values?
- Is there somewhere else I could default to this value other than directly within the DB?
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.
Perhaps I could make it a django setting?
https://docs.pulpproject.org/pulpcore/settings.html#pulp-settings
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.
b1dd52e
to
48ec83c
Compare
|
I have successfully retested the latest state locally. |
CHANGES/7905.feature
Outdated
| @@ -0,0 +1 @@ | |||
| Added the ability to synchronize Oracle ULN repositories. | |||
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'd add here a note about new setting as well.
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.
Amended.
|
Hey @quba42 , it looks good to me, thanks for all the improvements and for the unittests. I think it's worth adding some docs around new configuration option and the new remote. What do you think? |
| pulpcore>=3.10 | ||
| PyGObject~=3.22 | ||
| solv~=0.7.17 | ||
| aiohttp_xmlrpc |
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.
@dralley , @jlsherrill, @evgeni , JFYI, when this is released (likely pulp_rpm 3.10), it will bump the pulpcore version requirement to 3.10, and also it adds a new dependency (in case @evgeni will need to build it for rpm installations).
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 will have to, but thankfully we have tools to catch that.
Thanks for the ping tho :)
|
@quba42 , it would also be good if you could squash commits, so all those changes are never separated (especially the migration). Thanks |
|
I have squashed the commits and opened a follow on task for the documentation (https://pulp.plan.io/issues/8426). |
|
It seems to be a new version of flake8-docstrings and pydocstyle. |
|
@quba42 , #1959 is merged, please rebase, so the linter passes. Thanks |
|
@quba42 , thanks, it all looks good. I'm not approving now, so it is not merged. |
fixes #7905 https://pulp.plan.io/issues/7905 Should also work for non-Oracle ULN repositories, tested using Oracle.
|
The failure is unrelated to the changes in the PR. The CI issue have been addressed separately, see #1963. Merging. |
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.
Great job, everyone!
Thanks
|
Thank you all! |
|
@ThikaXer It looks like an aiohttp-xmlrpc change has broken this support. Any chance you could revisit? This is the change that broke ULN: https://github.com/mosquito/aiohttp-xmlrpc/pull/48/files |
|
@m-bucher, @sbernhard, @Manisha15 One of us will need to "revisit" this issue. |
|
@dralley, @quba42, @Manisha15 I created a draft-PR, which incorporates the necessary changes: #2198 |
This PR relates to the following PR in pulpcore:
Add headers option is aiohttp client session #1041
pulp/pulpcore#1041