maintenance_json_generator: SLFO client-tools (stable PullRequest / beta ToTest), static Salt repos for 4.3/5.0, default 51-sles.)#1984
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the maintenance JSON generator to support SLFO PullRequest-driven client-tools repositories for SLES 16 / SL Micro 6.2, and ensures static Salt image repositories are always included for SUMA 4.3 / 5.0 SL Micro minions. It also changes the CLI default version to 51-sles and updates documentation/tests accordingly.
Changes:
- Add
--slfo-pull-requestto inject SLES 16 and SL Micro 6.2 client-tools repo URLs for 5.1/5.2 (including beta variants) and log the PR id. - Add static SL Micro 6.0/6.1 Salt/image repositories for versions
43,50-micro, and50-sles, and expand static-repo merging logic beyond 51/52. - Update CLI default version to
51-slesand adjust README/tests to reflect the new behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| jenkins_pipelines/scripts/json_generator/maintenance_json_generator.py | Adds --slfo-pull-request, expands static repo merging to 43/50/51/52, changes default version to 51-sles. |
| jenkins_pipelines/scripts/json_generator/repository_versions/init.py | Wires 4.3/5.0 static Salt repos into nodes_by_version. |
| jenkins_pipelines/scripts/json_generator/repository_versions/v43_nodes.py | Introduces v43_static_slmicro_salt_repositories with fixed Salt/image URLs for SL Micro 6.0/6.1. |
| jenkins_pipelines/scripts/json_generator/repository_versions/v51_nodes.py | Removes static definitions for sles160_minion / slmicro62_minion client-tools repos. |
| jenkins_pipelines/scripts/json_generator/repository_versions/v52_nodes.py | Removes static definitions for sles160_minion / slmicro62_minion client-tools repos (beta). |
| jenkins_pipelines/scripts/json_generator/maintenance_json_generator_README.md | Documents new default version, beta options, and --slfo-pull-request plus static Salt repos behavior for 43/50. |
| jenkins_pipelines/scripts/tests/test_maintenance_json_generator.py | Updates default-version expectation and adds assertions around static Salt repo merging for 43/50. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (2)
jenkins_pipelines/scripts/json_generator/maintenance_json_generator.py:52
read_mi_ids_from_fileis annotated to takefile_path: str, but callers now pass aPath(andopen()supports path-like objects). To keep typing accurate (and avoid type-checker noise), widen the type to acceptPath/os.PathLike[str](or convert tostrat the call site consistently).
def read_mi_ids_from_file(file_path: str) -> list[str]:
with open(file_path, 'r') as file:
return file.read().strip().split()
jenkins_pipelines/scripts/tests/test_maintenance_json_generator.py:71
- The assertions inside this
assertRaises(SystemExit)block are unreachable becauseparse_cli_args()raises and exits thewithbody immediately. Move theassertEqual/assertInchecks after thewithblock (using the captured exception incm).
sys.argv = ['maintenance_json_generator.py', '-x']
with self.assertRaises(SystemExit) as cm:
parse_cli_args()
self.assertEqual(cm.exception.code, 2)
self.assertIn("error: unrecognized arguments: -x", cm.msg)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
jenkins_pipelines/scripts/json_generator/repository_versions/init.py:42
DynamicReposis defined asdict[str, list[str]], but thedynamic_*values coming fromget_v51_static_and_client_tools()/get_v52_static_and_client_tools()are currentlydict[str, set[str]]. This is both a typing mismatch and contributes to non-deterministic iteration order downstream. Consider converting those returned sets to sortedlist[str]here (e.g., when assigningdynamic_51_*/dynamic_52_*) or updating the type alias and downstream logic to consistently use ordered sequences.
StaticRepos: TypeAlias = dict[str, dict[str, str]]
DynamicRepos: TypeAlias = dict[str, list[str]]
class VersionNodes(TypedDict):
static: StaticRepos
dynamic: DynamicRepos
static_51_micro, dynamic_51_micro = get_v51_static_and_client_tools("micro")
static_51_sles, dynamic_51_sles = get_v51_static_and_client_tools("sles")
# 5.2 (Non-Beta clients - shared from 5.1)
static_52_micro, dynamic_52_micro = get_v52_static_and_client_tools("micro", beta=False)
static_52_sles, dynamic_52_sles = get_v52_static_and_client_tools("sles", beta=False)
# 5.2 (Beta clients - exclusive -Beta tools)
static_52_micro_beta, dynamic_52_micro_beta = get_v52_static_and_client_tools("micro", beta=True)
static_52_sles_beta, dynamic_52_sles_beta = get_v52_static_and_client_tools("sles", beta=True)
nodes_by_version: dict[str, VersionNodes] = {
"43": {"static": v43_static_slmicro_salt_repositories, "dynamic": get_v43_nodes_sorted()},
"50-micro": {
"static": v43_static_slmicro_salt_repositories,
"dynamic": get_v50_nodes_sorted(get_v43_nodes_sorted(), "micro"),
},
"50-sles": {
"static": v43_static_slmicro_salt_repositories,
"dynamic": get_v50_nodes_sorted(get_v43_nodes_sorted(), "sles"),
},
"51-sles": {"static": static_51_sles, "dynamic": dynamic_51_sles},
"51-micro": {"static": static_51_micro, "dynamic": dynamic_51_micro},
"52-sles": {"static": static_52_sles, "dynamic": dynamic_52_sles},
"52-micro": {"static": static_52_micro, "dynamic": dynamic_52_micro},
"52-sles-beta": {"static": static_52_sles_beta, "dynamic": dynamic_52_sles_beta},
"52-micro-beta": {"static": static_52_micro_beta, "dynamic": dynamic_52_micro_beta}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
jenkins_pipelines/scripts/json_generator/maintenance_json_generator.py:101
init_custom_repositories()prependsIBS_MAINTENANCE_URL_PREFIXfor any static repo value that doesn’t start withhttp, but maintenance URLs require an MI id between the prefix and suffix. With an input like"/SUSE_Updates_.../"this would generate a malformed URL (...Maintenance://SUSE_Updates...). If static repos are expected to be full URLs, consider validating and raising on non-httpvalues; otherwise build the correct URL form (e.g., prependIBS_URL_PREFIXfor/SLFO:...project paths, or redesign static entries that need MI ids to be handled via the dynamic/MI loop).
# Merge static named repos (full http URLs or maintenance path fragments)
if static_repos:
for node, named_urls in static_repos.items():
custom_repositories[node] = {
name: f"{IBS_MAINTENANCE_URL_PREFIX}{url}" if not url.startswith("http") else url
for name, url in named_urls.items()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| """ | ||
| if beta: | ||
| root = "/SLFO:/Products:/MultiLinuxManagerTools-Beta:/PullRequest" | ||
| tail = f":/{pr_id}:/SLES/product/repo/Multi-Linux-ManagerTools-Beta-SLE-16-x86_64/" |
There was a problem hiding this comment.
As just discussed in slack. Beta Client Tools use the :ToTest URL
/SLFO:/Products:/MultiLinuxManagerTools-Beta:/SLES-16:/ToTest/product/repo/Multi-Linux-ManagerTools-Beta-SLE-16-x86_64/
the "else:" tree is ok. For Stable we have the PullRequest url
There was a problem hiding this comment.
with the new fixes I just did the resulting json for beta 2 contains these:
"sles160_minion": {
"sle16_client_tools": "http://download.suse.de/ibs/SUSE:/SLFO:/Products:/MultiLinuxManagerTools-Beta:/SLES-16:/ToTest/product/repo/Multi-Linux-ManagerTools-Beta-SLE-16-x86_64/"
},
"slmicro60_minion": {
"slmicro6_client_tools": "http://download.suse.de/ibs/SUSE:/SLFO:/Products:/MultiLinuxManagerTools-Beta:/SL-Micro-6:/ToTest/product/repo/Multi-Linux-ManagerTools-Beta-SL-Micro-6-x86_64/"
},
"slmicro61_minion": {
"slmicro6_client_tools": "http://download.suse.de/ibs/SUSE:/SLFO:/Products:/MultiLinuxManagerTools-Beta:/SL-Micro-6:/ToTest/product/repo/Multi-Linux-ManagerTools-Beta-SL-Micro-6-x86_64/"
},
"slmicro62_minion": {
"slmicro6_client_tools": "http://download.suse.de/ibs/SUSE:/SLFO:/Products:/MultiLinuxManagerTools-Beta:/SL-Micro-6:/ToTest/product/repo/Multi-Linux-ManagerTools-Beta-SL-Micro-6-x86_64/"
},
these seem correct to me now. For non-beta/stable now we should be getting the PullRequest with IDs. Can you please review once again?
There was a problem hiding this comment.
"slmicro62_minion": {
"slmicro6_client_tools": "http://download.suse.de/ibs/SUSE:/SLFO:/Products:/MultiLinuxManagerTools-Beta:/SL-Micro-6:/ToTest/product/repo/Multi-Linux-ManagerTools-Beta-SL-Micro-6-x86_64/"
},
This is wrong. Micro 6.2 use SLES repository.
The special micro repo is only for 6.0 and 6.1.
| 'sles160_minion': { | ||
| '12345': 'http://download.suse.de/ibs/SUSE:/SLFO:/Products:/MultiLinuxManagerTools-Beta:/PullRequest:/12345:/SLES/product/repo/Multi-Linux-ManagerTools-Beta-SLE-16-x86_64/' | ||
| }, | ||
| 'slmicro62_minion': { | ||
| '12345': 'http://download.suse.de/ibs/SUSE:/SLFO:/Products:/MultiLinuxManagerTools-Beta:/PullRequest:/12345:/SLES/product/repo/Multi-Linux-ManagerTools-Beta-SLE-16-x86_64/' | ||
| }, |
There was a problem hiding this comment.
This should be ":ToTest" URLs as it is testing "Beta"
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…s/tests Support SLFO PullRequest IDs for SLES 16 and SL Micro 6.2 client-tools repos on 5.1/5.2, add static SL Micro 6.0/6.1 salt repos for 4.3/5.0, and change the default target version to 51-sles. Also tighten CLI validation and typing, update the README, and refresh tests to cover the new version/PR behavior and stable test-path handling. Point slmicro62_minion at the same SLES-16 path as sles160_minion; use sles16_client_tools for both (mcalmer review). Clarify v52_uyuni_tools_sles_static_repos_beta comment (path fragments + IBS_URL_PREFIX in getter). README: distinguish 6.0/6.1 vs 6.2 beta URLs; document static dict prefixing. Tests: adjust 52-sles-beta expectations; add test_v52_beta_client_tools. Add leap 16 to 52 beta json
Summary
Extends
maintenance_json_generator.pyfor MLM/SUMA 5.1 / 5.2 client-tools (SLES 16 and SL Micro 6.2 minions), adds long-missing static Salt / image repos for SL Micro 6.0 / 6.1 on 4.3 and 5.0, switches the CLI default to51-sles, and tightens typing, deterministic JSON output, tests, and documentation. Generated IBS repository URLs usehttp://download.suse.de/...only (nohttps://for those outputs).Fixes https://github.com/SUSE/spacewalk/issues/29968
SLFO client-tools
Stable (
51-*,52-sles,52-micro, non-beta)--slfo-pull-request <id>(positive integer). Injects the PullRequest MultiLinuxManagerTools SLE-16 URL forsles160_minionandslmicro62_minion(same repo URL for both nodes).custom_repositories.json, those entries use inner keysslfo_pr_<id>so they never collide with MI id keys and stay unambiguous forvalidate_and_store_resultsand downstream tooling.Beta (
52-sles-beta,52-micro-beta)--slfo-pull-requestis rejected (argparse); beta uses fixed:ToTestURLs fromrepository_versions/v52_nodes.py(no PR toggle on beta projects).sles160_minion: SLES-16 beta client-tools underMultiLinuxManagerTools-Beta:/SLES-16:/ToTest/....slmicro60_minion/slmicro61_minion/slmicro62_minion: SL Micro 6 beta client-tools underMultiLinuxManagerTools-Beta:/SL-Micro-6:/ToTest/.... Concretely,slmicro62_minionuses theSLES-16 ToTest URL and sles16_client_tools for both slmicro62_minion and sles160_minion
52-sles-beta: additional fixedhttpToTest server / proxy image repos fromv52_uyuni_tools_sles_static_repos_beta(SP7 / MultiLinuxManager52images-SP7POOLMedia1paths).52-micro-beta:server_uyuni_tools/proxy_uyuni_toolspinned to the SLFO 5.2ToTest/product/repotree (Server / Proxy product paths).Static Salt / images (4.3 / 5.0)
v43_static_slmicro_salt_repositoriesinv43_nodes.py: fullhttpIBS URLs forslmicro60_minion/slmicro61_minion(slmicro60_salt,slmicro61_salt,slmicro6_salt_bundle).43,50-micro,50-sles.init_custom_repositoriesmerges any provided static map (no 51-only gate).CLI and typing
--version:51-sles. Choices derived fromnodes_by_version.keys().VersionNodesTypedDict,StaticRepos/DynamicReposaliases; dynamic repo lists are sorted for stable JSON.read_mi_ids_from_file: acceptsstr | os.PathLike[str], UTF-8 read.repository_versions.*at top level (same as production) to avoid duplicate module loads.Tests
From
jenkins_pipelines/scripts:PYTHONPATH=".:json_generator" python3 -m unittest tests.test_maintenance_json_generator -vDocs / misc