Skip to content

Conversation

@smg247
Copy link
Member

@smg247 smg247 commented Feb 10, 2026

I believe that the variant registry needs to have normalization for job names now that openshift/release has migrated from master to main. This solution only affects that repository, and won't normalize others.

Currently, we have no regressions in the All tab of the RegressedTestsModal, and there are other oddities in CR based on this branch migration.

I don't have a good way to confirm that this will solve the issue locally. I would like to merge this and run the job and check the results.

Summary by CodeRabbit

  • New Features

    • Implemented job name normalization in OpenShift variant processing, including collision-resolution that prefers "-main-" over "-master-".
    • Enhanced logging to report when names are normalized and when collisions are resolved.
  • Tests

    • Added test coverage validating normalization and collision scenarios.

@openshift-ci-robot
Copy link

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 openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 10, 2026
@openshift-ci-robot
Copy link

@smg247: This pull request explicitly references no jira issue.

Details

In response to this:

I believe that the variant registry needs to have normalization for job names now that openshift/release has migrated from master to main. This solution only affects that repository, and won't normalize others.

Currently, we have no regressions in the All tab of the RegressedTestsModal, and there are other oddities in CR based on this branch migration.

I don't have a good way to confirm that this will solve the issue locally. I would like to merge this and run the job and check the results.

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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

Walkthrough

Adds job-name normalization to the OCP variant registry: a new normalizeJobNameForVariants is applied before computing and storing variants, with tracking of original sources and collision resolution between normalized names; conditional logging reports when names are normalized or collisions are resolved.

Changes

Cohort / File(s) Summary
OCP Variant Normalization
pkg/variantregistry/ocp.go
Introduce normalizeJobNameForVariants; compute and use normalizedJobName for variant calculation and variantsByJob keys; add variantsByJobSource tracking, collision-resolution preferring -main- over -master-, and conditional logging around normalization and collisions.
Variant Registry Tests
pkg/variantregistry/ocp_test.go
Add table-driven test TestNormalizeJobNameForVariants covering openshift-release master->main and ci->main normalization, already-main passthrough, and non-openshift-release/master unchanged cases.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 6 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Go Error Handling ✅ Passed Code follows proper Go error handling patterns without anti-patterns like ignored errors, missing nil checks, or unjustified panic calls.
Sql Injection Prevention ✅ Passed No SQL queries or database operations found in modified files. Changes only involve job name normalization string manipulation.
Excessive Css In React Should Use Styles ✅ Passed The custom check for 'Excessive CSS in React Should Use Styles' is not applicable to this PR. The PR modifies Go backend code for OpenShift variant registry functionality with standard Go imports only, containing no React, JSX, CSS, or useStyles patterns.
Single Responsibility And Clear Naming ✅ Passed The pull request introduces changes that follow the Single Responsibility and Clear Naming principles. The new normalizeJobNameForVariants function has an explicit, action-oriented name that clearly describes its single responsibility of normalizing job names for the variant registry. The variantsByJobSource map has a descriptive name that communicates its specific purpose. All changes are well-scoped to handle openshift-release job name transitions, with clear comments and temporary logic marked for eventual removal. The package maintains its cohesive purpose of managing OCP variant classification, and no generic names like Manager or Handler are introduced.
Title check ✅ Passed The title clearly describes the main change: adding normalization for job names during variant generation specifically for the openshift/release repository.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@openshift-ci openshift-ci bot requested review from stbenjam and xueqzhan February 10, 2026 15:10
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 10, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: smg247

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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 10, 2026
Copy link
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: 2

🤖 Fix all issues with AI agents
In `@pkg/variantregistry/ocp.go`:
- Around line 262-266: The current normalizeJobNameForVariants function is too
broad: it uses strings.Contains and ReplaceAll which may affect repos like
"openshift-release-operator" or multiple "-master-" occurrences; update
normalizeJobNameForVariants to parse the jobName into segments (or use a regex)
to explicitly detect the repo segment equal to "openshift/release" (or the token
"openshift-release" as the exact repo segment) and only replace the single
branch token "-master-" for that segment once; ensure you target the branch
portion (not other path parts) and perform a single replacement rather than
ReplaceAll so only the intended branch token is normalized.
- Around line 237-245: The current blind assignment to variantsByJob for key
normalizedJobName is nondeterministic when multiple goroutines collapse names
like "master" and "main"; change the logic so under variantsByJobMu you first
check if an entry already exists and only overwrite it when the new source
should win by a deterministic rule (e.g., create a companion map
variantsByJobSource[string]string or change the stored value to include Source;
on insert check existingSource := variantsByJobSource[normalizedJobName]; if
existingSource != "" then if strings.Contains(existingSource, "master") &&
strings.Contains(jlr.JobName, "main") { overwrite
variantsByJob[normalizedJobName] = variants and set variantsByJobSource[...] =
jlr.JobName } else { keep existing and skip overwrite } else { set
variantsByJob[...] = variants and variantsByJobSource[...] = jlr.JobName }; keep
using normalizeJobNameForVariants, jlr.JobName, normalizedJobName and
v.CalculateVariantsForJob and guard all accesses with variantsByJobMu.
🧹 Nitpick comments (1)
pkg/variantregistry/ocp_test.go (1)

1794-1833: Add a guard case for repos like openshift-release-operator.

Given the scope requirement (“only openshift/release”), add a test case ensuring a repo name that contains openshift-release but isn’t openshift/release remains unchanged.

🧪 Suggested test addition
 	{
 		name:     "other repos with master unchanged",
 		jobName:  "periodic-ci-openshift-hive-master-e2e-aws",
 		expected: "periodic-ci-openshift-hive-master-e2e-aws",
 	},
+	{
+		name:     "openshift-release-operator should remain unchanged",
+		jobName:  "periodic-ci-openshift-release-operator-master-nightly-4.16-e2e-aws-ovn",
+		expected: "periodic-ci-openshift-release-operator-master-nightly-4.16-e2e-aws-ovn",
+	},

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e

@openshift-ci-robot
Copy link

@smg247: This pull request explicitly references no jira issue.

Details

In response to this:

I believe that the variant registry needs to have normalization for job names now that openshift/release has migrated from master to main. This solution only affects that repository, and won't normalize others.

Currently, we have no regressions in the All tab of the RegressedTestsModal, and there are other oddities in CR based on this branch migration.

I don't have a good way to confirm that this will solve the issue locally. I would like to merge this and run the job and check the results.

Summary by CodeRabbit

  • New Features

  • Implemented job name normalization in OpenShift variant processing, including collision-resolution that prefers "-main-" over "-master-".

  • Enhanced logging to report when names are normalized and when collisions are resolved.

  • Tests

  • Added test coverage validating normalization and collision 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.

@smg247 smg247 changed the title NO-JIRA: normalize job names during variant generation for openshift/release TRT-2544: normalize job names during variant generation for openshift/release Feb 10, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 10, 2026

@smg247: This pull request references TRT-2544 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 ticket to target the "4.22.0" version, but no target version was set.

Details

In response to this:

I believe that the variant registry needs to have normalization for job names now that openshift/release has migrated from master to main. This solution only affects that repository, and won't normalize others.

Currently, we have no regressions in the All tab of the RegressedTestsModal, and there are other oddities in CR based on this branch migration.

I don't have a good way to confirm that this will solve the issue locally. I would like to merge this and run the job and check the results.

Summary by CodeRabbit

  • New Features

  • Implemented job name normalization in OpenShift variant processing, including collision-resolution that prefers "-main-" over "-master-".

  • Enhanced logging to report when names are normalized and when collisions are resolved.

  • Tests

  • Added test coverage validating normalization and collision 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.

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e

@smg247
Copy link
Member Author

smg247 commented Feb 10, 2026

/hold we may not need this

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 10, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 10, 2026

@smg247: 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.

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants