Skip to content

feat(prowgen): propagate run_if_changed/skip_if_only_changed for images jobs#5009

Open
Prucek wants to merge 1 commit intoopenshift:mainfrom
Prucek:run-if-changed
Open

feat(prowgen): propagate run_if_changed/skip_if_only_changed for images jobs#5009
Prucek wants to merge 1 commit intoopenshift:mainfrom
Prucek:run-if-changed

Conversation

@Prucek
Copy link
Member

@Prucek Prucek commented Mar 12, 2026

  • Refactor images stanza into ImageConfiguration struct
  • Introduce a new ImageConfiguration struct that wraps the images list and its associated run conditions into a single cohesive configuration block
images:
   run_if_changed: "^src/"
   skip_if_only_changed: "^docs/"
   build_if_affected: true
   items:
   - from: base
     to: my-image

@openshift-ci-robot
Copy link
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

@Prucek Prucek marked this pull request as ready for review March 12, 2026 12:59
@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 36160c6d-6111-4f99-ab55-2987d77b891b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Replace the flat Images slice on ReleaseBuildConfiguration with a new exported ImageConfiguration (holds Items plus image-level change-detection flags and BuildIfAffected); update all call sites, validation, defaults, deepcopy, CLI/registry logic, prow job generation/merging, and tests to use Images.Items and to propagate the new image-change fields.

Changes

Cohort / File(s) Summary
API type & deepcopy
pkg/api/types.go, pkg/api/zz_generated.deepcopy.go, pkg/webreg/zz_generated.ci_operator_reference.go
Introduce ImageConfiguration (RunIfChanged, SkipIfOnlyChanged, PipelineRunIfChanged, PipelineSkipIfOnlyChanged, BuildIfAffected, Items []ProjectDirectoryImageBuildStepConfiguration); change ReleaseBuildConfiguration.Images to that type; add DeepCopy methods and update generated YAML reference.
Prow job generation & jobbase
pkg/prowgen/prowgen.go, pkg/prowgen/prowgen_test.go, pkg/prowgen/testdata/*, pkg/prowgen/jobbase.go, pkg/prowgen/jobbase_test.go, pkg/prowgen/testdata/zz_fixture_*.yaml
Iterate over configSpec.Images.Items; propagate the four image change-detection flags into presubmit/postsubmit generation; update fixtures/tests to use ImageConfiguration{Items: ...} and assert propagation.
Validation & exclusivity logic
pkg/validation/config.go, pkg/validation/test.go, pkg/validation/config_test.go, pkg/validation/graph_test.go, pkg/validation/test_test.go
Switch validation to use Images.Items; add validateImageConfiguration and validateRunIfChangedExclusivity to enforce mutual exclusivity across run/skip and pipeline-run/pipeline-skip fields; add tests for exclusivity and new shape.
Defaults, steps & tooling
pkg/defaults/defaults.go, pkg/defaults/defaults_test.go, pkg/steps/*, pkg/steps/multi_stage/multi_stage_test.go, pkg/tool-detector/detector.go, pkg/tool-detector/detector_test.go, pkg/image-graph-generator/operator.go
Read and write image lists via Images.Items across defaults, runtime step generation, multi-stage steps, tool detection, and image-graph traversal; tests updated to the wrapper shape and BuildIfAffected usage.
Job merging / jobconfig
pkg/jobconfig/files.go, pkg/jobconfig/files_test.go
Remove special-case preservation for *-images jobs; mergePresubmits now derives run/skip/alwaysRun from new config consistently; add test cases covering SkipIfOnlyChanged precedence.
CLI & registry-replacer & repo-init
cmd/ci-operator/main.go, cmd/ci-operator/main_test.go, cmd/registry-replacer/main.go, cmd/registry-replacer/main_test.go, cmd/repo-init/main.go, cmd/repo-init/api.go
Check Images.BuildIfAffected (was top-level BuildImagesIfAffected) and iterate/assign Images.Items in CLI flows, registry replacer, and repo-init; update tests/fixtures to the nested Items shape.
Registry server & replacer testdata
pkg/registry/server/server.go, pkg/registry/server/testdata/*, cmd/registry-replacer/testdata/*
Operate on config.Images.Items for traversal, mutation, pruning and ensure replacement; update many test fixtures to use images.items YAML shape.
Promotion & release steps
pkg/promotion/*, pkg/promotion/promotion_test.go, pkg/steps/release/promote.go, pkg/steps/release/promote_test.go
Build promotion image stream tags and required-image sets from configSpec.Images.Items; update tests to use ImageConfiguration{Items: ...}.
Registry server & job merge outputs / integration fixtures
pkg/registry/server/server.go, test/integration/ci-operator-prowgen/*, many test/integration/* YAMLs
Mass update integration/test fixtures and generated prow job YAML to the new images.items shape and add fixtures asserting propagation of run/skip and pipeline-run/pipeline-skip behaviors.
Misc tests & tooling updates
many *_test.go, pkg/config/testdata/*, pkg/config/testdata/tree/*, pkg/config/testdata/cm/*, pkg/steps/*, pkg/defaults/*, pkg/validation/*
Widespread test and fixture updates to wrap former image slices in ImageConfiguration{Items: ...} and to reflect relocation of BuildIfAffected into the images wrapper.
Scripts
hack/lint.sh
Updated container image reference used to run golangci-lint in the script.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main feature change: propagating run_if_changed and skip_if_only_changed configuration to images jobs in prowgen, which is the core objective of this refactoring PR.
Stable And Deterministic Test Names ✅ Passed Modified test files use Go testing framework with static, descriptive test case names. Ginkgo framework is not used, so the deterministic naming requirement is not applicable.
Test Structure And Quality ✅ Passed Repository uses standard Go testing with table-driven tests, not Ginkgo/Gomega. New tests follow proper Go testing practices with descriptive names, meaningful assertions using cmp.Diff(), single-responsibility cases, and consistency with existing patterns.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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

@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 Mar 12, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 12, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot requested review from pruan-rht and psalajova March 12, 2026 13:04
@openshift-ci openshift-ci bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Mar 12, 2026
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 (1)
pkg/prowgen/prowgen_test.go (1)

814-852: Add a ImagesPipelineRunIfChanged regression case.

This table now covers 3 of the 4 new image change-detection fields, but ImagesPipelineRunIfChanged is still unexercised. A wiring typo in GenerateJobs would currently pass unnoticed because the pipeline-only coverage is limited to ImagesPipelineSkipIfOnlyChanged.

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

In `@pkg/prowgen/prowgen_test.go` around lines 814 - 852, The test table in
prowgen_test.go misses a case for ImagesPipelineRunIfChanged; add a new test
entry (similar to the existing "images job with pipeline_skip_if_only_changed
propagated to presubmit only" case) that sets
ReleaseBuildConfiguration.ImagesPipelineRunIfChanged to a regex and uses the
same ProwgenInfo metadata, so GenerateJobs is exercised for the pipeline-only
"run if changed" field; ensure the test asserts that this field is propagated
only to presubmit jobs (matching how ImagesPipelineSkipIfOnlyChanged is
validated) to catch wiring typos in GenerateJobs.
🤖 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/jobconfig/files.go`:
- Around line 491-500: The compatibility block for "-images" jobs only copies
RunIfChanged/SkipIfOnlyChanged and AlwaysRun; update it to also preserve any
manual pipeline annotations (pipeline_run_if_changed and
pipeline_skip_if_only_changed) from old to merged when merged.RunIfChanged and
merged.SkipIfOnlyChanged are empty — i.e., if old has those annotation keys,
copy them into merged's Annotations map (creating it if nil) alongside copying
RunIfChanged/SkipIfOnlyChanged and setting AlwaysRun=false; also add a
merge/unit test exercising the migration path where ImagesPipeline* are empty in
the new config but the old job contains pipeline_run_if_changed /
pipeline_skip_if_only_changed to assert the merged job preserves those
annotations.

---

Nitpick comments:
In `@pkg/prowgen/prowgen_test.go`:
- Around line 814-852: The test table in prowgen_test.go misses a case for
ImagesPipelineRunIfChanged; add a new test entry (similar to the existing
"images job with pipeline_skip_if_only_changed propagated to presubmit only"
case) that sets ReleaseBuildConfiguration.ImagesPipelineRunIfChanged to a regex
and uses the same ProwgenInfo metadata, so GenerateJobs is exercised for the
pipeline-only "run if changed" field; ensure the test asserts that this field is
propagated only to presubmit jobs (matching how ImagesPipelineSkipIfOnlyChanged
is validated) to catch wiring typos in GenerateJobs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3f8cbbad-276a-41cd-b8a5-e2b93192af72

📥 Commits

Reviewing files that changed from the base of the PR and between 9cf4cec and 8be9907.

📒 Files selected for processing (8)
  • pkg/api/types.go
  • pkg/jobconfig/files.go
  • pkg/jobconfig/files_test.go
  • pkg/prowgen/prowgen.go
  • pkg/prowgen/prowgen_test.go
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_pipeline_skip_if_only_changed_propagated_to_presubmit_only.yaml
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_run_if_changed_propagated_to_presubmit_and_postsubmit.yaml
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_skip_if_only_changed_propagated_to_presubmit_and_postsubmit.yaml

Comment on lines +491 to +500
// For images jobs: if prowgen didn't derive run/skip filters from the ci-operator config
// (i.e. the new job has no filters), preserve any manually-set filters from the existing
// job file. Once all repos set images_run_if_changed / images_skip_if_only_changed in
// their ci-operator config this workaround can be removed.
if strings.HasSuffix(merged.Name, "-images") {
if old.RunIfChanged != "" || old.SkipIfOnlyChanged != "" {
merged.RunIfChanged = old.RunIfChanged
merged.SkipIfOnlyChanged = old.SkipIfOnlyChanged
merged.AlwaysRun = false
if merged.RunIfChanged == "" && merged.SkipIfOnlyChanged == "" {
if old.RunIfChanged != "" || old.SkipIfOnlyChanged != "" {
merged.RunIfChanged = old.RunIfChanged
merged.SkipIfOnlyChanged = old.SkipIfOnlyChanged
merged.AlwaysRun = false
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

Preserve manual pipeline_*_if_changed annotations for existing images jobs.

This compatibility block only carries forward RunIfChanged / SkipIfOnlyChanged. Existing repos that still rely on manual pipeline_run_if_changed or pipeline_skip_if_only_changed annotations on the generated *-images presubmit will lose those second-stage filters on the next merge when the new ci-operator config leaves ImagesPipeline* empty. That changes job triggering behavior during rollout.

Suggested direction
 if strings.HasSuffix(merged.Name, "-images") {
 	if merged.RunIfChanged == "" && merged.SkipIfOnlyChanged == "" {
 		if old.RunIfChanged != "" || old.SkipIfOnlyChanged != "" {
 			merged.RunIfChanged = old.RunIfChanged
 			merged.SkipIfOnlyChanged = old.SkipIfOnlyChanged
 			merged.AlwaysRun = false
 		}
 	}
+	if merged.Annotations["pipeline_run_if_changed"] == "" && merged.Annotations["pipeline_skip_if_only_changed"] == "" {
+		if old.Annotations["pipeline_run_if_changed"] != "" || old.Annotations["pipeline_skip_if_only_changed"] != "" {
+			if merged.Annotations == nil {
+				merged.Annotations = map[string]string{}
+			}
+			merged.Annotations["pipeline_run_if_changed"] = old.Annotations["pipeline_run_if_changed"]
+			merged.Annotations["pipeline_skip_if_only_changed"] = old.Annotations["pipeline_skip_if_only_changed"]
+			merged.AlwaysRun = false
+		}
+	}
 }

Please add a merge test for this migration path as well.

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

In `@pkg/jobconfig/files.go` around lines 491 - 500, The compatibility block for
"-images" jobs only copies RunIfChanged/SkipIfOnlyChanged and AlwaysRun; update
it to also preserve any manual pipeline annotations (pipeline_run_if_changed and
pipeline_skip_if_only_changed) from old to merged when merged.RunIfChanged and
merged.SkipIfOnlyChanged are empty — i.e., if old has those annotation keys,
copy them into merged's Annotations map (creating it if nil) alongside copying
RunIfChanged/SkipIfOnlyChanged and setting AlwaysRun=false; also add a
merge/unit test exercising the migration path where ImagesPipeline* are empty in
the new config but the old job contains pipeline_run_if_changed /
pipeline_skip_if_only_changed to assert the merged job preserves those
annotations.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
pkg/tool-detector/detector.go (1)

375-383: ⚠️ Potential issue | 🟠 Major

Don't ignore repo-root images in build_if_affected.

The early empty-ContextDir skip means images built from the repo root never become affected when only Dockerfile / dockerfile_path changes. With build_if_affected enabled, that can incorrectly skip a required image build after its Dockerfile changes.

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

In `@pkg/tool-detector/detector.go` around lines 375 - 383, The loop currently
skips images with an empty image.ContextDir which ignores repo-root images for
build_if_affected; remove the early continue and treat an empty ContextDir as
the repo root by initializing contextDir := image.ContextDir and only append a
trailing slash when contextDir != "" (i.e. if contextDir != "" &&
!strings.HasSuffix(contextDir, "/") { contextDir += "/" }); keep the rest of the
affected-path logic unchanged so Dockerfile/dockerfile_path changes in the repo
root correctly mark those images as affected.
pkg/prowgen/jobbase.go (1)

45-50: ⚠️ Potential issue | 🟡 Minor

Broaden the no-builds predicate to cover multi-ref build inputs.

This still ignores BuildRootImages and the *_list build-command variants, so openshift/release@main configs that build via multi-ref inputs can still be mislabeled as ci-operator.openshift.io/no-builds.

Suggested fix
-	if len(c.Images.Items) == 0 && c.BuildRootImage == nil && c.RpmBuildCommands == "" && c.TestBinaryBuildCommands == "" && c.BinaryBuildCommands == "" {
+	hasBuildRoot := c.BuildRootImage != nil || len(c.BuildRootImages) > 0
+	hasBinaryBuild := c.BinaryBuildCommands != "" || len(c.BinaryBuildCommandsList) > 0
+	hasTestBinaryBuild := c.TestBinaryBuildCommands != "" || len(c.TestBinaryBuildCommandsList) > 0
+	hasRPMBuild := c.RpmBuildCommands != "" || len(c.RpmBuildCommandsList) > 0
+	if len(c.Images.Items) == 0 && !hasBuildRoot && !hasRPMBuild && !hasTestBinaryBuild && !hasBinaryBuild {
 		return true
 	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/prowgen/jobbase.go` around lines 45 - 50, The predicate that marks
configs as "no-builds" only checks c.Images.Items, c.BuildRootImage and the
singular command fields; update it to also consider multi-ref and plural fields
so multi-ref build inputs aren't missed. Modify the conditional around
c.Images.Items, c.BuildRootImage and the command checks to additionally test
that len(c.BuildRootImages) == 0 and that the list variants (e.g.
c.RpmBuildCommandsList, c.TestBinaryBuildCommandsList,
c.BinaryBuildCommandsList) are either nil or empty; keep the existing string
checks (c.RpmBuildCommands, c.TestBinaryBuildCommands, c.BinaryBuildCommands)
and return true only when all images, build-root(s) and both singular and list
command fields are empty/absent. Ensure you reference and update the same
predicate in pkg/prowgen/jobbase.go where those symbols are used.
pkg/api/types.go (1)

107-112: ⚠️ Potential issue | 🟠 Major

The advertised images_* inputs won't bind to this schema.

This refactor only adds run_if_changed / skip_if_only_changed / ... under images, and turns the legacy images: [...] list into images: {items: [...]}. A config that follows the PR objective and sets top-level images_run_if_changed, images_skip_if_only_changed, etc. will still leave these values unset, so this is a broader user-facing schema migration rather than the additive field change the feature describes.

Also applies to: 2791-2817

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

In `@pkg/api/types.go` around lines 107 - 112, The schema change broke binding for
legacy and top-level image inputs: update the ImageConfiguration handling so it
accepts both the old images: [...] array and the new images: {items: [...] }
object, and also accept the advertised top-level images_* fields by adding
top-level struct fields and copying them into Images if present. Concretely,
modify the type ImageConfiguration (and the root config type that contains the
Images ImageConfiguration field) to implement UnmarshalJSON to detect and parse
either an array of image items or an object with items, and add top-level fields
(e.g. ImagesRunIfChanged, ImagesSkipIfOnlyChanged, ImagesSkipIfOnlyChanged,
etc.) with json tags matching the advertised inputs and populate
Images.RunIfChanged / Images.SkipIfOnlyChanged from those top-level fields
during unmarshalling or validation so both legacy and new configs bind
correctly.
pkg/registry/server/server.go (1)

368-380: ⚠️ Potential issue | 🟠 Major

Preserve ImageConfiguration metadata during merge, not only Items.

Line 380 appends image items, but image-level fields (BuildIfAffected, run/skip regexes) are never merged, so merged configs can silently lose those settings.

💡 Suggested fix
+			// Preserve image-level behavior flags from merged configs.
+			// BuildIfAffected should be true if any merged config enables it.
+			mergedConfig.Images.BuildIfAffected = mergedConfig.Images.BuildIfAffected || config.Images.BuildIfAffected
+			if mergedConfig.Images.RunIfChanged == "" {
+				mergedConfig.Images.RunIfChanged = config.Images.RunIfChanged
+			}
+			if mergedConfig.Images.SkipIfOnlyChanged == "" {
+				mergedConfig.Images.SkipIfOnlyChanged = config.Images.SkipIfOnlyChanged
+			}
+			if mergedConfig.Images.PipelineRunIfChanged == "" {
+				mergedConfig.Images.PipelineRunIfChanged = config.Images.PipelineRunIfChanged
+			}
+			if mergedConfig.Images.PipelineSkipIfOnlyChanged == "" {
+				mergedConfig.Images.PipelineSkipIfOnlyChanged = config.Images.PipelineSkipIfOnlyChanged
+			}
+
 			for i := range config.Images.Items {
 				image := config.Images.Items[i]
 				if image.From != "" {
 					image.From = api.PipelineImageStreamTagReference(fmt.Sprintf("%s-%s", image.From, ref))
 				}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/registry/server/server.go` around lines 368 - 380, The merge loop only
appends image items but loses image-level metadata (e.g., BuildIfAffected,
Run/Skip regexes) from each ImageConfiguration; update the loop that iterates
over config.Images.Items (and assigns to image := config.Images.Items[i]) to
copy/merge the parent ImageConfiguration fields into the per-item image before
appending to mergedConfig.Images.Items: explicitly transfer fields like
BuildIfAffected, RunIfAffected/SkipIfAffected regexes, any image-level
annotations or strategy settings, and preserve the original
image.Name/From/To/Inputs modifications already present in the block so
mergedConfig.Images.Items contains both the item and its metadata.
🧹 Nitpick comments (1)
pkg/prowgen/prowgen_test.go (1)

814-858: Add a pipeline_run_if_changed propagation test case as well.

PipelineRunIfChanged is part of the new ImageConfiguration trigger surface, but this table currently validates only the skip variant for pipeline mode.

➕ Suggested test addition
+		{
+			id: "images job with pipeline_run_if_changed propagated to presubmit only",
+			config: &ciop.ReleaseBuildConfiguration{
+				Images: ciop.ImageConfiguration{
+					Items:                []ciop.ProjectDirectoryImageBuildStepConfiguration{{}},
+					PipelineRunIfChanged: `^(Dockerfile|src/)`,
+				},
+				PromotionConfiguration: &ciop.PromotionConfiguration{},
+			},
+			repoInfo: &ProwgenInfo{Metadata: ciop.Metadata{
+				Org:    "organization",
+				Repo:   "repository",
+				Branch: "branch",
+			}},
+		},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/prowgen/prowgen_test.go` around lines 814 - 858, The test table in
prowgen_test.go is missing a case for PipelineRunIfChanged; add a new test case
entry mirroring the "images job with pipeline_skip_if_only_changed propagated to
presubmit only" case but set ImageConfiguration.PipelineRunIfChanged to a regexp
(e.g. `^(Dockerfile|src/)`) and keep PromotionConfiguration present and
ProwgenInfo metadata the same; ensure the new case id is descriptive (e.g.
"images job with pipeline_run_if_changed propagated to presubmit only") so the
test validates that PipelineRunIfChanged is propagated to presubmits.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@cmd/repo-init/api.go`:
- Around line 470-471: The ContainerImages branch currently calls
validation.ValidateImages(context.AddField("images"), generated.Images.Items)
but discards its returned error slice and only validates generated.Images.Items;
change this to capture the returned []error (or validation result) from
validation.ValidateImages and propagate or aggregate those errors into the
endpoint response (e.g., append to the main validation error list or return a
4xx), and additionally iterate over generated.Images.Items to validate the new
per-image run/skip regex fields (or call a helper like
validation.ValidateImageRegex(image) for each item) so regex-specific validation
errors are included; update the ContainerImages case to collect and handle both
the ValidateImages result and the per-image run/skip regex validation results.

---

Outside diff comments:
In `@pkg/api/types.go`:
- Around line 107-112: The schema change broke binding for legacy and top-level
image inputs: update the ImageConfiguration handling so it accepts both the old
images: [...] array and the new images: {items: [...] } object, and also accept
the advertised top-level images_* fields by adding top-level struct fields and
copying them into Images if present. Concretely, modify the type
ImageConfiguration (and the root config type that contains the Images
ImageConfiguration field) to implement UnmarshalJSON to detect and parse either
an array of image items or an object with items, and add top-level fields (e.g.
ImagesRunIfChanged, ImagesSkipIfOnlyChanged, ImagesSkipIfOnlyChanged, etc.) with
json tags matching the advertised inputs and populate Images.RunIfChanged /
Images.SkipIfOnlyChanged from those top-level fields during unmarshalling or
validation so both legacy and new configs bind correctly.

In `@pkg/prowgen/jobbase.go`:
- Around line 45-50: The predicate that marks configs as "no-builds" only checks
c.Images.Items, c.BuildRootImage and the singular command fields; update it to
also consider multi-ref and plural fields so multi-ref build inputs aren't
missed. Modify the conditional around c.Images.Items, c.BuildRootImage and the
command checks to additionally test that len(c.BuildRootImages) == 0 and that
the list variants (e.g. c.RpmBuildCommandsList, c.TestBinaryBuildCommandsList,
c.BinaryBuildCommandsList) are either nil or empty; keep the existing string
checks (c.RpmBuildCommands, c.TestBinaryBuildCommands, c.BinaryBuildCommands)
and return true only when all images, build-root(s) and both singular and list
command fields are empty/absent. Ensure you reference and update the same
predicate in pkg/prowgen/jobbase.go where those symbols are used.

In `@pkg/registry/server/server.go`:
- Around line 368-380: The merge loop only appends image items but loses
image-level metadata (e.g., BuildIfAffected, Run/Skip regexes) from each
ImageConfiguration; update the loop that iterates over config.Images.Items (and
assigns to image := config.Images.Items[i]) to copy/merge the parent
ImageConfiguration fields into the per-item image before appending to
mergedConfig.Images.Items: explicitly transfer fields like BuildIfAffected,
RunIfAffected/SkipIfAffected regexes, any image-level annotations or strategy
settings, and preserve the original image.Name/From/To/Inputs modifications
already present in the block so mergedConfig.Images.Items contains both the item
and its metadata.

In `@pkg/tool-detector/detector.go`:
- Around line 375-383: The loop currently skips images with an empty
image.ContextDir which ignores repo-root images for build_if_affected; remove
the early continue and treat an empty ContextDir as the repo root by
initializing contextDir := image.ContextDir and only append a trailing slash
when contextDir != "" (i.e. if contextDir != "" &&
!strings.HasSuffix(contextDir, "/") { contextDir += "/" }); keep the rest of the
affected-path logic unchanged so Dockerfile/dockerfile_path changes in the repo
root correctly mark those images as affected.

---

Nitpick comments:
In `@pkg/prowgen/prowgen_test.go`:
- Around line 814-858: The test table in prowgen_test.go is missing a case for
PipelineRunIfChanged; add a new test case entry mirroring the "images job with
pipeline_skip_if_only_changed propagated to presubmit only" case but set
ImageConfiguration.PipelineRunIfChanged to a regexp (e.g. `^(Dockerfile|src/)`)
and keep PromotionConfiguration present and ProwgenInfo metadata the same;
ensure the new case id is descriptive (e.g. "images job with
pipeline_run_if_changed propagated to presubmit only") so the test validates
that PipelineRunIfChanged is propagated to presubmits.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6d56bdb0-853b-404c-b2fc-550ffa5ba6b3

📥 Commits

Reviewing files that changed from the base of the PR and between 8be9907 and 7b6bf00.

⛔ Files ignored due to path filters (2)
  • pkg/api/zz_generated.deepcopy.go is excluded by !**/zz_generated*
  • pkg/webreg/zz_generated.ci_operator_reference.go is excluded by !**/zz_generated*
📒 Files selected for processing (33)
  • cmd/ci-operator/main.go
  • cmd/ci-operator/main_test.go
  • cmd/registry-replacer/main.go
  • cmd/registry-replacer/main_test.go
  • cmd/repo-init/api.go
  • cmd/repo-init/main.go
  • pkg/api/config_test.go
  • pkg/api/promotion.go
  • pkg/api/types.go
  • pkg/api/types_test.go
  • pkg/defaults/defaults.go
  • pkg/defaults/defaults_test.go
  • pkg/image-graph-generator/operator.go
  • pkg/jobconfig/files.go
  • pkg/jobconfig/files_test.go
  • pkg/promotion/promotion.go
  • pkg/promotion/promotion_test.go
  • pkg/prowgen/jobbase.go
  • pkg/prowgen/jobbase_test.go
  • pkg/prowgen/prowgen.go
  • pkg/prowgen/prowgen_test.go
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_pipeline_skip_if_only_changed_propagated_to_presubmit_only.yaml
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_run_if_changed_propagated_to_presubmit_and_postsubmit.yaml
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_skip_if_only_changed_propagated_to_presubmit_and_postsubmit.yaml
  • pkg/registry/server/server.go
  • pkg/steps/multi_stage/multi_stage_test.go
  • pkg/steps/release/promote.go
  • pkg/steps/release/promote_test.go
  • pkg/tool-detector/detector.go
  • pkg/tool-detector/detector_test.go
  • pkg/validation/config.go
  • pkg/validation/config_test.go
  • pkg/validation/graph_test.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • pkg/jobconfig/files.go
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_pipeline_skip_if_only_changed_propagated_to_presubmit_only.yaml
  • pkg/jobconfig/files_test.go

Comment on lines 470 to +471
case ContainerImages:
validation.ValidateImages(context.AddField("images"), generated.Images)
validation.ValidateImages(context.AddField("images"), generated.Images.Items)
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

CONTAINER_IMAGES validation currently discards every error.

ValidateImages returns a slice, but the result is dropped here, so this endpoint reports success even for invalid image definitions. This path also only validates generated.Images.Items, so the new image-level run/skip regex fields need explicit validation as well.

Suggested fix
-			validation.ValidateImages(context.AddField("images"), generated.Images.Items)
+			validationErrors = append(validationErrors, validation.ValidateImages(context.AddField("images"), generated.Images.Items)...)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/repo-init/api.go` around lines 470 - 471, The ContainerImages branch
currently calls validation.ValidateImages(context.AddField("images"),
generated.Images.Items) but discards its returned error slice and only validates
generated.Images.Items; change this to capture the returned []error (or
validation result) from validation.ValidateImages and propagate or aggregate
those errors into the endpoint response (e.g., append to the main validation
error list or return a 4xx), and additionally iterate over
generated.Images.Items to validate the new per-image run/skip regex fields (or
call a helper like validation.ValidateImageRegex(image) for each item) so
regex-specific validation errors are included; update the ContainerImages case
to collect and handle both the ValidateImages result and the per-image run/skip
regex validation results.

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.

🧹 Nitpick comments (2)
pkg/prowgen/prowgen_test.go (1)

814-859: Add the missing Images.PipelineRunIfChanged case here.

This block now covers RunIfChanged, SkipIfOnlyChanged, and PipelineSkipIfOnlyChanged, but not the other presubmit-only image matcher. The lower-level option tests won't catch a wiring regression inside GenerateJobs.

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

In `@pkg/prowgen/prowgen_test.go` around lines 814 - 859, Add a test case covering
Images.PipelineRunIfChanged so GenerateJobs' wiring for the presubmit-only image
matcher is exercised: create a new table entry (similar to the existing
PipelineSkipIfOnlyChanged case) that sets config:
&ciop.ReleaseBuildConfiguration{Images: ciop.ImageConfiguration{Items:
[]ciop.ProjectDirectoryImageBuildStepConfiguration{{}}, PipelineRunIfChanged:
`^(Dockerfile|src/)`}, PromotionConfiguration: &ciop.PromotionConfiguration{}},
and the same repoInfo metadata and id indicating it should be "propagated to
presubmit only"; this mirrors the RunIfChanged/SkipIfOnlyChanged entries and
ensures GenerateJobs handles Images.PipelineRunIfChanged correctly.
cmd/registry-replacer/main.go (1)

601-627: Add one prune-path regression test for wrapper-level image fields.

This update correctly rewrites only Images.Items, but the current tests only populate Items. A future refactor that overwrites the whole ImageConfiguration and drops RunIfChanged/SkipIfOnlyChanged/BuildIfAffected would still pass.

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

In `@cmd/registry-replacer/main.go` around lines 601 - 627, Add a regression test
that ensures pruning only rewrites config.Images.Items and does not drop
wrapper-level image fields (RunIfChanged, SkipIfOnlyChanged, BuildIfAffected) —
create an Images.Items entry with those wrapper fields set plus Inputs/As that
should be pruned, run the same prune-path logic that produces prunedImages (the
code around config.Images.Items, image.Inputs and prunedImages), and assert
after pruning that the Items slice is updated but each surviving
ImageConfiguration still retains its
RunIfChanged/SkipIfOnlyChanged/BuildIfAffected values; this will guard against
future refactors that replace entire ImageConfiguration objects instead of only
updating Items.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@cmd/registry-replacer/main.go`:
- Around line 601-627: Add a regression test that ensures pruning only rewrites
config.Images.Items and does not drop wrapper-level image fields (RunIfChanged,
SkipIfOnlyChanged, BuildIfAffected) — create an Images.Items entry with those
wrapper fields set plus Inputs/As that should be pruned, run the same prune-path
logic that produces prunedImages (the code around config.Images.Items,
image.Inputs and prunedImages), and assert after pruning that the Items slice is
updated but each surviving ImageConfiguration still retains its
RunIfChanged/SkipIfOnlyChanged/BuildIfAffected values; this will guard against
future refactors that replace entire ImageConfiguration objects instead of only
updating Items.

In `@pkg/prowgen/prowgen_test.go`:
- Around line 814-859: Add a test case covering Images.PipelineRunIfChanged so
GenerateJobs' wiring for the presubmit-only image matcher is exercised: create a
new table entry (similar to the existing PipelineSkipIfOnlyChanged case) that
sets config: &ciop.ReleaseBuildConfiguration{Images:
ciop.ImageConfiguration{Items:
[]ciop.ProjectDirectoryImageBuildStepConfiguration{{}}, PipelineRunIfChanged:
`^(Dockerfile|src/)`}, PromotionConfiguration: &ciop.PromotionConfiguration{}},
and the same repoInfo metadata and id indicating it should be "propagated to
presubmit only"; this mirrors the RunIfChanged/SkipIfOnlyChanged entries and
ensures GenerateJobs handles Images.PipelineRunIfChanged correctly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c323a992-a4fe-4dc9-9c7e-5b7435a0629f

📥 Commits

Reviewing files that changed from the base of the PR and between 7b6bf00 and cbf7c75.

⛔ Files ignored due to path filters (2)
  • pkg/api/zz_generated.deepcopy.go is excluded by !**/zz_generated*
  • pkg/webreg/zz_generated.ci_operator_reference.go is excluded by !**/zz_generated*
📒 Files selected for processing (34)
  • cmd/ci-operator/main.go
  • cmd/ci-operator/main_test.go
  • cmd/registry-replacer/main.go
  • cmd/registry-replacer/main_test.go
  • cmd/repo-init/api.go
  • cmd/repo-init/main.go
  • pkg/api/config_test.go
  • pkg/api/promotion.go
  • pkg/api/types.go
  • pkg/api/types_test.go
  • pkg/defaults/defaults.go
  • pkg/defaults/defaults_test.go
  • pkg/image-graph-generator/operator.go
  • pkg/jobconfig/files.go
  • pkg/jobconfig/files_test.go
  • pkg/promotion/promotion.go
  • pkg/promotion/promotion_test.go
  • pkg/prowgen/jobbase.go
  • pkg/prowgen/jobbase_test.go
  • pkg/prowgen/prowgen.go
  • pkg/prowgen/prowgen_test.go
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_pipeline_skip_if_only_changed_propagated_to_presubmit_only.yaml
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_run_if_changed_propagated_to_presubmit_and_postsubmit.yaml
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_skip_if_only_changed_propagated_to_presubmit_and_postsubmit.yaml
  • pkg/registry/server/server.go
  • pkg/steps/multi_stage/multi_stage_test.go
  • pkg/steps/release/promote.go
  • pkg/steps/release/promote_test.go
  • pkg/tool-detector/detector.go
  • pkg/tool-detector/detector_test.go
  • pkg/validation/config.go
  • pkg/validation/config_test.go
  • pkg/validation/graph_test.go
  • pkg/validation/test.go
🚧 Files skipped from review as they are similar to previous changes (9)
  • pkg/promotion/promotion.go
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_pipeline_skip_if_only_changed_propagated_to_presubmit_only.yaml
  • pkg/registry/server/server.go
  • cmd/repo-init/api.go
  • pkg/promotion/promotion_test.go
  • pkg/jobconfig/files_test.go
  • pkg/api/promotion.go
  • cmd/repo-init/main.go
  • pkg/validation/config.go

@Prucek
Copy link
Member Author

Prucek commented Mar 13, 2026

/retest

1 similar comment
@Prucek
Copy link
Member Author

Prucek commented Mar 13, 2026

/retest

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

♻️ Duplicate comments (1)
pkg/jobconfig/files.go (1)

491-500: ⚠️ Potential issue | 🟠 Major

Preserve manual pipeline_*_if_changed annotations during -images job migration.

pkg/api/types.go:2792-2816 adds PipelineRunIfChanged / PipelineSkipIfOnlyChanged, but Line 496 only backfills RunIfChanged / SkipIfOnlyChanged. Existing -images presubmits that still carry manual pipeline annotations will lose their second-stage filters on merge until those fields are migrated into ci-operator config.

Suggested fix
 if strings.HasSuffix(merged.Name, "-images") {
 	if merged.RunIfChanged == "" && merged.SkipIfOnlyChanged == "" {
 		if old.RunIfChanged != "" || old.SkipIfOnlyChanged != "" {
 			merged.RunIfChanged = old.RunIfChanged
 			merged.SkipIfOnlyChanged = old.SkipIfOnlyChanged
 			merged.AlwaysRun = false
 		}
 	}
+	if merged.Annotations["pipeline_run_if_changed"] == "" && merged.Annotations["pipeline_skip_if_only_changed"] == "" {
+		if old.Annotations["pipeline_run_if_changed"] != "" || old.Annotations["pipeline_skip_if_only_changed"] != "" {
+			if merged.Annotations == nil {
+				merged.Annotations = map[string]string{}
+			}
+			merged.Annotations["pipeline_run_if_changed"] = old.Annotations["pipeline_run_if_changed"]
+			merged.Annotations["pipeline_skip_if_only_changed"] = old.Annotations["pipeline_skip_if_only_changed"]
+			merged.AlwaysRun = false
+		}
+	}
 }

Please add a merge test for this migration path as well.

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

In `@pkg/jobconfig/files.go` around lines 491 - 500, The migration for "-images"
jobs only backfills RunIfChanged/SkipIfOnlyChanged (seen in the merged object
handling where merged.Name is checked) but ignores the newer
PipelineRunIfChanged/PipelineSkipIfOnlyChanged fields, so manual
pipeline_*_if_changed annotations are dropped; update the logic that runs when
strings.HasSuffix(merged.Name, "-images") to also copy old.PipelineRunIfChanged
and old.PipelineSkipIfOnlyChanged into merged.PipelineRunIfChanged and
merged.PipelineSkipIfOnlyChanged (in addition to RunIfChanged/SkipIfOnlyChanged
and AlwaysRun=false) when the merged pipeline fields are empty and the old ones
are non-empty, and add a unit test exercising this migration path to ensure both
RunIfChanged/SkipIfOnlyChanged and
PipelineRunIfChanged/PipelineSkipIfOnlyChanged are preserved from old to merged.
🧹 Nitpick comments (2)
pkg/jobconfig/files_test.go (1)

431-465: Mirror these matcher-merge cases in TestMergePostsubmits.

pkg/prowgen/prowgen.go Lines 154-157 now apply the same RegexpChangeMatcher fields to image postsubmits. Adding preserve/override cases there too would protect the regenerate/merge path on both job types, not just presubmits.

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

In `@pkg/jobconfig/files_test.go` around lines 431 - 465, Add the same two
RegexpChangeMatcher merge test cases currently in TestMergePresubmits into
TestMergePostsubmits: (1) preserve an old manual SkipIfOnlyChanged when the new
postsubmit has no filter, and (2) prefer the prowgen-generated SkipIfOnlyChanged
over an old manual value. Ensure the new tests use the same struct shapes and
expected prowconfig.Presubmit/Presubmit-like objects (matching the existing
cases referencing RegexpChangeMatcher and SkipIfOnlyChanged) so the postsubmit
merge behavior mirrors the presubmit behavior implemented in prowgen.go where
RegexpChangeMatcher fields are applied to image postsubmits.
cmd/repo-init/main.go (1)

680-680: Carry the full image wrapper through repo-init.

This only forwards Items, so repo-init --config still can't represent the new image-level fields (run_if_changed, skip_if_only_changed, pipeline_*, build_if_affected). Using api.ImageConfiguration end-to-end here would keep the initializer aligned with the public config shape while still accepting the legacy array form.

Possible cleanup
 type initConfig struct {
 	Org                   string                                            `json:"org"`
 	Repo                  string                                            `json:"repo"`
 	Branch                string                                            `json:"branch"`
 	BaseImages            map[string]api.ImageStreamTagReference            `json:"base_images"`
-	Images                []api.ProjectDirectoryImageBuildStepConfiguration `json:"images"`
+	Images                api.ImageConfiguration                            `json:"images"`
 	CanonicalGoRepository string                                            `json:"canonical_go_repository"`
 	Promotes              bool                                              `json:"promotes"`
 	PromotesWithOpenShift bool                                              `json:"promotes_with_openshift"`
 	NeedsBase             bool                                              `json:"needs_base"`
 	NeedsOS               bool                                              `json:"needs_os"`
@@
-	generated.Configuration.Images.Items = config.Images
+	generated.Configuration.Images = config.Images
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/repo-init/main.go` at line 680, The initializer currently assigns only
config.Images into generated.Configuration.Images.Items, losing image-level
metadata; update the flow to carry the full api.ImageConfiguration wrapper
end-to-end instead of just the Items slice: change the initializer to
accept/produce api.ImageConfiguration (use api.ImageConfiguration for the config
parsing and for generated.Configuration.Images), map legacy plain-slice input
into the wrapper when needed (so --config still accepts old array form), and
ensure any code paths referencing generated.Configuration.Images.Items are
updated to use the wrapper fields (e.g., run_if_changed, skip_if_only_changed,
pipeline_*, build_if_affected) so those image-level fields are preserved through
repo-init.
🤖 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/webreg/zz_generated.ci_operator_reference.go`:
- Around line 248-250: The generated doc incorrectly states skip_if_only_changed
applies to postsubmits; update the generator/template that produces
pkg/webreg/zz_generated.ci_operator_reference.go so the comment for
"skip_if_only_changed" explicitly documents it as presubmit-only (matching the
Go type StopIfOnlyChanged/SkipIfOnlyChanged defined in pkg/api/types.go and the
field documented in lines ~2792-2816), or adjust the generator logic to detect
that SkipIfOnlyChanged is defined only for auto-generated-image presubmits and
emit text stating "presubmit-only" instead of implying postsubmit support;
ensure the unique symbol names SkipIfOnlyChanged (pkg/api/types.go) and the
generated comment block in zz_generated.ci_operator_reference.go are aligned.

---

Duplicate comments:
In `@pkg/jobconfig/files.go`:
- Around line 491-500: The migration for "-images" jobs only backfills
RunIfChanged/SkipIfOnlyChanged (seen in the merged object handling where
merged.Name is checked) but ignores the newer
PipelineRunIfChanged/PipelineSkipIfOnlyChanged fields, so manual
pipeline_*_if_changed annotations are dropped; update the logic that runs when
strings.HasSuffix(merged.Name, "-images") to also copy old.PipelineRunIfChanged
and old.PipelineSkipIfOnlyChanged into merged.PipelineRunIfChanged and
merged.PipelineSkipIfOnlyChanged (in addition to RunIfChanged/SkipIfOnlyChanged
and AlwaysRun=false) when the merged pipeline fields are empty and the old ones
are non-empty, and add a unit test exercising this migration path to ensure both
RunIfChanged/SkipIfOnlyChanged and
PipelineRunIfChanged/PipelineSkipIfOnlyChanged are preserved from old to merged.

---

Nitpick comments:
In `@cmd/repo-init/main.go`:
- Line 680: The initializer currently assigns only config.Images into
generated.Configuration.Images.Items, losing image-level metadata; update the
flow to carry the full api.ImageConfiguration wrapper end-to-end instead of just
the Items slice: change the initializer to accept/produce api.ImageConfiguration
(use api.ImageConfiguration for the config parsing and for
generated.Configuration.Images), map legacy plain-slice input into the wrapper
when needed (so --config still accepts old array form), and ensure any code
paths referencing generated.Configuration.Images.Items are updated to use the
wrapper fields (e.g., run_if_changed, skip_if_only_changed, pipeline_*,
build_if_affected) so those image-level fields are preserved through repo-init.

In `@pkg/jobconfig/files_test.go`:
- Around line 431-465: Add the same two RegexpChangeMatcher merge test cases
currently in TestMergePresubmits into TestMergePostsubmits: (1) preserve an old
manual SkipIfOnlyChanged when the new postsubmit has no filter, and (2) prefer
the prowgen-generated SkipIfOnlyChanged over an old manual value. Ensure the new
tests use the same struct shapes and expected
prowconfig.Presubmit/Presubmit-like objects (matching the existing cases
referencing RegexpChangeMatcher and SkipIfOnlyChanged) so the postsubmit merge
behavior mirrors the presubmit behavior implemented in prowgen.go where
RegexpChangeMatcher fields are applied to image postsubmits.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a8aad83c-8dd1-4b65-8955-a6deb37a141a

📥 Commits

Reviewing files that changed from the base of the PR and between cbf7c75 and caceae4.

📒 Files selected for processing (39)
  • cmd/ci-operator/main.go
  • cmd/ci-operator/main_test.go
  • cmd/registry-replacer/main.go
  • cmd/registry-replacer/main_test.go
  • cmd/repo-init/api.go
  • cmd/repo-init/main.go
  • pkg/api/config_test.go
  • pkg/api/promotion.go
  • pkg/api/types.go
  • pkg/api/types_test.go
  • pkg/api/zz_generated.deepcopy.go
  • pkg/defaults/defaults.go
  • pkg/defaults/defaults_test.go
  • pkg/image-graph-generator/operator.go
  • pkg/jobconfig/files.go
  • pkg/jobconfig/files_test.go
  • pkg/promotion/promotion.go
  • pkg/promotion/promotion_test.go
  • pkg/prowgen/jobbase.go
  • pkg/prowgen/jobbase_test.go
  • pkg/prowgen/prowgen.go
  • pkg/prowgen/prowgen_test.go
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_pipeline_skip_if_only_changed_propagated_to_presubmit_only.yaml
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_run_if_changed_propagated_to_presubmit_and_postsubmit.yaml
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_skip_if_only_changed_propagated_to_presubmit_and_postsubmit.yaml
  • pkg/registry/server/server.go
  • pkg/steps/multi_stage/multi_stage_test.go
  • pkg/steps/release/promote.go
  • pkg/steps/release/promote_test.go
  • pkg/tool-detector/detector.go
  • pkg/tool-detector/detector_test.go
  • pkg/validation/config.go
  • pkg/validation/config_test.go
  • pkg/validation/graph_test.go
  • pkg/validation/test.go
  • pkg/webreg/zz_generated.ci_operator_reference.go
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-master__images-changed.yaml
  • test/integration/ci-operator-prowgen/output/jobs/super/duper/super-duper-master-postsubmits.yaml
  • test/integration/ci-operator-prowgen/output/jobs/super/duper/super-duper-master-presubmits.yaml
🚧 Files skipped from review as they are similar to previous changes (13)
  • pkg/steps/release/promote.go
  • pkg/validation/graph_test.go
  • pkg/prowgen/jobbase.go
  • cmd/ci-operator/main.go
  • pkg/prowgen/prowgen_test.go
  • pkg/image-graph-generator/operator.go
  • pkg/defaults/defaults.go
  • pkg/tool-detector/detector.go
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_run_if_changed_propagated_to_presubmit_and_postsubmit.yaml
  • cmd/registry-replacer/main.go
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_skip_if_only_changed_propagated_to_presubmit_and_postsubmit.yaml
  • cmd/repo-init/api.go
  • pkg/validation/test.go

Comment on lines +248 to +250
" # SkipIfOnlyChanged is a regex that will cause the auto-generated images\n" +
" # presubmit and postsubmit to be skipped if all changed files match the regex.\n" +
" skip_if_only_changed: ' '\n" +
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Document skip_if_only_changed as presubmit-only.

Lines 248-250 say this applies to postsubmits, but pkg/api/types.go:2792-2816 defines SkipIfOnlyChanged only for auto-generated images presubmits. Please fix the source that generates this reference too, or the web docs will advertise unsupported postsubmit behavior.

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

In `@pkg/webreg/zz_generated.ci_operator_reference.go` around lines 248 - 250, The
generated doc incorrectly states skip_if_only_changed applies to postsubmits;
update the generator/template that produces
pkg/webreg/zz_generated.ci_operator_reference.go so the comment for
"skip_if_only_changed" explicitly documents it as presubmit-only (matching the
Go type StopIfOnlyChanged/SkipIfOnlyChanged defined in pkg/api/types.go and the
field documented in lines ~2792-2816), or adjust the generator logic to detect
that SkipIfOnlyChanged is defined only for auto-generated-image presubmits and
emit text stating "presubmit-only" instead of implying postsubmit support;
ensure the unique symbol names SkipIfOnlyChanged (pkg/api/types.go) and the
generated comment block in zz_generated.ci_operator_reference.go are aligned.

@Prucek
Copy link
Member Author

Prucek commented Mar 17, 2026

/test lint
/test unit

@Prucek
Copy link
Member Author

Prucek commented Mar 17, 2026

/test e2e

@openshift-ci-robot
Copy link
Contributor

Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage.

pkg/api/types.go Outdated

// MarshalJSON outputs a plain array when only Items is set (legacy format),
// otherwise outputs the full struct.
func (ic ImageConfiguration) MarshalJSON() ([]byte, error) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is a proper way to keep backward compatibility. You should update the configuration changes to the release after this pr is merged. And also update the documentation.

// BuildImagesIfAffected means images are only built if their corresponding cmd tools are affected by code changes.
// When enabled, the tool-detector package analyzes git changes to determine which images should be built.
// The image name (To field) should match the cmd tool name for this to work correctly.
BuildImagesIfAffected bool `json:"build_images_if_affected,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

This is a breaking change.

Copy link
Contributor

Choose a reason for hiding this comment

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

why this is removed @Prucek ?

merged.RunIfChanged = old.RunIfChanged
merged.SkipIfOnlyChanged = old.SkipIfOnlyChanged
merged.AlwaysRun = false
if merged.RunIfChanged == "" && merged.SkipIfOnlyChanged == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

will this section still be needed?

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

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

Inline comments:
In `@cmd/ci-operator/main.go`:
- Around line 1237-1238: Update the outdated comment that references the old
top-level key to reflect the new nested field structure: replace the obsolete
"build_images_if_affected" wording with something like "// build_if_affected is
enabled (under the images section)" immediately above the conditional that
checks config == nil || jobSpec == nil || !config.Images.BuildIfAffected so the
comment matches the actual field config.Images.BuildIfAffected used by the code.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5319765c-2848-4c42-9e9e-0191c94d4408

📥 Commits

Reviewing files that changed from the base of the PR and between caceae4 and 13e3231.

📒 Files selected for processing (134)
  • cmd/ci-operator/main.go
  • cmd/ci-operator/main_test.go
  • cmd/private-org-peribolos-sync/testdata/ci-operator/config/org1/repo1/org1-repo1-main.yaml
  • cmd/private-org-peribolos-sync/testdata/ci-operator/config/org1/repo2/org1-repo2-main.yaml
  • cmd/private-org-peribolos-sync/testdata/ci-operator/config/org2/repo3/org2-repo3-main.yaml
  • cmd/registry-replacer/main.go
  • cmd/registry-replacer/main_test.go
  • cmd/registry-replacer/testdata/zz_fixture_TestReplacer_Build_APIs_replacement_is_executed_first.yaml
  • cmd/registry-replacer/testdata/zz_fixture_TestReplacer_ContextDir_is_respected.yaml
  • cmd/registry-replacer/testdata/zz_fixture_TestReplacer_Context_dir_gets_fixed_up.yaml
  • cmd/registry-replacer/testdata/zz_fixture_TestReplacer_Default_to_dockerfile.yaml
  • cmd/registry-replacer/testdata/zz_fixture_TestReplacer_Dockerfile_gets_fixed_up.yaml
  • cmd/registry-replacer/testdata/zz_fixture_TestReplacer_Existing_base_image_is_not_overwritten.yaml
  • cmd/registry-replacer/testdata/zz_fixture_TestReplacer_Replaces_Copy_from.yaml
  • cmd/registry-replacer/testdata/zz_fixture_TestReplacer_Replaces_with_tag.yaml
  • cmd/registry-replacer/testdata/zz_fixture_TestReplacer_Replaces_without_tag.yaml
  • cmd/registry-replacer/testdata/zz_fixture_TestReplacer_Unused_base_images_are_pruned.yaml
  • cmd/registry-replacer/testdata/zz_fixture_TestReplacer_Use_dockerfile_literal_if_present.yaml
  • cmd/repo-init/api.go
  • cmd/repo-init/main.go
  • hack/lint.sh
  • pkg/api/config_test.go
  • pkg/api/promotion.go
  • pkg/api/types.go
  • pkg/api/types_test.go
  • pkg/api/zz_generated.deepcopy.go
  • pkg/config/testdata/cm/config/..2019_11_15_19_57_20.547184898/super-duper-master.yaml
  • pkg/config/testdata/cm/config/..2019_11_15_19_57_20.547184898/super-duper-release-4.9.yaml
  • pkg/config/testdata/tree/config/super/duper/super-duper-master.yaml
  • pkg/config/testdata/tree/config/super/duper/super-duper-release-4.9.yaml
  • pkg/defaults/defaults.go
  • pkg/defaults/defaults_test.go
  • pkg/image-graph-generator/operator.go
  • pkg/jobconfig/files.go
  • pkg/jobconfig/files_test.go
  • pkg/promotion/promotion.go
  • pkg/promotion/promotion_test.go
  • pkg/prowgen/jobbase.go
  • pkg/prowgen/jobbase_test.go
  • pkg/prowgen/prowgen.go
  • pkg/prowgen/prowgen_test.go
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_pipeline_skip_if_only_changed_propagated_to_presubmit_only.yaml
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_run_if_changed_propagated_to_presubmit_and_postsubmit.yaml
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_skip_if_only_changed_propagated_to_presubmit_and_postsubmit.yaml
  • pkg/registry/server/server.go
  • pkg/registry/server/testdata/zz_fixture_TestConfig_getting_config_works.yaml
  • pkg/registry/server/testdata/zz_fixture_TestConfigserved_config.yaml
  • pkg/steps/multi_stage/multi_stage_test.go
  • pkg/steps/release/promote.go
  • pkg/steps/release/promote_test.go
  • pkg/tool-detector/detector.go
  • pkg/tool-detector/detector_test.go
  • pkg/validation/config.go
  • pkg/validation/config_test.go
  • pkg/validation/graph_test.go
  • pkg/validation/test.go
  • pkg/validation/test_test.go
  • pkg/webreg/zz_generated.ci_operator_reference.go
  • test/e2e/multi-stage/configs/master/test-another-master.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/foo/bar/foo-bar-master.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/foo/barry-white/foo-barry-white-master.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/foo/barry-white/foo-barry-white-official.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/foo/barry-white/foo-barry-white-official__releases.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/super-priv/barry-white/super-priv-barry-white-master.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/super-priv/barry-white/super-priv-barry-white-official.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/super-priv/deprecated-repo/super-priv-deprecated-repo-master.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/super-priv/duper/super-priv-duper-master.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/super-priv/trooper/super-priv-trooper-deprecated.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/super-priv/trooper/super-priv-trooper-master.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/super/duper/super-duper-master.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/super/looper/super-looper-master.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/super/trooper/super-trooper-master.yaml
  • test/integration/ci-operator-config-mirror/input/foo/bar/foo-bar-master.yaml
  • test/integration/ci-operator-config-mirror/input/foo/barry-white/foo-barry-white-master.yaml
  • test/integration/ci-operator-config-mirror/input/foo/barry-white/foo-barry-white-official.yaml
  • test/integration/ci-operator-config-mirror/input/foo/barry-white/foo-barry-white-official__releases.yaml
  • test/integration/ci-operator-config-mirror/input/super/duper/super-duper-master.yaml
  • test/integration/ci-operator-config-mirror/input/super/looper/super-looper-master.yaml
  • test/integration/ci-operator-config-mirror/input/super/trooper/super-trooper-master.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/foo/bar/foo-bar-master.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/foo/barry-white/foo-barry-white-master.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/foo/barry-white/foo-barry-white-official.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/foo/barry-white/foo-barry-white-official__releases.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super-priv/barry-white/super-priv-barry-white-master.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super-priv/barry-white/super-priv-barry-white-official.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super-priv/barry-white/super-priv-barry-white-official__releases.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super-priv/duper/super-priv-duper-master.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super-priv/looper/super-priv-looper-master.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super-priv/trooper/super-priv-trooper-master.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super/duper/super-duper-master.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super/looper/super-looper-master.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super/trooper/super-trooper-master.yaml
  • test/integration/ci-operator-config-mirror/output/foo/bar/foo-bar-master.yaml
  • test/integration/ci-operator-config-mirror/output/foo/barry-white/foo-barry-white-master.yaml
  • test/integration/ci-operator-config-mirror/output/foo/barry-white/foo-barry-white-official.yaml
  • test/integration/ci-operator-config-mirror/output/foo/barry-white/foo-barry-white-official__releases.yaml
  • test/integration/ci-operator-config-mirror/output/super-priv/barry-white/super-priv-barry-white-master.yaml
  • test/integration/ci-operator-config-mirror/output/super-priv/barry-white/super-priv-barry-white-official.yaml
  • test/integration/ci-operator-config-mirror/output/super-priv/barry-white/super-priv-barry-white-official__releases.yaml
  • test/integration/ci-operator-config-mirror/output/super-priv/duper/super-priv-duper-master.yaml
  • test/integration/ci-operator-config-mirror/output/super-priv/looper/super-priv-looper-master.yaml
  • test/integration/ci-operator-config-mirror/output/super-priv/trooper/super-priv-trooper-master.yaml
  • test/integration/ci-operator-config-mirror/output/super/duper/super-duper-master.yaml
  • test/integration/ci-operator-config-mirror/output/super/looper/super-looper-master.yaml
  • test/integration/ci-operator-config-mirror/output/super/trooper/super-trooper-master.yaml
  • test/integration/ci-operator-configresolver/configs/master/openshift-console-master.yaml
  • test/integration/ci-operator-configresolver/configs/release-4.2/openshift-installer-release-4.2.yaml
  • test/integration/ci-operator-configresolver/expected/openshift-installer-console-merged-release-4.2-injected.json
  • test/integration/ci-operator-configresolver/expected/openshift-installer-console-merged-release-4.2-installer-as-base.json
  • test/integration/ci-operator-configresolver/expected/openshift-installer-release-4.2-injected.json
  • test/integration/ci-operator-configresolver/expected/openshift-installer-release-4.2.json
  • test/integration/ci-operator-prowgen/input/config/private/duper/private-duper-master.yaml
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-master-removed-promotion.yaml
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-master.yaml
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-master__images-build-affected.yaml
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-master__images-changed.yaml
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-master__images-pipeline-changed.yaml
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-master__images-skip-docs.yaml
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-master__variant.yaml
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-release-3.11.yaml
  • test/integration/ci-operator-prowgen/output/jobs/super/duper/super-duper-master-postsubmits.yaml
  • test/integration/ci-operator-prowgen/output/jobs/super/duper/super-duper-master-presubmits.yaml
  • test/integration/pj-rehearse/candidate/ci-operator/config/super/duper/super-duper-ciop-cfg-change.yaml
  • test/integration/pj-rehearse/candidate/ci-operator/config/super/duper/super-duper-cluster-profile.yaml
  • test/integration/pj-rehearse/candidate/ci-operator/config/super/duper/super-duper-master.yaml
  • test/integration/pj-rehearse/candidate/ci-operator/config/super/trooper/super-trooper-master.yaml
  • test/integration/pj-rehearse/master/ci-operator/config/super/duper/super-duper-ciop-cfg-change.yaml
  • test/integration/pj-rehearse/master/ci-operator/config/super/duper/super-duper-cluster-profile.yaml
  • test/integration/pj-rehearse/master/ci-operator/config/super/duper/super-duper-master.yaml
  • test/integration/pj-rehearse/master/ci-operator/config/super/trooper/super-trooper-master.yaml
  • test/integration/repo-init/expected/ci-operator/config/openshift/ci-tools/openshift-ci-tools-master.yaml
  • test/integration/repo-init/expected/ci-operator/config/openshift/origin/openshift-origin-main.yaml
  • test/integration/repo-init/input/ci-operator/config/openshift/ci-tools/openshift-ci-tools-master.yaml
  • test/integration/repo-init/input/ci-operator/config/openshift/origin/openshift-origin-main.yaml
💤 Files with no reviewable changes (1)
  • pkg/jobconfig/files.go
✅ Files skipped from review due to trivial changes (65)
  • cmd/private-org-peribolos-sync/testdata/ci-operator/config/org1/repo1/org1-repo1-main.yaml
  • pkg/config/testdata/cm/config/..2019_11_15_19_57_20.547184898/super-duper-release-4.9.yaml
  • cmd/registry-replacer/testdata/zz_fixture_TestReplacer_ContextDir_is_respected.yaml
  • cmd/registry-replacer/testdata/zz_fixture_TestReplacer_Context_dir_gets_fixed_up.yaml
  • cmd/private-org-peribolos-sync/testdata/ci-operator/config/org1/repo2/org1-repo2-main.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/foo/barry-white/foo-barry-white-master.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super-priv/barry-white/super-priv-barry-white-official.yaml
  • pkg/config/testdata/tree/config/super/duper/super-duper-master.yaml
  • cmd/private-org-peribolos-sync/testdata/ci-operator/config/org2/repo3/org2-repo3-main.yaml
  • test/integration/pj-rehearse/master/ci-operator/config/super/duper/super-duper-master.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/super/looper/super-looper-master.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super-priv/looper/super-priv-looper-master.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/super-priv/trooper/super-priv-trooper-master.yaml
  • cmd/registry-replacer/testdata/zz_fixture_TestReplacer_Dockerfile_gets_fixed_up.yaml
  • test/integration/ci-operator-config-mirror/input/foo/barry-white/foo-barry-white-master.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/foo/barry-white/foo-barry-white-official.yaml
  • hack/lint.sh
  • test/integration/ci-operator-config-mirror/input/foo/barry-white/foo-barry-white-official__releases.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super-priv/duper/super-priv-duper-master.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/foo/barry-white/foo-barry-white-official__releases.yaml
  • test/integration/ci-operator-config-mirror/output/foo/barry-white/foo-barry-white-master.yaml
  • test/integration/ci-operator-config-mirror/output/super-priv/looper/super-priv-looper-master.yaml
  • test/integration/ci-operator-config-mirror/input/foo/bar/foo-bar-master.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super/duper/super-duper-master.yaml
  • pkg/image-graph-generator/operator.go
  • pkg/config/testdata/cm/config/..2019_11_15_19_57_20.547184898/super-duper-master.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/super/duper/super-duper-master.yaml
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-master-removed-promotion.yaml
  • test/integration/ci-operator-config-mirror/output/foo/barry-white/foo-barry-white-official.yaml
  • test/integration/ci-operator-configresolver/configs/release-4.2/openshift-installer-release-4.2.yaml
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-master.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/super-priv/duper/super-priv-duper-master.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/foo/barry-white/foo-barry-white-master.yaml
  • test/integration/ci-operator-config-mirror/output/foo/barry-white/foo-barry-white-official__releases.yaml
  • test/integration/ci-operator-configresolver/configs/master/openshift-console-master.yaml
  • test/integration/ci-operator-config-mirror/input/super/trooper/super-trooper-master.yaml
  • test/integration/ci-operator-config-mirror/output/super-priv/barry-white/super-priv-barry-white-master.yaml
  • test/integration/pj-rehearse/master/ci-operator/config/super/duper/super-duper-cluster-profile.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super/looper/super-looper-master.yaml
  • test/integration/pj-rehearse/candidate/ci-operator/config/super/duper/super-duper-cluster-profile.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/super-priv/barry-white/super-priv-barry-white-official.yaml
  • test/integration/pj-rehearse/candidate/ci-operator/config/super/duper/super-duper-master.yaml
  • test/integration/ci-operator-config-mirror/output/super-priv/barry-white/super-priv-barry-white-official.yaml
  • test/integration/pj-rehearse/candidate/ci-operator/config/super/trooper/super-trooper-master.yaml
  • test/integration/repo-init/expected/ci-operator/config/openshift/origin/openshift-origin-main.yaml
  • test/integration/ci-operator-config-mirror/output/super/trooper/super-trooper-master.yaml
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_skip_if_only_changed_propagated_to_presubmit_and_postsubmit.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/foo/bar/foo-bar-master.yaml
  • test/integration/ci-operator-config-mirror/input-to-clean/super-priv/trooper/super-priv-trooper-deprecated.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super-priv/trooper/super-priv-trooper-master.yaml
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_pipeline_skip_if_only_changed_propagated_to_presubmit_only.yaml
  • test/integration/ci-operator-config-mirror/output-only-super/super/trooper/super-trooper-master.yaml
  • cmd/ci-operator/main_test.go
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-master__images-pipeline-changed.yaml
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-master__images-skip-docs.yaml
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-master__images-changed.yaml
  • test/integration/repo-init/input/ci-operator/config/openshift/ci-tools/openshift-ci-tools-master.yaml
  • pkg/validation/config_test.go
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-master__images-build-affected.yaml
  • test/integration/pj-rehearse/candidate/ci-operator/config/super/duper/super-duper-ciop-cfg-change.yaml
  • test/integration/ci-operator-config-mirror/input/super/looper/super-looper-master.yaml
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_with_run_if_changed_propagated_to_presubmit_and_postsubmit.yaml
  • pkg/defaults/defaults.go
  • test/integration/pj-rehearse/master/ci-operator/config/super/trooper/super-trooper-master.yaml
  • cmd/registry-replacer/testdata/zz_fixture_TestReplacer_Replaces_Copy_from.yaml
🚧 Files skipped from review as they are similar to previous changes (16)
  • pkg/steps/release/promote.go
  • pkg/tool-detector/detector.go
  • pkg/api/promotion.go
  • pkg/promotion/promotion.go
  • cmd/repo-init/api.go
  • pkg/prowgen/jobbase_test.go
  • pkg/jobconfig/files_test.go
  • pkg/validation/graph_test.go
  • pkg/prowgen/jobbase.go
  • pkg/steps/release/promote_test.go
  • pkg/prowgen/prowgen_test.go
  • test/integration/ci-operator-prowgen/output/jobs/super/duper/super-duper-master-postsubmits.yaml
  • pkg/steps/multi_stage/multi_stage_test.go
  • pkg/validation/test.go
  • pkg/registry/server/server.go
  • cmd/registry-replacer/main.go

Comment on lines +1237 to 1238
if config == nil || jobSpec == nil || !config.Images.BuildIfAffected {
return 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 | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== remaining legacy field references ==="
rg -n -C1 'build_images_if_affected|BuildImagesIfAffected'

echo
echo "=== current nested field references ==="
rg -n -C1 'build_if_affected|BuildIfAffected'

Repository: openshift/ci-tools

Length of output: 3203


Update the comment at line 1235 to reflect the new nested field structure.

The migration to config.Images.BuildIfAffected is complete. The old top-level build_images_if_affected key is not used anywhere in the codebase, all test data and example configs have been updated to the new nested structure, and the runtime logic correctly accesses the field from its new location. However, the comment at line 1235 still references the obsolete field name. Update it to: // build_if_affected is enabled (under the images section) or similar to match the actual structure.

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

In `@cmd/ci-operator/main.go` around lines 1237 - 1238, Update the outdated
comment that references the old top-level key to reflect the new nested field
structure: replace the obsolete "build_images_if_affected" wording with
something like "// build_if_affected is enabled (under the images section)"
immediately above the conditional that checks config == nil || jobSpec == nil ||
!config.Images.BuildIfAffected so the comment matches the actual field
config.Images.BuildIfAffected used by the code.

@droslean
Copy link
Member

/lgtm
/approve
/hold

@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 Mar 19, 2026
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 19, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 19, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: droslean, 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
Copy link
Contributor

openshift-ci bot commented Mar 19, 2026

@Prucek: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/images 5cd6db4 link true /test images
ci/prow/checkconfig 5cd6db4 link true /test checkconfig

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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants