Skip to content

Conversation

@Prucek
Copy link
Member

@Prucek Prucek commented Nov 25, 2025

Populating release gating jobs in Pre-branching generated by the generated-release-gating-jobs was, until now, doing only a subset of all release gating jobs. Utilizing the sippy config, we can get all the release gating jobs and their files and update all of them using the existing bumper.

Edit: added env var bumping

Result: openshift/release#71837

@openshift-ci-robot
Copy link
Contributor

Pipeline controller notification
This repository 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: LGTM mode

@coderabbitai
Copy link

coderabbitai bot commented Nov 25, 2025

Walkthrough

Adds a Sippy config parser and optional Sippy-based discovery of ci-operator config files; integrates Sippy into the bumper with a new constructor/flags, updates file-discovery branching, and extends bump logic to update Branch metadata and handle nil workflows.

Changes

Cohort / File(s) Summary
Sippy integration & utilities
pkg/branchcuts/bumper/sippy.go, pkg/branchcuts/bumper/sippy_test.go
New Sippy types and loader, methods to retrieve informing/blocking jobs, mapping from Prow job names to ci-operator config filenames (JobNameToConfigFile, buildConfigFilename, findJobMetadata), batch helpers to resolve job lists to config files, related-release helper, and tests covering mapping, loading, filename building, and related-release logic.
Bumper: constructor & file discovery
pkg/branchcuts/bumper/gen-release-jobs-bumper.go
Adds sippyConfigPath and useSippyConfig fields and NewGeneratedReleaseGatingJobsBumperWithSippy; refactors GetFiles() to choose between getFilesFromSippy and getFilesFromRegex; adds private helpers for both discovery paths.
Bumper: filename/content bumping & tests handling
pkg/branchcuts/bumper/gen-release-jobs-bumper.go, pkg/branchcuts/bumper/gen-release-jobs-bumper_test.go
BumpFilename and BumpContent now update Branch metadata alongside Variant; bump logic updates zz_generated_metadata for both Branch and Variant and adjusts test intervals; bumpTests and step-level functions add nil checks for MultiStageTestConfiguration.Workflow and introduce bumpStepEnvVars to update environment variables encoding major versions; tests extended to include Environment variables.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Inspect error handling and fallback from Sippy discovery to regex-based discovery.
  • Review findJobMetadata (filesystem traversal and YAML parsing) for correctness, performance, and edge cases.
  • Verify Branch and Variant updates in zz_generated_metadata and filename generation produce correct, non-ambiguous filenames.
  • Check nil-safety around MultiStageTestConfiguration.Workflow and correctness of env var bumping logic in new helpers.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 4605cf5 and 0e57c9d.

📒 Files selected for processing (2)
  • pkg/branchcuts/bumper/gen-release-jobs-bumper.go (9 hunks)
  • pkg/branchcuts/bumper/gen-release-jobs-bumper_test.go (4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • pkg/branchcuts/bumper/gen-release-jobs-bumper.go
  • pkg/branchcuts/bumper/gen-release-jobs-bumper_test.go
🔇 Additional comments (13)
pkg/branchcuts/bumper/gen-release-jobs-bumper.go (11)

29-30: LGTM: Clean addition of Sippy integration fields.

The new fields properly support the Sippy-based file discovery feature.


35-49: LGTM: Backward compatibility preserved.

The updated constructor properly defaults to regex-based file discovery, maintaining existing behavior.


51-67: LGTM: Well-designed Sippy constructor.

The constructor properly initializes Sippy integration while retaining the regex for fallback scenarios.


69-74: LGTM: Clean strategy pattern implementation.

The conditional delegation properly routes to the appropriate file discovery method.


76-85: LGTM: Clean extraction of regex-based discovery.

The logic is unchanged from the original implementation, just properly extracted into a separate method.


129-133: LGTM: Branch metadata now properly bumped.

Consistent with the Variant bumping logic, and ensures Branch metadata stays synchronized.


163-166: LGTM: Branch metadata properly bumped in content.

Correctly mirrors the Variant bumping logic to keep metadata consistent.


240-242: LGTM: Environment variable bumping properly integrated.

The call to bumpStepEnvVars is well-placed and handles errors appropriately.


253-257: LGTM: Critical nil check prevents panic.

The nil guard for Workflow prevents a potential nil pointer dereference, as the field is optional.


265-284: Verify the aggressive environment variable bumping logic.

Line 276 uses mm.Major == major to determine if an environment variable should be bumped. This will bump ANY environment variable whose value matches the current major version (e.g., 4.10), not just version-related variables.

For instance, if bumping from 4.10 to 4.11, an unrelated env var like TIMEOUT_VERSION="4.10" would also be bumped to 4.11, even if unintended.

While the tests suggest this is intentional, please confirm this broad matching is the desired behavior and won't cause false positives.

Consider restricting the condition to known version-related env var patterns if false positives are a concern:

-	if envKey == ocpReleaseEnvVarName || mm.Major == major {
+	if envKey == ocpReleaseEnvVarName || (strings.Contains(envKey, "VERSION") && mm.Major == major) {

306-314: Same aggressive bumping logic in step environment variables.

This logic mirrors bumpStepEnvVars at line 276, applying the same broad matching criteria (mm.Major == major) to step-level environment variables. The same verification concerns apply here.

pkg/branchcuts/bumper/gen-release-jobs-bumper_test.go (2)

114-130: LGTM: Test coverage for environment variable bumping.

The test properly validates the new environment variable bumping logic at both the test configuration and step levels, including the broad matching behavior for variables with major version values.


174-190: LGTM: Test expectations align with implementation.

The expected outputs correctly validate that all environment variables with matching major versions are bumped, consistent with the implementation in bumpStepEnvVars and bumpTestStepEnvVars.

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 25, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Prucek

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 Nov 25, 2025
Copy link

@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 (3)
pkg/branchcuts/bumper/sippy.go (1)

247-249: Consider logging when jobs lack extra_refs.

Jobs without extra_refs are silently skipped here. Since these are jobs you're actively looking for (in the needed map), a debug log would help diagnose why certain jobs aren't being resolved.

 			if len(job.ExtraRefs) == 0 {
+				logrus.Debugf("skipping job %s: no extra_refs", job.Name)
 				continue
 			}
pkg/branchcuts/bumper/sippy_test.go (1)

9-148: Consider adding edge case tests.

The test covers the happy path well, but consider adding test cases for:

  1. A periodic job that doesn't exist in any job file (job not found error)
  2. A periodic job found in job file but the corresponding config file doesn't exist

These would improve coverage of error paths in JobNameToConfigFile.

pkg/branchcuts/bumper/gen-release-jobs-bumper.go (1)

35-67: Minor duplication in constructors.

Both constructors duplicate the regex compilation logic. Consider extracting to reduce duplication, though this is optional given the simplicity.

+func newBumperCommon(ocpVer, jobsDir string, newIntervalValue int) (*GeneratedReleaseGatingJobsBumper, error) {
+	mm, err := ocplifecycle.ParseMajorMinor(ocpVer)
+	if err != nil {
+		return nil, fmt.Errorf("parse release: %w", err)
+	}
+	mmRegexp := fmt.Sprintf("%d\\.%d", mm.Major, mm.Minor)
+	getFilesRegexp := regexp.MustCompile(fmt.Sprintf(releaseJobsRegexPatternFormat, mmRegexp))
+	return &GeneratedReleaseGatingJobsBumper{
+		mm:               mm,
+		getFilesRegexp:   getFilesRegexp,
+		jobsDir:          jobsDir,
+		newIntervalValue: newIntervalValue,
+	}, nil
+}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 989e9eb and c3056f0.

📒 Files selected for processing (3)
  • pkg/branchcuts/bumper/gen-release-jobs-bumper.go (6 hunks)
  • pkg/branchcuts/bumper/sippy.go (1 hunks)
  • pkg/branchcuts/bumper/sippy_test.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • pkg/branchcuts/bumper/sippy_test.go
  • pkg/branchcuts/bumper/gen-release-jobs-bumper.go
  • pkg/branchcuts/bumper/sippy.go
🧬 Code graph analysis (3)
pkg/branchcuts/bumper/sippy_test.go (1)
pkg/branchcuts/bumper/sippy.go (3)
  • JobNameToConfigFile (69-85)
  • LoadSippyConfig (25-37)
  • ProwJobMetadata (60-65)
pkg/branchcuts/bumper/gen-release-jobs-bumper.go (3)
pkg/api/ocplifecycle/ocplifecycle.go (1)
  • ParseMajorMinor (235-250)
pkg/branchcuts/bumper/sippy.go (1)
  • GetConfigFilesForReleaseFromSippy (278-301)
pkg/api/types.go (2)
  • Metadata (156-161)
  • MultiStageTestConfiguration (1192-1233)
pkg/branchcuts/bumper/sippy.go (1)
pkg/prowgen/podspec.go (1)
  • Variant (561-569)
🔇 Additional comments (10)
pkg/branchcuts/bumper/sippy.go (5)

14-22: LGTM!

The struct definitions are clean and properly tagged for YAML unmarshalling.


25-57: LGTM!

Loading and accessor methods are well-structured with proper error wrapping.


94-157: LGTM!

The function correctly walks the directory tree, handles parsing errors gracefully by continuing to the next file, and uses filepath.SkipAll for early termination when the job is found.


159-202: LGTM!

Good use of caching via buildJobMetadataCache to avoid repeated filesystem walks, and proper deduplication of config files.


277-301: LGTM!

End-to-end integration correctly combines both informing and blocking jobs before resolving to config files.

pkg/branchcuts/bumper/sippy_test.go (2)

150-201: LGTM!

The test covers config loading and accessor methods. The symmetric GetBlockingJobsForRelease isn't tested but follows the same pattern.


203-249: LGTM!

Good coverage of filename building with and without variants.

pkg/branchcuts/bumper/gen-release-jobs-bumper.go (3)

121-136: LGTM!

Adding Branch bumping alongside Variant is consistent with the expanded scope of this PR to handle release gating jobs from Sippy config.


158-167: LGTM!

Bumping Branch in zz_generated_metadata is consistent with the filename bumping logic.


250-254: Good nil check addition.

The Workflow field is a *string and can be nil. This guard prevents a potential nil pointer dereference.

Comment on lines +87 to +104
func (b *GeneratedReleaseGatingJobsBumper) getFilesFromSippy() ([]string, error) {
releaseVersion := fmt.Sprintf("%d.%d", b.mm.Major, b.mm.Minor)
configRootDir := filepath.Dir(filepath.Dir(b.jobsDir))

configFiles, err := GetConfigFilesForReleaseFromSippy(b.sippyConfigPath, releaseVersion, configRootDir)
if err != nil {
logrus.WithError(err).Warnf("failed to get config files from Sippy for release %s, falling back to regex", releaseVersion)
return b.getFilesFromRegex()
}

if len(configFiles) == 0 {
logrus.Warnf("no config files found from Sippy for release %s, falling back to regex", releaseVersion)
return b.getFilesFromRegex()
}

logrus.Infof("found %d config files from Sippy for release %s", len(configFiles), releaseVersion)
return configFiles, nil
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

Potential path resolution issue.

Line 89 computes configRootDir by going up two directories from jobsDir. If jobsDir is /repo/ci-operator/jobs, then configRootDir becomes /repo. However, GetConfigFilesForReleaseFromSippy and GetConfigFilesFromSippyJobs expect configDir to be the actual config directory (e.g., /repo/ci-operator/config).

Inside GetConfigFilesFromSippyJobs (sippy.go line 167), it computes jobsRootDir = filepath.Join(filepath.Dir(configDir), "jobs"). If configDir is /repo, this yields /jobs instead of /repo/ci-operator/jobs.

Consider fixing the path:

 func (b *GeneratedReleaseGatingJobsBumper) getFilesFromSippy() ([]string, error) {
 	releaseVersion := fmt.Sprintf("%d.%d", b.mm.Major, b.mm.Minor)
-	configRootDir := filepath.Dir(filepath.Dir(b.jobsDir))
+	configRootDir := filepath.Join(filepath.Dir(b.jobsDir), "config")
 
 	configFiles, err := GetConfigFilesForReleaseFromSippy(b.sippyConfigPath, releaseVersion, configRootDir)

🏁 Script executed:

#!/bin/bash
# Verify the directory structure assumptions in the codebase
# Check how jobsDir is typically structured

rg -n "jobsDir" pkg/branchcuts/bumper/ -A2 -B2

# Check the expected directory layout
ast-grep --pattern 'ci-operator/config'
ast-grep --pattern 'ci-operator/jobs'

Length of output: 7101


I need to verify the actual implementation in sippy.go to confirm the path resolution issue.

Let me check the actual sippy.go implementation to verify the path handling:

Now I need to examine the actual sippy.go implementation to verify the path logic:


🏁 Script executed:

#!/bin/bash
# Find and display sippy.go functions to verify the path calculation
rg -n "GetConfigFilesForReleaseFromSippy|GetConfigFilesFromSippyJobs" pkg/branchcuts/bumper/ -A20 | head -100

Length of output: 5211


Path calculation error causes incorrect job directory resolution.

Line 89 computes configRootDir by going up two directories from jobsDir, passing the repo root instead of the config directory path. At sippy.go line 167, GetConfigFilesFromSippyJobs computes jobsRootDir := filepath.Join(filepath.Dir(configDir), "jobs"). With configDir set to the repo root (e.g., /tmp/xyz), this yields /tmp/jobs instead of the correct /tmp/xyz/ci-operator/jobs, causing job metadata lookups to fail.

Fix the path derivation:

 func (b *GeneratedReleaseGatingJobsBumper) getFilesFromSippy() ([]string, error) {
 	releaseVersion := fmt.Sprintf("%d.%d", b.mm.Major, b.mm.Minor)
-	configRootDir := filepath.Dir(filepath.Dir(b.jobsDir))
+	configRootDir := filepath.Join(filepath.Dir(b.jobsDir), "config")
 
 	configFiles, err := GetConfigFilesForReleaseFromSippy(b.sippyConfigPath, releaseVersion, configRootDir)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func (b *GeneratedReleaseGatingJobsBumper) getFilesFromSippy() ([]string, error) {
releaseVersion := fmt.Sprintf("%d.%d", b.mm.Major, b.mm.Minor)
configRootDir := filepath.Dir(filepath.Dir(b.jobsDir))
configFiles, err := GetConfigFilesForReleaseFromSippy(b.sippyConfigPath, releaseVersion, configRootDir)
if err != nil {
logrus.WithError(err).Warnf("failed to get config files from Sippy for release %s, falling back to regex", releaseVersion)
return b.getFilesFromRegex()
}
if len(configFiles) == 0 {
logrus.Warnf("no config files found from Sippy for release %s, falling back to regex", releaseVersion)
return b.getFilesFromRegex()
}
logrus.Infof("found %d config files from Sippy for release %s", len(configFiles), releaseVersion)
return configFiles, nil
}
func (b *GeneratedReleaseGatingJobsBumper) getFilesFromSippy() ([]string, error) {
releaseVersion := fmt.Sprintf("%d.%d", b.mm.Major, b.mm.Minor)
configRootDir := filepath.Join(filepath.Dir(b.jobsDir), "config")
configFiles, err := GetConfigFilesForReleaseFromSippy(b.sippyConfigPath, releaseVersion, configRootDir)
if err != nil {
logrus.WithError(err).Warnf("failed to get config files from Sippy for release %s, falling back to regex", releaseVersion)
return b.getFilesFromRegex()
}
if len(configFiles) == 0 {
logrus.Warnf("no config files found from Sippy for release %s, falling back to regex", releaseVersion)
return b.getFilesFromRegex()
}
logrus.Infof("found %d config files from Sippy for release %s", len(configFiles), releaseVersion)
return configFiles, nil
}
🤖 Prompt for AI Agents
In pkg/branchcuts/bumper/gen-release-jobs-bumper.go around lines 87 to 104, the
code computes configRootDir by calling filepath.Dir(filepath.Dir(b.jobsDir))
which yields the repo root and causes GetConfigFilesForReleaseFromSippy to
resolve the wrong jobs path; change it to compute the config directory directly
(set configRootDir := filepath.Dir(b.jobsDir)) so it points at the ci-operator
config directory (e.g., /tmp/xyz/ci-operator) before calling
GetConfigFilesForReleaseFromSippy.

@petr-muller
Copy link
Member

/cc

@openshift-ci openshift-ci bot requested a review from petr-muller November 25, 2025 18:53
envValue := env[envKey]
mm, err := ocplifecycle.ParseMajorMinor(envValue)
if err != nil {
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the logger and continue, do not swallow the error silently,

Copy link
Member Author

Choose a reason for hiding this comment

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

with this I wanted to check if an env variable is parsable as major.minor then we can work with it, if not, I don't care about it. There is no error, it's just not a openshift version

@Prucek
Copy link
Member Author

Prucek commented Nov 27, 2025

/test e2e
/test images
/override ci/prow/breaking-changes

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 27, 2025

@Prucek: Overrode contexts on behalf of Prucek: ci/prow/breaking-changes

Details

In response to this:

/test e2e
/test images
/override ci/prow/breaking-changes

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 27, 2025

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants