Skip to content

Conversation

@petr-muller
Copy link
Member

@petr-muller petr-muller commented Jan 27, 2026

The first commit is the most direct approach using a regexp suggested by TRT-2505; any upgrade job following a certain name pattern where the last version is suffixed with a -major segment is considered to be a major update job.

The second commit overwrites the direct approach with a slightly more ambitious change that centralizes upgrade variant detection code into a single method over the version.Version data structures, with a fallback to substring matches. I prefer this variant but kept it in a separate commit for the case we'd prefer the minimal change.

Summary by CodeRabbit

  • New Features

    • Improved upgrade detection: classification now distinguishes major, minor, micro, and multi-step upgrades with better fallbacks and ordering validation.
    • More accurate determination of source/target releases to populate upgrade metadata.
  • Tests

    • Expanded test coverage with many new scenarios (aggregates, nightly/upstream, cross-release, arch/platform variants).
  • Chores

    • Adjusted snapshot data to refine upgrade level annotations.

✏️ Tip: You can customize this high-level summary in your review settings.

@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 Jan 27, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 27, 2026

@petr-muller: This pull request references TRT-2505 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 "4.22.0" version, but no target version was set.

Details

In response to this:

This is the most direct approach suggested by TRT-2505; any upgrade job following a typical update job name pattern where the last version is suffixed with a -major segment is considered to be a major update job.

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 Jan 27, 2026

Walkthrough

Switches release extraction to return parsed version.Version slices, broadens upgrade-detection regex and replaces prior string-based multi/minor logic with a new upgradeVariant(logger, releases, jobName) helper; updates setRelease to use Version. Adds many test cases and small snapshot value changes.

Changes

Cohort / File(s) Summary
Variant registry logic
pkg/variantregistry/ocp.go
Replaced string-based release parsing with extractReleases(jobName) []version.Version; renamed regex upgradeMinorRegexupgradeMajorMinorRegex; added upgradeVariant(logger, releases, jobName) string; setRelease now accepts logger logrus.FieldLogger and populates Release/FromRelease fields using Original() and Segments(); sorting, deduplication and nil-handling adjusted. Review: parsing, sort/compare, nil returns, and logger warnings.
Tests (expanded cases)
pkg/variantregistry/ocp_test.go
Added numerous table-driven test entries to TestVariantSyncer exercising aggregated upgrades, nightly/upstream scenarios, platform/arch variations, and many release-from/to combinations; verify variant maps (Release/FromRelease/upgrade classification). Review: expected variant values and new edge cases.
Snapshots
pkg/variantregistry/snapshot.yaml
Updated several periodic snapshot entries changing Upgrade from minor to micro. Review: verify intended semantic change in snapshot data only.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 6 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% 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.
Title check ✅ Passed The title 'TRT-2505: Add major update variant' directly and specifically describes the main change: introducing support for a 'major' update variant, which aligns with the core refactoring from multi-upgrade logic to a nuanced upgradeVariant pathway that classifies upgrades as major, minor, micro, or multi.
Go Error Handling ✅ Passed Error handling follows Go best practices with proper error checks, nil validation before dereferences, bounds checking in slice access, error wrapping with context, and no inappropriate panic() calls.
Sql Injection Prevention ✅ Passed Pull request modifies variant detection logic in ocp.go without introducing SQL injection vulnerabilities since job names are only processed locally after safe retrieval from the database.
Excessive Css In React Should Use Styles ✅ Passed This check is not applicable to the provided pull request. The PR modifies Go source code files and a YAML configuration file, which are backend infrastructure components. The custom check is specifically designed for React components with inline CSS/styled objects, and does not apply to Go backend code.
Single Responsibility And Clear Naming ✅ Passed The pull request maintains strong adherence to single responsibility and clear naming principles with focused fields and consistently action-oriented method names.

✏️ 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

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.5.0)

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.

@petr-muller
Copy link
Member Author

petr-muller commented Jan 27, 2026

/hold

I'd like to clarify some details in TRT-2505 first

@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 Jan 27, 2026
@openshift-ci openshift-ci bot requested review from smg247 and xueqzhan January 27, 2026 13:29
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 27, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: petr-muller
Once this PR has been reviewed and has the lgtm label, please assign deepsm007 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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-robot
Copy link

openshift-ci-robot commented Jan 27, 2026

@petr-muller: This pull request references TRT-2505 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 "4.22.0" version, but no target version was set.

Details

In response to this:

This is the most direct approach suggested by TRT-2505; any upgrade job following a typical update job name pattern where the last version is suffixed with a -major segment is considered to be a major update job.

Summary by CodeRabbit

  • New Features

  • Enhanced upgrade detection now recognizes major version upgrades.

  • Tests

  • Added test coverage for major upgrade detection scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

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

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 28, 2026
@petr-muller petr-muller marked this pull request as draft January 28, 2026 09:24
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 28, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 28, 2026

@petr-muller: This pull request references TRT-2505 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 "4.22.0" version, but no target version was set.

Details

In response to this:

This is the most direct approach suggested by TRT-2505; any upgrade job following a typical update job name pattern where the last version is suffixed with a -major segment is considered to be a major update job.

Summary by CodeRabbit

  • New Features

  • Improved upgrade detection and classification now recognizes major, minor, micro, and multi-step upgrades with better fallbacks for ambiguous versions.

  • More accurate extraction of source/target release bounds to populate upgrade metadata.

  • Tests

  • Added coverage for major-upgrade-from-nightly scenarios to ensure correct variant detection.

✏️ Tip: You can customize this high-level summary in your review settings.

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

🤖 Fix all issues with AI agents
In `@pkg/variantregistry/ocp.go`:
- Around line 320-323: The major/minor upgrade detection regexes
(upgradeMajorMinorRegex and related upgradeOutOfChangeRegex/upgradeRegex) are
too strict and miss common adjacent-version forms like "-4.10-4.11" or
"-4.10-to-4.11", causing upgradeVariant logic to misclassify as "micro"; update
upgradeMajorMinorRegex to also match two adjacent version tokens separated by a
single token (dash, "to", or similar single-token separators) and ensure it
still detects single-version-major markers like "-4.10-major" and "-4.10-minor";
verify the adjusted pattern is used by the upgradeVariant code path and keep
upgradeOutOfChangeRegex and upgradeRegex semantics unchanged while broadening
allowed separators so typical "-4.10-4.11" and "-4.10-to-4.11" job names are
classified as major/minor upgrades.

This is the most direct approach suggested by TRT-2505; any upgrade job following a typical update job name pattern where the last version is suffixed with a `-major` segment is considered to be a major update job.
@petr-muller petr-muller force-pushed the trt-2505-major-update-variant branch from 1d0b4ee to 9ef9c9f Compare January 28, 2026 11:59
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 28, 2026
@petr-muller petr-muller marked this pull request as ready for review January 28, 2026 11:59
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 28, 2026
@openshift-ci openshift-ci bot requested a review from sosiouxme January 28, 2026 12:01
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 28, 2026

@petr-muller: This pull request references TRT-2505 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 "4.22.0" version, but no target version was set.

Details

In response to this:

This is the most direct approach suggested by TRT-2505; any upgrade job following a typical update job name pattern where the last version is suffixed with a -major segment is considered to be a major update job.

Summary by CodeRabbit

  • New Features

  • Improved upgrade detection and classification now recognizes major, minor, micro, and multi-step upgrades with better fallbacks for ambiguous versions.

  • More robust release parsing that produces structured source/target release info for variant metadata.

  • Tests

  • Added test cases covering major/minor upgrade scenarios (including nightly and stable origins) across platforms.

  • Bug Fixes

  • Updated snapshot entries to correct upgrade level semantics (minor → micro) for periodic jobs.

✏️ Tip: You can customize this high-level summary in your review settings.

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

openshift-ci-robot commented Jan 28, 2026

@petr-muller: This pull request references TRT-2505 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 "4.22.0" version, but no target version was set.

Details

In response to this:

The first commit is the most direct approach using a regexp suggested by TRT-2505; any upgrade job following a certain name pattern where the last version is suffixed with a -major segment is considered to be a major update job.

The second commit overwrites the direct approach with a slightly more ambitious change that centralizes upgrade variant detection code into a single method over the version.Version data structures, with a fallback to substring matches. I prefer this variant but kept it in a separate commit for the case we'd prefer the minimal change.

Summary by CodeRabbit

  • New Features

  • Improved upgrade detection and classification now recognizes major, minor, micro, and multi-step upgrades with better fallbacks for ambiguous versions.

  • More accurate extraction of source/target release bounds to populate upgrade metadata.

  • Tests

  • Added coverage for major-upgrade-from-nightly scenarios to ensure correct variant detection.

✏️ Tip: You can customize this high-level summary in your review settings.

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
Copy link
Member Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 28, 2026
Suite: unknown
Topology: ha
Upgrade: minor
Upgrade: micro
Copy link
Member Author

Choose a reason for hiding this comment

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

The job name is ...release-4.12-amd64-nightly-4.12-upgrade-from-aro-4.12-aro-f60 so previously these were misclassified.

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e

Move the code responsible for detecting update variant into a single
method operating over `version.Version` structure.
Resolves the following misclassified jobs, surfaced after code cleanup:

```
ocp_test.go:1754:
    Summary of changes:
ocp_test.go:1757: Changed Upgrade (minor -> micro)
       - periodic-ci-openshift-openshift-tests-private-release-4.12-amd64-nightly-4.12-upgrade-from-aro-4.12-aro-f60
       - periodic-ci-openshift-openshift-tests-private-release-4.13-amd64-nightly-4.13-upgrade-from-aro-4.13-aro-f60
       - periodic-ci-openshift-openshift-tests-private-release-4.14-amd64-nightly-4.14-upgrade-from-aro-4.14-aro-f60
       - periodic-ci-openshift-openshift-tests-private-release-4.15-amd64-nightly-4.15-upgrade-from-aro-4.15-aro-f60
ocp_test.go:1759:
    ****** Run `make update-variants` to update the snapshot and accept these changes.
````
@petr-muller petr-muller force-pushed the trt-2505-major-update-variant branch from 9ef9c9f to 8f79ce7 Compare January 30, 2026 19:18
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 30, 2026

@petr-muller: This pull request references TRT-2505 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 "4.22.0" version, but no target version was set.

Details

In response to this:

The first commit is the most direct approach using a regexp suggested by TRT-2505; any upgrade job following a certain name pattern where the last version is suffixed with a -major segment is considered to be a major update job.

The second commit overwrites the direct approach with a slightly more ambitious change that centralizes upgrade variant detection code into a single method over the version.Version data structures, with a fallback to substring matches. I prefer this variant but kept it in a separate commit for the case we'd prefer the minimal change.

Summary by CodeRabbit

  • New Features

  • Improved upgrade detection: classification now distinguishes major, minor, micro, and multi-step upgrades with better fallbacks and ordering validation.

  • More accurate determination of source/target releases to populate upgrade metadata.

  • Tests

  • Expanded test coverage with many new scenarios (aggregates, nightly/upstream, cross-release, arch/platform variants).

  • Chores

  • Adjusted snapshot data to refine upgrade level annotations.

✏️ Tip: You can customize this high-level summary in your review settings.

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 30, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

4 participants