-
Notifications
You must be signed in to change notification settings - Fork 123
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
Skip comment lines in mirrorlist #1820
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. |
8ee1062
to
d7bdadd
Compare
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.
@cognifloyd, thank you very much for the fix!
See my comment about the test. I hope adding it is quite straightforward and not much of a burden, it will definitely bring a lot of benefit.
if not match: | ||
continue |
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.
Good catch!
@@ -16,6 +16,7 @@ Manual Coverage | |||
| As a user, I can sync and skip specific type (srpm) | NO | | | |||
| As a user, I can sync opensuse repository | NO | | | |||
| As a user, I can sync from a mirror list | YES | | | |||
| As a user, I can sync from a mirror list with comments | YES | | |
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.
Coverage is about tests. I can see how it is not clear from this page. Apologies. I'll update the language here.
We aim to add a test with every fix or feature.
I believe the link you shared in the issue, the mirror list for epel8, would be a good addition to our daily tests.
We have functional tests which run with every PR and we have performance/daily tests which run once a day.
Could you add one similar to this https://github.com/pulp/pulp_rpm/blob/3.6/pulp_rpm/tests/performance/test_sync.py#L167-L169 ? This way we'll keep this line you added to the coverage and we'll test daily that a mirror list works.
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 added this line because one of the tests complained that I didn't change anything in this file. It seemed rather odd, but I added it anyway to silence the linter (or whatever was checking it).
Hello @cognifloyd! 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 2020-08-23 15:59:08 UTC |
fixes #7354 https://pulp.plan.io/issues/7354 This is important for fedora mirrorlist which has a comment at the top: https://mirrors.fedoraproject.org/mirrorlist?repo=epel-8&arch=x86_64&country=US > # repo = epel-8 arch = x86_64 country = US > http... > ...
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've added a test with that URL now. Thanks for pointing out where to add it.
@@ -16,6 +16,7 @@ Manual Coverage | |||
| As a user, I can sync and skip specific type (srpm) | NO | | | |||
| As a user, I can sync opensuse repository | NO | | | |||
| As a user, I can sync from a mirror list | YES | | | |||
| As a user, I can sync from a mirror list with comments | YES | | |
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 added this line because one of the tests complained that I didn't change anything in this file. It seemed rather odd, but I added it anyway to silence the linter (or whatever was checking it).
Sweeet! Thank you very much. FWIW, the coverage check prompts/reminds to add a test :) It was very helpful to hear your view on this, it's very clear that we need to improve the language here, so contributors are not confused what is being asked. |
fixes #7354
https://pulp.plan.io/issues/7354
The fedora mirrorlists have a comment at the top. For example:
https://mirrors.fedoraproject.org/mirrorlist?repo=epel-8&arch=x86_64&country=US
The
fetch_mirror
function's docstring says it skips non-matching lines, but the task dies trying to access.group(2)
onNone
.So, this PR skips lines that don't match the URL regex. I tested it by hotpatching my test installation and restarting the workers.