Skip to content

TRT-2600: Determine OS variant from cluster data#3449

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
petr-muller:trt-2600-os-from-clusterdata
Apr 20, 2026
Merged

TRT-2600: Determine OS variant from cluster data#3449
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
petr-muller:trt-2600-os-from-clusterdata

Conversation

@petr-muller
Copy link
Copy Markdown
Member

@petr-muller petr-muller commented Apr 17, 2026

Reworks OS variant detection to derive the value from structured cluster data (the os object in cluster-data.json added in openshift/origin#30827) instead of job name patterns. The cluster data contains OS image stream names for the default, control plane, and worker machine config pools. These stream names (e.g. rhel-9.6, rhel-10.0, rhel-9-nvidia) are mapped to variant values (rhcos9, rhcos10) using a regex that extracts the major version.

When all node pools agree on the OS, that value becomes the variant; when they disagree, the variant is mixed. Empty pool values are backfilled from the default, and if the default is also empty, it is inferred from the release major version. The only job-name pattern preserved is rhcos9-10, which takes precedence over cluster data.

For the variant snapshot (which has no access to real cluster data), jobs with rhcos10 in their name get synthetic cluster data so the snapshot accurately reflects their expected OS variant.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements

    • OS variant detection now reads cluster-data to determine ControlPlane/Workers/Optional OS, applies smarter defaults, maps rhel-* streams to rhcos variants, and correctly produces rhcos9, rhcos10, rhcos9-10, or mixed outcomes.
  • Tests

    • Expanded unit and snapshot tests covering defaulting, backfilling, mixing behaviors, stream-name mappings, and multiple job scenarios.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 17, 2026

@petr-muller: This pull request references TRT-2600 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Reworks setOS to derive the OS variant from structured cluster data (os object in cluster-data.json) instead of job name patterns
  • Implements a multi-level backfill chain: release major version → default → control plane / workers
  • When all node pools agree on the OS, that value becomes the variant; when they disagree, the variant is mixed
  • The only job-name pattern preserved is rhcos9-10 (mixed OS), which takes precedence over cluster data
  • Parses the nested os JSON object from cluster data bytes and threads it through the variant calculation pipeline

Test plan

  • Added dedicated TestSetOS unit tests covering:
  • Job name fallback (rhcos9-10 precedence)
  • Cluster data with matching/mismatching control plane and workers
  • Additional MCP matching and mismatching
  • Default backfill into empty cp/workers
  • Release major version backfill of default
  • Updated TestVariantSyncer integration tests
  • Updated variant snapshot via make update-variants
  • All existing tests pass

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 17, 2026
@openshift-ci openshift-ci bot requested review from stbenjam and xueqzhan April 17, 2026 17:05
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 17, 2026

Walkthrough

OS determination was moved from job-name substring parsing to explicit cluster-data parsing and synthetic cluster-data for snapshots. A new clusterDataOS type and parser were added; variant-calculation functions were unexported and now accept clusterDataOS; setOS became a clusterDataOS method with mapping, defaulting, backfill and mixed-resolution logic.

Changes

Cohort / File(s) Summary
Core Variant Calculation Logic
pkg/variantregistry/ocp.go
Introduced clusterDataOS and parseClusterDataOS([]byte); renamed CalculateVariantsForJobcalculateVariantsForJob and IdentifyVariantsidentifyVariants adding osData clusterDataOS param; replaced job-name OS inference with func (os clusterDataOS) setOS(...); added resolve(), mapOSStreamToVariant, and defaultOSForReleaseMajor implementing defaulting, backfill, rhel-*→rhcos mapping, and mixed/control-plane/worker/additional resolution.
Snapshot Integration
pkg/variantregistry/snapshot.go
(*VariantSnapshot).Identify() now passes a clusterDataOS to variant calculation via syntheticClusterDataOS(job) which synthesizes basic cluster-data from job names (detects rhcos9-10, rhcos10, etc.).
Tests
pkg/variantregistry/ocp_test.go
Updated tests to supply clusterDataOS to calculateVariantsForJob; added TestSetOS covering defaulting from release major, backfilling Default, mapping rhel-* streams to rhcos*, handling Additional entries, and mixed/rhcos9/rhcos10 outcomes.

Sequence Diagram(s)

sequenceDiagram
  participant Snapshot as "VariantSnapshot"
  participant Loader as "OCPVariantLoader"
  participant Parser as "cluster-data parser"
  participant Resolver as "Variant resolver"

  Snapshot->>Loader: Identify(jobName)
  Loader->>Parser: parseClusterDataIfAvailable(jobName) / syntheticClusterDataOS(jobName)
  Parser-->>Loader: clusterDataOS
  Loader->>Resolver: calculateVariantsForJob(jobName, variantFile, clusterDataOS)
  Resolver->>Resolver: setOS(clusterDataOS) / mapOSStreamToVariant() / resolve()
  Resolver-->>Loader: variants
  Loader-->>Snapshot: newVariants[job] = variants
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 13 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (13 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and directly summarizes the main change: determining OS variant selection from cluster data instead of job name patterns.
Go Error Handling ✅ Passed The pull request demonstrates proper Go error handling patterns with correct checks and safe zero value returns on errors.
Sql Injection Prevention ✅ Passed The SQL Injection Prevention check is not applicable to this PR. The PR's changes focus exclusively on OS variant detection logic operating on in-memory data structures from parsed JSON, not on SQL query construction.
Excessive Css In React Should Use Styles ✅ Passed The custom check for excessive CSS in React components is not applicable to this PR. The PR exclusively modifies Go backend code in the pkg/variantregistry/ package with no React components, JSX, or inline CSS styling.
Single Responsibility And Clear Naming ✅ Passed The pull request demonstrates strong adherence to single responsibility and clear naming principles. The clusterDataOS struct has 4 focused fields well under the 7-field guideline. All methods use action-oriented names with reasonable parameter counts (3-4).
Stable And Deterministic Test Names ✅ Passed Custom check for Ginkgo test names is not applicable; codebase uses standard Go testing with table-driven tests.
Test Structure And Quality ✅ Passed The custom check for Ginkgo test structure is not applicable; the PR modifies standard Go unit tests using testing.T, not Ginkgo tests.
Microshift Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests; it only modifies unit tests using Go's standard testing package for variant registry logic.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR contains unit tests using Go's testing package, not Ginkgo e2e tests.
Topology-Aware Scheduling Compatibility ✅ Passed Pull request modifies only variant registry module for test infrastructure with no deployment manifests, operator code, or scheduling constraints.
Ote Binary Stdout Contract ✅ Passed Pull request modifies only library code in pkg/variantregistry/ with no process-level entry points or stdout writes that could corrupt OTE binary JSON output.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This pull request does not add any new Ginkgo e2e tests. All test functions are standard Go unit tests using the testing package.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 17, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 17, 2026

@petr-muller: This pull request references TRT-2600 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Reworks setOS to derive the OS variant from structured cluster data (os object in cluster-data.json) instead of job name patterns
  • Implements a multi-level backfill chain: release major version → default → control plane / workers
  • When all node pools agree on the OS, that value becomes the variant; when they disagree, the variant is mixed
  • The only job-name pattern preserved is rhcos9-10 (mixed OS), which takes precedence over cluster data
  • Parses the nested os JSON object from cluster data bytes and threads it through the variant calculation pipeline

Test plan

  • Added dedicated TestSetOS unit tests covering:
  • Job name fallback (rhcos9-10 precedence)
  • Cluster data with matching/mismatching control plane and workers
  • Additional MCP matching and mismatching
  • Default backfill into empty cp/workers
  • Release major version backfill of default
  • Updated TestVariantSyncer integration tests
  • Updated variant snapshot via make update-variants
  • All existing tests pass

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

  • OS variant selection now leverages cluster control plane and worker pool configuration for determination instead of job name-based inference.

  • Configuration Updates

  • Multiple job configurations transitioned from rhcos10 to rhcos9 OS variants across various platforms.

  • Techpreview e2e job tier classifications updated from candidate to standard tier.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 17, 2026

@petr-muller: This pull request references TRT-2600 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

  • Reworks setOS to derive the OS variant from structured cluster data (os object in cluster-data.json) instead of job name patterns
  • Implements a multi-level backfill chain: release major version → default → control plane / workers
  • When all node pools agree on the OS, that value becomes the variant; when they disagree, the variant is mixed
  • The only job-name pattern preserved is rhcos9-10 (mixed OS), which takes precedence over cluster data
  • Parses the nested os JSON object from cluster data bytes and threads it through the variant calculation pipeline

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

  • OS variant selection now leverages cluster control plane and worker pool configuration for determination instead of job name-based inference.

  • Configuration Updates

  • Multiple job configurations transitioned from rhcos10 to rhcos9 OS variants across various platforms.

  • Techpreview e2e job tier classifications updated from candidate to standard tier.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
pkg/variantregistry/ocp_test.go (1)

1915-2077: Cover the JSON parser path too.

TestSetOS builds clusterDataOS directly, but production now depends on parseClusterDataOS(...) before any of this logic runs. A tag/casing drift in the nested os payload would silently fall back to the release-major default and this suite would still stay green. Add one fixture-based test that unmarshals representative cluster-data.json and asserts the parsed struct or final VariantOS.

Possible test to add
+func TestParseClusterDataOS(t *testing.T) {
+	raw := []byte(`{
+		"os": {
+			"Default": "rhcos9",
+			"ControlPlaneMachineConfigPool": "rhcos10",
+			"WorkerMachineConfigPool": "rhcos10",
+			"Additional": ["rhcos10"]
+		}
+	}`)
+
+	assert.Equal(t, clusterDataOS{
+		Default:      "rhcos9",
+		ControlPlane: "rhcos10",
+		Workers:      "rhcos10",
+		Additional:   []string{"rhcos10"},
+	}, parseClusterDataOS(raw))
+}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/variantregistry/ocp_test.go` around lines 1915 - 2077, Add a new
table-driven test (next to TestSetOS) that exercises the JSON parsing path by
loading one or more representative cluster-data.json fixtures, calling
parseClusterDataOS(...) to produce a clusterDataOS, then passing that into
setOS(...) (or calling the high-level code path that uses parseClusterDataOS)
and asserting VariantOS equals the expected value; ensure the fixtures include a
nested "os" payload with realistic casing/keys to catch tag/casing drift and
reference parseClusterDataOS, clusterDataOS, setOS, VariantOS and TestSetOS in
the test so it validates both unmarshalling and the downstream OS selection
logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/variantregistry/ocp.go`:
- Around line 1317-1320: The comparison loop in resolve() incorrectly treats
empty OS values in os.Additional as real values and thus may return "mixed";
change the loop over os.Additional (where it currently checks `if a != cp {
return "mixed" }`) to skip empty entries (treat `a == ""` as missing) before
comparing to `cp`—i.e., continue when `a` is empty so only non-empty additional
pool OS values are compared to the control-plane/worker `cp`.

---

Nitpick comments:
In `@pkg/variantregistry/ocp_test.go`:
- Around line 1915-2077: Add a new table-driven test (next to TestSetOS) that
exercises the JSON parsing path by loading one or more representative
cluster-data.json fixtures, calling parseClusterDataOS(...) to produce a
clusterDataOS, then passing that into setOS(...) (or calling the high-level code
path that uses parseClusterDataOS) and asserting VariantOS equals the expected
value; ensure the fixtures include a nested "os" payload with realistic
casing/keys to catch tag/casing drift and reference parseClusterDataOS,
clusterDataOS, setOS, VariantOS and TestSetOS in the test so it validates both
unmarshalling and the downstream OS selection logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 94ea1352-4a64-4133-a99a-12aac28ae938

📥 Commits

Reviewing files that changed from the base of the PR and between b2b4bb2 and bc3b2ff.

📒 Files selected for processing (4)
  • pkg/variantregistry/ocp.go
  • pkg/variantregistry/ocp_test.go
  • pkg/variantregistry/snapshot.go
  • pkg/variantregistry/snapshot.yaml

Comment thread pkg/variantregistry/ocp.go
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 17, 2026

@petr-muller: This pull request references TRT-2600 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

  • Reworks setOS to derive the OS variant from structured cluster data (os object in cluster-data.json) instead of job name patterns
  • Implements a multi-level backfill chain: release major version → default → control plane / workers
  • When all node pools agree on the OS, that value becomes the variant; when they disagree, the variant is mixed
  • The only job-name pattern preserved is rhcos9-10 (mixed OS), which takes precedence over cluster data
  • Parses the nested os JSON object from cluster data bytes and threads it through the variant calculation pipeline

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

  • OS variant selection now derives from cluster pool data (control plane, workers, additional) with mixed/default fallback logic, replacing prior name-based inference.

  • Configuration Updates

  • Multiple job entries updated from rhcos10 to rhcos9 across platforms.

  • Techpreview e2e job tiers changed from candidate to standard.

  • Tests

  • Unit tests expanded to cover OS selection precedence, mixed/missing pool behavior, and release-major defaults.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@petr-muller petr-muller force-pushed the trt-2600-os-from-clusterdata branch 2 times, most recently from 564ce30 to 732e359 Compare April 17, 2026 17:27
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
pkg/variantregistry/ocp.go (1)

1318-1323: ⚠️ Potential issue | 🟡 Minor

Ignore unresolved empty Additional OS entries before returning mixed.

If an Additional entry is empty and Default is also empty, this path still compares "" to cp and can incorrectly classify as mixed instead of “missing additional OS data”.

Suggested fix
 	for _, a := range os.Additional {
 		if a == "" {
 			a = os.Default
 		}
+		if a == "" {
+			continue
+		}
 		if a != cp {
 			return "mixed"
 		}
 	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/variantregistry/ocp.go` around lines 1318 - 1323, The loop over
os.Additional currently substitutes os.Default into empty entries and then
compares to cp, which incorrectly returns "mixed" when both are empty; change
the logic in the loop handling os.Additional so that after applying the
os.Default fallback you ignore (continue past) entries that are still empty
instead of comparing them to cp, ensuring unresolved empty Additional entries do
not trigger the "mixed" return. Use the existing identifiers os.Additional,
os.Default, cp and the branch that currently returns "mixed" to locate and
update the code.
🧹 Nitpick comments (1)
pkg/variantregistry/ocp.go (1)

453-461: Surface cluster-data OS parse errors to logs.

Swallowing JSON errors here silently falls back OS classification, which makes bad cluster-data.json hard to detect.

Suggested refactor
-func parseClusterDataOS(data []byte) clusterDataOS {
+func parseClusterDataOS(data []byte) (clusterDataOS, error) {
 	var raw struct {
 		OS clusterDataOS `json:"os"`
 	}
 	if err := json.Unmarshal(data, &raw); err != nil {
-		return clusterDataOS{}
+		return clusterDataOS{}, err
 	}
-	return raw.OS
+	return raw.OS, nil
 }
-							osData = parseClusterDataOS(clusterDataBytes)
+							parsedOS, err := parseClusterDataOS(clusterDataBytes)
+							if err != nil {
+								jLog.WithError(err).Warn("unable to parse nested os data from cluster data file, proceeding with defaults")
+							} else {
+								osData = parsedOS
+							}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/variantregistry/ocp.go` around lines 453 - 461, parseClusterDataOS
currently swallows JSON unmarshal errors; update the parseClusterDataOS function
so that when json.Unmarshal(data, &raw) returns an error it logs that error
(including error.Error() and a short summary of data) before returning
clusterDataOS{}; use the package's existing logger if available (or the standard
log package if not) and keep the function signature/return type the same so
callers of parseClusterDataOS and the clusterDataOS type don't change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@pkg/variantregistry/ocp.go`:
- Around line 1318-1323: The loop over os.Additional currently substitutes
os.Default into empty entries and then compares to cp, which incorrectly returns
"mixed" when both are empty; change the logic in the loop handling os.Additional
so that after applying the os.Default fallback you ignore (continue past)
entries that are still empty instead of comparing them to cp, ensuring
unresolved empty Additional entries do not trigger the "mixed" return. Use the
existing identifiers os.Additional, os.Default, cp and the branch that currently
returns "mixed" to locate and update the code.

---

Nitpick comments:
In `@pkg/variantregistry/ocp.go`:
- Around line 453-461: parseClusterDataOS currently swallows JSON unmarshal
errors; update the parseClusterDataOS function so that when json.Unmarshal(data,
&raw) returns an error it logs that error (including error.Error() and a short
summary of data) before returning clusterDataOS{}; use the package's existing
logger if available (or the standard log package if not) and keep the function
signature/return type the same so callers of parseClusterDataOS and the
clusterDataOS type don't change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b2bebb5-e1b5-490d-b5f9-5558e060acd3

📥 Commits

Reviewing files that changed from the base of the PR and between bc3b2ff and d00090b.

📒 Files selected for processing (2)
  • pkg/variantregistry/ocp.go
  • pkg/variantregistry/ocp_test.go

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 17, 2026

@petr-muller: This pull request references TRT-2600 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

  • Reworks setOS to derive the OS variant from structured cluster data (os object in cluster-data.json) instead of job name patterns
  • Implements a multi-level backfill chain: release major version → default → control plane / workers
  • When all node pools agree on the OS, that value becomes the variant; when they disagree, the variant is mixed
  • The only job-name pattern preserved is rhcos9-10 (mixed OS), which takes precedence over cluster data
  • Parses the nested os JSON object from cluster data bytes and threads it through the variant calculation pipeline

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

  • OS variant selection now derives from cluster pool image data (control plane, workers, additional) with mixed/default fallbacks and a special override for jobs containing "rhcos9-10".

  • Configuration Updates

  • Numerous job records switched from rhcos10 to rhcos9; techpreview e2e job tiers moved from candidate to standard.

  • Tests

  • Expanded tests cover OS selection precedence, mixed/missing-pool behavior, explicit defaults, and release-major fallbacks.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@petr-muller petr-muller force-pushed the trt-2600-os-from-clusterdata branch from 732e359 to cd64388 Compare April 17, 2026 17:37
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
pkg/variantregistry/ocp.go (2)

453-461: Consider logging JSON parse errors for debugging.

parseClusterDataOS silently returns an empty struct when JSON unmarshaling fails. While this fallback behavior is reasonable for resilience, logging the error would help diagnose issues when cluster-data.json has unexpected formats.

Optional: Add error logging
-func parseClusterDataOS(data []byte) clusterDataOS {
+func parseClusterDataOS(jLog logrus.FieldLogger, data []byte) clusterDataOS {
 	var raw struct {
 		OS clusterDataOS `json:"os"`
 	}
 	if err := json.Unmarshal(data, &raw); err != nil {
+		if jLog != nil {
+			jLog.WithError(err).Debug("unable to parse OS section from cluster data")
+		}
 		return clusterDataOS{}
 	}
 	return raw.OS
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/variantregistry/ocp.go` around lines 453 - 461, The function
parseClusterDataOS swallows json.Unmarshal errors and returns an empty
clusterDataOS; update parseClusterDataOS to capture the error from
json.Unmarshal and log it before returning (e.g., call your package logger or
standard log with context like "failed to unmarshal cluster-data.json in
parseClusterDataOS" plus the error and optionally the raw data), keeping the
existing fallback behavior of returning clusterDataOS{} when unmarshalling
fails.

1313-1341: Add godoc for resolve() to clarify fallback and "mixed" semantics.

The method implements a multi-level fallback chain and returns "mixed" under specific conditions. A brief godoc would help readers understand the behavior without tracing through the code.

Suggested godoc
+// resolve derives the OS variant from cluster data pools.
+// It backfills empty ControlPlane and Workers from Default, maps stream names
+// (e.g., "rhel-9") to variant names (e.g., "rhcos9"), and returns:
+//   - "" if the control plane OS is empty after backfill
+//   - "mixed" if control plane, workers, or additional pools disagree
+//   - the unified OS variant otherwise
 func (os clusterDataOS) resolve() string {

As per coding guidelines: "When adding new functions, types, or fields, include a brief godoc if the name alone would not make the purpose obvious to someone unfamiliar with the feature."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/variantregistry/ocp.go` around lines 1313 - 1341, Add a brief godoc
comment for the method resolve on the clusterDataOS type describing its
multi-level fallback and "mixed" semantics: explain that it chooses ControlPlane
or Default as the control plane variant, falls back Workers to Default if empty,
maps streams via mapOSStreamToVariant, returns "" if control plane resolves to
empty, returns "mixed" if control plane and workers or any Additional entries
(falling back to Default when empty) map to different variants, otherwise
returns the resolved variant; attach this comment immediately above the
resolve() method declaration.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/variantregistry/ocp.go`:
- Around line 453-461: The function parseClusterDataOS swallows json.Unmarshal
errors and returns an empty clusterDataOS; update parseClusterDataOS to capture
the error from json.Unmarshal and log it before returning (e.g., call your
package logger or standard log with context like "failed to unmarshal
cluster-data.json in parseClusterDataOS" plus the error and optionally the raw
data), keeping the existing fallback behavior of returning clusterDataOS{} when
unmarshalling fails.
- Around line 1313-1341: Add a brief godoc comment for the method resolve on the
clusterDataOS type describing its multi-level fallback and "mixed" semantics:
explain that it chooses ControlPlane or Default as the control plane variant,
falls back Workers to Default if empty, maps streams via mapOSStreamToVariant,
returns "" if control plane resolves to empty, returns "mixed" if control plane
and workers or any Additional entries (falling back to Default when empty) map
to different variants, otherwise returns the resolved variant; attach this
comment immediately above the resolve() method declaration.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 1ceb48d9-2759-4255-8230-4dd1f5cee28f

📥 Commits

Reviewing files that changed from the base of the PR and between d00090b and 732e359.

📒 Files selected for processing (4)
  • pkg/variantregistry/ocp.go
  • pkg/variantregistry/ocp_test.go
  • pkg/variantregistry/snapshot.go
  • pkg/variantregistry/snapshot.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • pkg/variantregistry/snapshot.go
  • pkg/variantregistry/snapshot.yaml

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 17, 2026

@petr-muller: This pull request references TRT-2600 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

  • Reworks setOS to derive the OS variant from structured cluster data (os object in cluster-data.json) instead of job name patterns
  • Implements a multi-level backfill chain: release major version → default → control plane / workers
  • When all node pools agree on the OS, that value becomes the variant; when they disagree, the variant is mixed
  • The only job-name pattern preserved is rhcos9-10 (mixed OS), which takes precedence over cluster data
  • Parses the nested os JSON object from cluster data bytes and threads it through the variant calculation pipeline

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

  • OS variant selection now derives from cluster pool data (control-plane, workers, additional) with job-name override, mixed detection, and sensible default/backfill behavior.

  • Configuration Updates

  • Many jobs updated from rhcos10 to rhcos9.

  • Techpreview e2e job tiers changed from candidate to standard.

  • Tests

  • Expanded tests covering OS precedence, mixed/missing pool cases, stream-to-rhcos mapping, and release-major defaults.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@petr-muller petr-muller force-pushed the trt-2600-os-from-clusterdata branch from cd64388 to e1d1af1 Compare April 17, 2026 17:46
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 17, 2026

@petr-muller: This pull request references TRT-2600 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

  • Reworks setOS to derive the OS variant from structured cluster data (os object in cluster-data.json) instead of job name patterns
  • Implements a multi-level backfill chain: release major version → default → control plane / workers
  • When all node pools agree on the OS, that value becomes the variant; when they disagree, the variant is mixed
  • The only job-name pattern preserved is rhcos9-10 (mixed OS), which takes precedence over cluster data
  • Parses the nested os JSON object from cluster data bytes and threads it through the variant calculation pipeline

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

  • Enhanced OS variant detection now leverages cluster configuration data for improved accuracy.

  • Added support for detecting and properly handling mixed OS environments.

  • Bug Fixes

  • Improved reliability of OS variant assignment across different job configurations by using actual cluster data instead of pattern-based inference.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 17, 2026

@petr-muller: This pull request references TRT-2600 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

This reworks OS variant detection to derive the value from structured cluster data (the os object in cluster-data.json) instead of job name patterns. The cluster data contains OS image stream names for the default, control plane, and worker machine config pools. These stream names (e.g. rhel-9.6, rhel-10.0, rhel-9-nvidia) are mapped to variant values (rhcos9, rhcos10) using a regex that extracts the major version. When all node pools agree on the OS, that value becomes the variant; when they disagree, the variant is mixed. Empty pool values are backfilled from the default, and if the default is also empty, it is inferred from the release major version. The only job-name pattern preserved is rhcos9-10, which takes precedence over cluster data. For the variant snapshot (which has no access to real cluster data), jobs with rhcos10 in their name get synthetic cluster data so the snapshot accurately reflects their expected OS variant.

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 17, 2026

@petr-muller: This pull request references TRT-2600 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Reworks OS variant detection to derive the value from structured cluster data (the os object in cluster-data.json) instead of job name patterns. The cluster data contains OS image stream names for the default, control plane, and worker machine config pools. These stream names (e.g. rhel-9.6, rhel-10.0, rhel-9-nvidia) are mapped to variant values (rhcos9, rhcos10) using a regex that extracts the major version.

When all node pools agree on the OS, that value becomes the variant; when they disagree, the variant is mixed. Empty pool values are backfilled from the default, and if the default is also empty, it is inferred from the release major version. The only job-name pattern preserved is rhcos9-10, which takes precedence over cluster data.

For the variant snapshot (which has no access to real cluster data), jobs with rhcos10 in their name get synthetic cluster data so the snapshot accurately reflects their expected OS variant.

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 17, 2026

@petr-muller: This pull request references TRT-2600 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Reworks OS variant detection to derive the value from structured cluster data (the os object in cluster-data.json added in openshift/origin#30827) instead of job name patterns. The cluster data contains OS image stream names for the default, control plane, and worker machine config pools. These stream names (e.g. rhel-9.6, rhel-10.0, rhel-9-nvidia) are mapped to variant values (rhcos9, rhcos10) using a regex that extracts the major version.

When all node pools agree on the OS, that value becomes the variant; when they disagree, the variant is mixed. Empty pool values are backfilled from the default, and if the default is also empty, it is inferred from the release major version. The only job-name pattern preserved is rhcos9-10, which takes precedence over cluster data.

For the variant snapshot (which has no access to real cluster data), jobs with rhcos10 in their name get synthetic cluster data so the snapshot accurately reflects their expected OS variant.

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/variantregistry/ocp_test.go`:
- Around line 1928-1932: The test case named "rhcos9-10 job name takes
precedence over cluster data" currently omits clusterDataOS so it can't fail if
setOS incorrectly prefers cluster data; update this table entry to set
clusterDataOS to a conflicting value (e.g., "rhcos8-6" or any value !=
"rhcos9-10") so that calling setOS (the function under test) must choose the
jobName-derived OS "rhcos9-10" to satisfy expectedOS, thereby validating the
precedence behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: c84b1675-6f1c-438d-956d-4e0280656f6d

📥 Commits

Reviewing files that changed from the base of the PR and between cd64388 and e1d1af1.

📒 Files selected for processing (3)
  • pkg/variantregistry/ocp.go
  • pkg/variantregistry/ocp_test.go
  • pkg/variantregistry/snapshot.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • pkg/variantregistry/snapshot.go
  • pkg/variantregistry/ocp.go

Comment thread pkg/variantregistry/ocp_test.go
@petr-muller petr-muller force-pushed the trt-2600-os-from-clusterdata branch 2 times, most recently from d699a28 to fcfcac7 Compare April 17, 2026 18:00
@petr-muller
Copy link
Copy Markdown
Member Author

@coderabbitai resume

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 17, 2026

✅ Actions performed

Reviews resumed.

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 17, 2026

@petr-muller: This pull request references TRT-2600 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Reworks OS variant detection to derive the value from structured cluster data (the os object in cluster-data.json added in openshift/origin#30827) instead of job name patterns. The cluster data contains OS image stream names for the default, control plane, and worker machine config pools. These stream names (e.g. rhel-9.6, rhel-10.0, rhel-9-nvidia) are mapped to variant values (rhcos9, rhcos10) using a regex that extracts the major version.

When all node pools agree on the OS, that value becomes the variant; when they disagree, the variant is mixed. Empty pool values are backfilled from the default, and if the default is also empty, it is inferred from the release major version. The only job-name pattern preserved is rhcos9-10, which takes precedence over cluster data.

For the variant snapshot (which has no access to real cluster data), jobs with rhcos10 in their name get synthetic cluster data so the snapshot accurately reflects their expected OS variant.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements

  • Enhanced OS variant detection to use cluster data instead of job naming patterns, improving accuracy for RHEL 9, RHEL 10, and mixed OS environments.

  • Tests

  • Expanded test coverage for OS selection logic with multiple scenario validations.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@petr-muller petr-muller force-pushed the trt-2600-os-from-clusterdata branch from fcfcac7 to 3e22231 Compare April 17, 2026 18:03
@petr-muller petr-muller force-pushed the trt-2600-os-from-clusterdata branch from 3e22231 to f8053b4 Compare April 17, 2026 18:04
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
pkg/variantregistry/ocp.go (1)

445-461: Consider adding brief godoc for clusterDataOS and parseClusterDataOS.

While the struct fields use self-explanatory names matching the cluster-data.json structure, a brief comment explaining the purpose (e.g., "holds OS image stream information extracted from cluster-data.json") would help readers unfamiliar with the feature. Similarly, parseClusterDataOS silently returns an empty struct on parse errors—a short comment noting this is intentional fallback behavior would clarify the design.

As per coding guidelines: "When adding new functions, types, or fields, include a brief godoc if the name alone would not make the purpose obvious to someone unfamiliar with the feature."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/variantregistry/ocp.go` around lines 445 - 461, Add brief godoc comments
for the clusterDataOS type and the parseClusterDataOS function: for
clusterDataOS explain it "holds OS image stream information extracted from
cluster-data.json (fields map to JSON keys Default,
ControlPlaneMachineConfigPool, WorkerMachineConfigPool, Additional)"; for
parseClusterDataOS explain it parses the JSON envelope (raw.os) and that it
intentionally returns an empty clusterDataOS on unmarshal error as a safe
fallback. Place these comments immediately above the type and function
declarations (clusterDataOS and parseClusterDataOS) so the intent and fallback
behavior are clear to readers.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/variantregistry/ocp.go`:
- Around line 445-461: Add brief godoc comments for the clusterDataOS type and
the parseClusterDataOS function: for clusterDataOS explain it "holds OS image
stream information extracted from cluster-data.json (fields map to JSON keys
Default, ControlPlaneMachineConfigPool, WorkerMachineConfigPool, Additional)";
for parseClusterDataOS explain it parses the JSON envelope (raw.os) and that it
intentionally returns an empty clusterDataOS on unmarshal error as a safe
fallback. Place these comments immediately above the type and function
declarations (clusterDataOS and parseClusterDataOS) so the intent and fallback
behavior are clear to readers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 0ac2250b-e008-4aa4-809b-85c73e6cebc9

📥 Commits

Reviewing files that changed from the base of the PR and between cd64388 and fcfcac7.

📒 Files selected for processing (3)
  • pkg/variantregistry/ocp.go
  • pkg/variantregistry/ocp_test.go
  • pkg/variantregistry/snapshot.go

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 17, 2026

@petr-muller: This pull request references TRT-2600 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Reworks OS variant detection to derive the value from structured cluster data (the os object in cluster-data.json added in openshift/origin#30827) instead of job name patterns. The cluster data contains OS image stream names for the default, control plane, and worker machine config pools. These stream names (e.g. rhel-9.6, rhel-10.0, rhel-9-nvidia) are mapped to variant values (rhcos9, rhcos10) using a regex that extracts the major version.

When all node pools agree on the OS, that value becomes the variant; when they disagree, the variant is mixed. Empty pool values are backfilled from the default, and if the default is also empty, it is inferred from the release major version. The only job-name pattern preserved is rhcos9-10, which takes precedence over cluster data.

For the variant snapshot (which has no access to real cluster data), jobs with rhcos10 in their name get synthetic cluster data so the snapshot accurately reflects their expected OS variant.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements

  • OS variant detection now derives OS from cluster-data (control-plane, worker, optional additional) with smarter defaults and mapping of rhel-* streams to rhcos variants, improving accuracy for rhcos9-10, rhcos10 and mixed environments.

  • Tests

  • Expanded unit and snapshot tests covering defaulting, mixing/backfilling behaviors, stream-name mappings, and multiple job scenarios.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
pkg/variantregistry/ocp.go (1)

1289-1296: Both switch branches return the same value.

Currently both case "5" and default return "rhcos9", making the switch effectively a no-op. If this is intentional scaffolding for future release differentiation, consider adding a brief comment explaining the intent. Otherwise, this could be simplified to a direct return.

💡 Possible simplification if no future differentiation planned
 func defaultOSForReleaseMajor(major string) string { //nolint:unparam
-	switch major {
-	case "5":
-		return "rhcos9"
-	default:
-		return "rhcos9"
-	}
+	// Future: may differentiate by major version
+	_ = major
+	return "rhcos9"
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/variantregistry/ocp.go` around lines 1289 - 1296, The switch in
defaultOSForReleaseMajor always returns "rhcos9" (both case "5" and default), so
either simplify by replacing the switch with a direct return of "rhcos9" in
function defaultOSForReleaseMajor, or if this is intentional scaffolding, keep
the switch but add a concise comment above defaultOSForReleaseMajor explaining
it intentionally returns "rhcos9" for all majors and will be extended for future
release-specific OS choices.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/variantregistry/ocp.go`:
- Around line 1289-1296: The switch in defaultOSForReleaseMajor always returns
"rhcos9" (both case "5" and default), so either simplify by replacing the switch
with a direct return of "rhcos9" in function defaultOSForReleaseMajor, or if
this is intentional scaffolding, keep the switch but add a concise comment above
defaultOSForReleaseMajor explaining it intentionally returns "rhcos9" for all
majors and will be extended for future release-specific OS choices.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 6cb5a6f0-0aac-493f-b5ef-168262a9ee19

📥 Commits

Reviewing files that changed from the base of the PR and between fcfcac7 and f8053b4.

📒 Files selected for processing (3)
  • pkg/variantregistry/ocp.go
  • pkg/variantregistry/ocp_test.go
  • pkg/variantregistry/snapshot.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/variantregistry/snapshot.go

The OS variant was previously derived solely from job name patterns
(rhcos9, rhcos10, rhcos9-10). This changes setOS to use structured
OS image stream data from cluster-data.json, with a multi-level
backfill chain: release major version -> default -> control plane /
workers. The only job-name pattern preserved is rhcos9-10 (mixed OS),
which takes precedence over cluster data.

The clusterDataOS struct is parsed from the nested "os" JSON object
in cluster data and threaded through the variant calculation pipeline.
When all node pools agree on the OS, that value becomes the variant;
when they disagree, the variant is "mixed".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@petr-muller petr-muller force-pushed the trt-2600-os-from-clusterdata branch from f8053b4 to b7ef95b Compare April 17, 2026 18:13
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 17, 2026

@petr-muller: This pull request references TRT-2600 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Reworks OS variant detection to derive the value from structured cluster data (the os object in cluster-data.json added in openshift/origin#30827) instead of job name patterns. The cluster data contains OS image stream names for the default, control plane, and worker machine config pools. These stream names (e.g. rhel-9.6, rhel-10.0, rhel-9-nvidia) are mapped to variant values (rhcos9, rhcos10) using a regex that extracts the major version.

When all node pools agree on the OS, that value becomes the variant; when they disagree, the variant is mixed. Empty pool values are backfilled from the default, and if the default is also empty, it is inferred from the release major version. The only job-name pattern preserved is rhcos9-10, which takes precedence over cluster data.

For the variant snapshot (which has no access to real cluster data), jobs with rhcos10 in their name get synthetic cluster data so the snapshot accurately reflects their expected OS variant.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements

  • OS variant detection now reads cluster-data to determine ControlPlane/Workers/Optional OS, applies smarter defaults, maps rhel-* streams to rhcos variants, and correctly produces rhcos9, rhcos10, rhcos9-10, or mixed outcomes.

  • Tests

  • Expanded unit and snapshot tests covering defaulting, backfilling, mixing behaviors, stream-name mappings, and multiple job scenarios.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
pkg/variantregistry/ocp.go (1)

1289-1296: Consider adding a brief godoc explaining the rationale.

The //nolint:unparam suggests awareness that all branches return the same value. A brief comment noting this is intentional for forward-compatibility (when RHCOS 10 becomes default for some major version) would clarify intent for future maintainers.

📝 Suggested documentation
+// defaultOSForReleaseMajor returns the default OS variant for a release major version.
+// Currently returns rhcos9 for all versions; the switch prepares for future differentiation.
 func defaultOSForReleaseMajor(major string) string { //nolint:unparam
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/variantregistry/ocp.go` around lines 1289 - 1296, Add a brief godoc
comment above the function defaultOSForReleaseMajor explaining that it
intentionally returns "rhcos9" for all current release majors (hence the
//nolint:unparam) for forward-compatibility, and note the intended behavior
when/if newer RHCOS versions (e.g., rhcos10) become the default for specific
majors so future maintainers understand why all branches currently return the
same value and where to update the function.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/variantregistry/ocp.go`:
- Around line 1289-1296: Add a brief godoc comment above the function
defaultOSForReleaseMajor explaining that it intentionally returns "rhcos9" for
all current release majors (hence the //nolint:unparam) for
forward-compatibility, and note the intended behavior when/if newer RHCOS
versions (e.g., rhcos10) become the default for specific majors so future
maintainers understand why all branches currently return the same value and
where to update the function.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: ddd3adfb-3919-445d-91af-472c353a2927

📥 Commits

Reviewing files that changed from the base of the PR and between f8053b4 and b7ef95b.

📒 Files selected for processing (3)
  • pkg/variantregistry/ocp.go
  • pkg/variantregistry/ocp_test.go
  • pkg/variantregistry/snapshot.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/variantregistry/snapshot.go

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

@neisw
Copy link
Copy Markdown
Contributor

neisw commented Apr 20, 2026

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 20, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 20, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: neisw, petr-muller

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 20, 2026

@petr-muller: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 4f89963 into openshift:main Apr 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants