[6.16.z] Use Convert2RHEL repofiles instead of deprecated repos for tests - #20892
Merged
Satellite-QE merged 1 commit intoFeb 26, 2026
Merged
Conversation
) Signed-off-by: Gaurav Talreja <gtalreja@redhat.com> (cherry picked from commit 0644d11)
Collaborator
Author
|
Contributor
Reviewer's GuideAdds a helper to derive a repository baseurl from a remote .repo file and updates Convert2RHEL API tests to use this helper and new repofile-based settings instead of deprecated direct repo URLs. Class diagram for new get_baseurl_by_repofile helperclassDiagram
class content_info {
+get_repo_files_by_url(url, extension)
+get_baseurl_by_repofile(repo_url, verify_ssl)
+get_repomd(repo_url)
}
class requests {
+get(url, verify, timeout)
}
content_info ..> requests : uses
Flow diagram for get_baseurl_by_repofile logicflowchart TD
A[Start get_baseurl_by_repofile] --> B[Call requests.get with repo_url, verify_ssl, timeout 10]
B --> C[response.raise_for_status]
C --> D[Split response.text into lines]
D --> E[For each line]
E --> F[Strip line]
F --> G{Does line start with baseurl=}
G -- Yes --> H[Extract substring after =]
H --> I[Strip extracted value]
I --> J[Return baseurl]
G -- No --> K{More lines?}
K -- Yes --> E
K -- No --> L[Raise ValueError No baseurl found]
J --> M[End]
L --> M
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
get_baseurl_by_repofileparser is quite strict (line.startswith('baseurl=')) and will miss valid lines with spaces, uppercase keys, or multiple sections; consider usingconfigparseror a regex that ignores comments/whitespace and handleskey = valueforms more robustly. - If a repofile contains multiple repository sections with different
baseurlentries, the current implementation will silently return the first one; if that’s not guaranteed to be correct, it might be worth allowing a section/repo ID to be specified or at least asserting a single baseurl is present.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `get_baseurl_by_repofile` parser is quite strict (`line.startswith('baseurl=')`) and will miss valid lines with spaces, uppercase keys, or multiple sections; consider using `configparser` or a regex that ignores comments/whitespace and handles `key = value` forms more robustly.
- If a repofile contains multiple repository sections with different `baseurl` entries, the current implementation will silently return the first one; if that’s not guaranteed to be correct, it might be worth allowing a section/repo ID to be specified or at least asserting a single baseurl is present.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Collaborator
Author
|
PRT Result |
Satellite-QE
deleted the
cherry-pick-6.16.z-0644d11f807200c8014d37d1ac667fccd0952529
branch
February 26, 2026 13:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherrypick of PR: #20869
Problem Statement
Solution
Related Issues
Summary by Sourcery
Update Convert2RHEL tests to consume repository base URLs from remote repo files instead of hard-coded repo URLs.
New Features:
Enhancements: