Skip to content

maintenance_json_generator: SLFO client-tools (stable PullRequest / beta ToTest), static Salt repos for 4.3/5.0, default 51-sles.)#1984

Merged
ktsamis merged 1 commit intoSUSE:masterfrom
ktsamis:slfo_json
Apr 24, 2026
Merged

maintenance_json_generator: SLFO client-tools (stable PullRequest / beta ToTest), static Salt repos for 4.3/5.0, default 51-sles.)#1984
ktsamis merged 1 commit intoSUSE:masterfrom
ktsamis:slfo_json

Conversation

@ktsamis
Copy link
Copy Markdown
Member

@ktsamis ktsamis commented Apr 16, 2026

Summary

Extends maintenance_json_generator.py for 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 to 51-sles, and tightens typing, deterministic JSON output, tests, and documentation. Generated IBS repository URLs use http://download.suse.de/... only (no https:// for those outputs).

Fixes https://github.com/SUSE/spacewalk/issues/29968

SLFO client-tools

Stable (51-*, 52-sles, 52-micro, non-beta)

  • New --slfo-pull-request <id> (positive integer). Injects the PullRequest MultiLinuxManagerTools SLE-16 URL for sles160_minion and slmicro62_minion (same repo URL for both nodes).
  • In custom_repositories.json, those entries use inner keys slfo_pr_<id> so they never collide with MI id keys and stay unambiguous for validate_and_store_results and downstream tooling.
    Beta (52-sles-beta, 52-micro-beta)
  • --slfo-pull-request is rejected (argparse); beta uses fixed :ToTest URLs from repository_versions/v52_nodes.py (no PR toggle on beta projects).
  • sles160_minion: SLES-16 beta client-tools under MultiLinuxManagerTools-Beta:/SLES-16:/ToTest/....
  • slmicro60_minion / slmicro61_minion / slmicro62_minion: SL Micro 6 beta client-tools under MultiLinuxManagerTools-Beta:/SL-Micro-6:/ToTest/.... Concretely, slmicro62_minion uses the
    SLES-16 ToTest URL and sles16_client_tools for both slmicro62_minion and sles160_minion
  • 52-sles-beta: additional fixed http ToTest server / proxy image repos from v52_uyuni_tools_sles_static_repos_beta (SP7 / MultiLinuxManager52 images-SP7 POOL Media1 paths).
  • 52-micro-beta: server_uyuni_tools / proxy_uyuni_tools pinned to the SLFO 5.2 ToTest/product/repo tree (Server / Proxy product paths).

Static Salt / images (4.3 / 5.0)

  • v43_static_slmicro_salt_repositories in v43_nodes.py: full http IBS URLs for slmicro60_minion / slmicro61_minion (slmicro60_salt, slmicro61_salt, slmicro6_salt_bundle).
  • Wired for 43, 50-micro, 50-sles. init_custom_repositories merges any provided static map (no 51-only gate).

CLI and typing

  • Default --version: 51-sles. Choices derived from nodes_by_version.keys().
  • VersionNodes TypedDict, StaticRepos / DynamicRepos aliases; dynamic repo lists are sorted for stable JSON.
  • read_mi_ids_from_file: accepts str | os.PathLike[str], UTF-8 read.
  • Tests import 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 -v

Docs / misc

  • maintenance_json_generator_README.md: stable vs beta, --slfo-pull-request, slfo_pr_, v52_uyuni_tools_sles_static_repos_beta, module layout.
  • .gitignore: generated json_generator/custom_repositories.json.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-request to 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, and 50-sles, and expand static-repo merging logic beyond 51/52.
  • Update CLI default version to 51-sles and 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.

Comment thread jenkins_pipelines/scripts/json_generator/repository_versions/__init__.py Outdated
Comment thread jenkins_pipelines/scripts/json_generator/maintenance_json_generator.py Outdated
Comment thread jenkins_pipelines/scripts/json_generator/maintenance_json_generator.py Outdated
Comment thread jenkins_pipelines/scripts/tests/test_maintenance_json_generator.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_file is annotated to take file_path: str, but callers now pass a Path (and open() supports path-like objects). To keep typing accurate (and avoid type-checker noise), widen the type to accept Path/os.PathLike[str] (or convert to str at 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 because parse_cli_args() raises and exits the with body immediately. Move the assertEqual/assertIn checks after the with block (using the captured exception in cm).
        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.

Comment thread jenkins_pipelines/scripts/json_generator/maintenance_json_generator.py Outdated
Comment thread jenkins_pipelines/scripts/tests/test_maintenance_json_generator.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • DynamicRepos is defined as dict[str, list[str]], but the dynamic_* values coming from get_v51_static_and_client_tools() / get_v52_static_and_client_tools() are currently dict[str, set[str]]. This is both a typing mismatch and contributes to non-deterministic iteration order downstream. Consider converting those returned sets to sorted list[str] here (e.g., when assigning dynamic_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.

Comment thread jenkins_pipelines/scripts/tests/test_maintenance_json_generator.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread jenkins_pipelines/scripts/json_generator/maintenance_json_generator.py Outdated
Comment thread jenkins_pipelines/scripts/json_generator/maintenance_json_generator.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread jenkins_pipelines/scripts/json_generator/repository_versions/__init__.py Outdated
Comment thread jenkins_pipelines/scripts/json_generator/repository_versions/__init__.py Outdated
Comment thread jenkins_pipelines/scripts/json_generator/repository_versions/__init__.py Outdated
@ktsamis ktsamis requested a review from Copilot April 22, 2026 15:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() prepends IBS_MAINTENANCE_URL_PREFIX for any static repo value that doesn’t start with http, 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-http values; otherwise build the correct URL form (e.g., prepend IBS_URL_PREFIX for /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.

Comment thread jenkins_pipelines/scripts/json_generator/maintenance_json_generator.py Outdated
"""
if beta:
root = "/SLFO:/Products:/MultiLinuxManagerTools-Beta:/PullRequest"
tail = f":/{pr_id}:/SLES/product/repo/Multi-Linux-ManagerTools-Beta-SLE-16-x86_64/"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 "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.

Comment on lines +254 to +259
'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/'
},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be ":ToTest" URLs as it is testing "Beta"

@ktsamis ktsamis requested review from Copilot and mcalmer April 23, 2026 10:35
@ktsamis ktsamis changed the title json_generator: SLFO PR client-tools URLs; static Salt repos for 4.3/5.0; default 51-sles maintenance_json_generator: SLFO client-tools (stable PullRequest / beta ToTest), static Salt repos for 4.3/5.0, default 51-sles.) Apr 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread jenkins_pipelines/scripts/tests/test_maintenance_json_generator.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread jenkins_pipelines/scripts/tests/test_maintenance_json_generator.py
Comment thread jenkins_pipelines/scripts/json_generator/maintenance_json_generator.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread jenkins_pipelines/scripts/json_generator/repository_versions/v52_nodes.py Outdated
Comment thread jenkins_pipelines/scripts/json_generator/repository_versions/v52_nodes.py Outdated
Copy link
Copy Markdown
Member

@mcalmer mcalmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@ktsamis ktsamis merged commit 02c2a1b into SUSE:master Apr 24, 2026
@ktsamis ktsamis deleted the slfo_json branch April 24, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants