[6.18.z] Use Convert2RHEL repofiles instead of deprecated repos for tests - #20891
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 GuideUpdates Convert2RHEL API tests to stop using hardcoded/deprecated repository URLs and instead derive repository base URLs from remote .repo files, via a new utility helper. Sequence diagram for deriving baseurl from remote repofile in Convert2RHEL testssequenceDiagram
actor Tester
participant TestConvert2RHEL as TestConvert2RHELAPI
participant ContentInfo as content_info
participant Requests as requests
participant RepoServer as RemoteRepoServer
Tester->>TestConvert2RHEL: run_API_test()
TestConvert2RHEL->>ContentInfo: get_baseurl_by_repofile(repo_url, verify_ssl)
ContentInfo->>Requests: get(repo_url, verify=verify_ssl, timeout=10)
Requests->>RepoServer: HTTP GET /path/to/file.repo
RepoServer-->>Requests: 200 OK (repofile content)
Requests-->>ContentInfo: Response(text)
ContentInfo->>ContentInfo: parse lines for baseurl=
alt baseurl_found
ContentInfo-->>TestConvert2RHEL: baseurl
TestConvert2RHEL->>TestConvert2RHEL: build_repo_settings_using_baseurl()
else baseurl_not_found
ContentInfo-->>TestConvert2RHEL: raise ValueError
end
Class diagram for new repofile baseurl helper and its use in Convert2RHEL testsclassDiagram
class content_info {
+get_repo_files_by_url(url, extension)
+get_baseurl_by_repofile(repo_url, verify_ssl)
+get_repomd(repo_url)
}
class TestConvert2RHELAPI {
+test_centos_convert2rhel_api()
+test_oracle_convert2rhel_api()
+_get_convert2rhel_baseurl(repo_url)
}
class requests {
+get(url, verify, timeout)
}
TestConvert2RHELAPI ..> content_info : uses
content_info ..> requests : uses
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:
- Consider using a parser like
configparserto read the.repofile instead of manually scanning forbaseurl=, so you can correctly handle multiple sections and future optional keys. - If multiple
baseurlentries exist in a.repofile, the current implementation will silently return the first one; if that’s not guaranteed to be correct, you may want to scope the search to a specific section or make the behavior explicit. - You might want to make the request timeout configurable or at least a module-level constant instead of being hardcoded to 10 seconds in
get_baseurl_by_repofile.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider using a parser like `configparser` to read the `.repo` file instead of manually scanning for `baseurl=`, so you can correctly handle multiple sections and future optional keys.
- If multiple `baseurl` entries exist in a `.repo` file, the current implementation will silently return the first one; if that’s not guaranteed to be correct, you may want to scope the search to a specific section or make the behavior explicit.
- You might want to make the request timeout configurable or at least a module-level constant instead of being hardcoded to 10 seconds in `get_baseurl_by_repofile`.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.18.z-0644d11f807200c8014d37d1ac667fccd0952529
branch
February 26, 2026 14:03
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 API tests to derive repository base URLs from remote repofile definitions instead of using deprecated repository URLs directly.
New Features:
Enhancements:
Tests: