Skip to content

prowgen: remove .config.prowgen support#5167

Draft
Prucek wants to merge 1 commit intoopenshift:mainfrom
Prucek:remove-prowgen-config-v2
Draft

prowgen: remove .config.prowgen support#5167
Prucek wants to merge 1 commit intoopenshift:mainfrom
Prucek:remove-prowgen-config-v2

Conversation

@Prucek
Copy link
Copy Markdown
Member

@Prucek Prucek commented May 7, 2026

Summary

  • Remove .config.prowgen file support entirely from prowgen
  • All features previously configured via .config.prowgen are now available inline in ci-operator configuration YAML:
    • prowgen: {private, expose, disable_rehearsals, skip_operator_presubmits, enable_secrets_store_csi_driver}
    • Per-test reporter_config and disable_rehearsal fields
  • Remove config.Prowgen struct and all associated types/functions from pkg/config/load.go
  • Remove ProwgenInfo.Config field — ProwgenInfo now only contains Metadata
  • Remove .config.prowgen loading from ci-operator-prowgen and image-graph-generator
  • Remove .config.prowgen skip from check-gh-automation
  • Migrate integration test fixtures from .config.prowgen to inline ci-operator config equivalents

🤖 Generated with Claude Code

All features previously configured via .config.prowgen files are now
available inline in ci-operator configuration YAML via the `prowgen:`
field (private, expose, disable_rehearsals, skip_operator_presubmits,
enable_secrets_store_csi_driver) and per-test `reporter_config` /
`disable_rehearsal` fields.

This removes:
- config.Prowgen struct and all associated types/functions from
  pkg/config/load.go (Rehearsals, SlackReporterConfig,
  SkipOperatorPresubmits, LoadProwgenConfig, validateProwgenConfig,
  MergeDefaults, GetSlackReporterConfigForJobName, SkipPresubmits)
- ProwgenInfo.Config field — ProwgenInfo now only contains Metadata
- .config.prowgen loading from ci-operator-prowgen and
  image-graph-generator
- .config.prowgen skip from check-gh-automation

Integration test fixtures migrated from .config.prowgen to inline
ci-operator config equivalents.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

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

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

This repository is configured in: automatic mode

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

openshift-ci Bot commented May 7, 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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

📝 Walkthrough

Walkthrough

This PR migrates Prowgen configuration from centralized .config.prowgen YAML files to inline prowgen: blocks embedded in CI operator configuration files. It removes Prowgen-specific config loading, caching, and validation from the shared config package and refactors job generation to read configuration directly from the operator config instead. Integration test fixtures are updated to reflect the new config layout.

Changes

Migrate Prowgen Configuration to Inline CI Operator Config

Layer / File(s) Summary
Data Model Removal
pkg/config/load.go, pkg/config/load_test.go
Prowgen, SlackReporterConfig, SkipOperatorPresubmits, and Rehearsals types and their loaders/validators are removed; config package now handles only CI operator YAML loading.
Job Generation Refactoring
cmd/ci-operator-prowgen/main.go, cmd/ci-operator-prowgen/main_test.go
generateJobsToDir and generateJobs signatures remove the prowgen cache parameter; job generation no longer loads/merges per-org/repo prowgen configs from disk, relying instead on inline config from the operator YAML.
Slack Reporter Simplification
pkg/prowgen/prowgen.go, pkg/prowgen/prowgen_test.go
Slack reporter config helper refactored to use only per-test config instead of merging job/test names with info-level defaults; removes dependency on info.Config for reporter selection.
Rehearsal Disabling Simplification
pkg/prowgen/prowgen.go, pkg/prowgen/prowgen_test.go
Rehearsal disabling now computed from configSpec.Prowgen.DisableRehearsals and per-test DisableRehearsal flag; removes set-based lookups from info.Config.
Job Base Builder Updates
pkg/prowgen/jobbase.go, pkg/prowgen/jobbase_test.go
Job visibility and CSI driver flags now derive solely from configSpec.Prowgen instead of OR-ing with info.Config fallbacks.
Image Graph Generator
pkg/image-graph-generator/operator.go
Removes prowgen config loading/merging from image promotion callback.
Config Repository Scanning
cmd/check-gh-automation/main.go
Stops filtering out .config.prowgen files when gathering modified repositories, allowing those changes to contribute to repo targets.
Integration Test Fixtures
test/integration/ci-operator-prowgen/input/config/*/, test/integration/ci-operator-prowgen/output/jobs/*/
Migration of test fixtures: .config.prowgen files either removed or simplified; corresponding CI operator YAML files gain inline prowgen: blocks for private, disable_rehearsals, disable_rehearsal, skip_operator_presubmits, and reporter_config settings; output job fixtures updated to reflect simplified Slack reporter configuration (removed report_template inline blocks, kept only job_states_to_report).
Test Fixtures
pkg/prowgen/testdata/*fixture*
Fixture YAML files updated to remove Slack reporter template configurations and rehearsal-related job entries that are no longer generated.

🎯 4 (Complex) | ⏱️ ~55 minutes

🚥 Pre-merge checks | ✅ 12 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Coverage For New Features ⚠️ Warning Test fixture for images job slack reporter was removed without replacement. This removes coverage for synthesized jobs receiving Slack config. Restore test coverage for images job slack reporting or document why this test removal is acceptable.
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing .config.prowgen file support from the prowgen system.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Go Error Handling ✅ Passed All error handling patterns comply with the custom check. Single ignored error (h.Write in prowgen.go) is properly justified. Error wrapping uses %w appropriately, no panic calls, nil checks present.
Stable And Deterministic Test Names ✅ Passed Custom check not applicable. Codebase uses standard Go testing, not Ginkgo. All test names in modified files use static string literals with no dynamic content.
Test Structure And Quality ✅ Passed This PR contains no Ginkgo tests. All test files use standard Go testing with testing.T. The repository does not use Ginkgo. The custom check is not applicable.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests are added. PR only modifies unit tests (testing.T), configuration YAML, and fixtures. Check applies only to new Ginkgo e2e tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests. The changes are purely configuration/tooling refactoring to remove .config.prowgen support. The custom check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR refactors prowgen configuration format (removes .config.prowgen, moves inline). No deployment manifests, operators, or scheduling constraints are modified. Check not applicable.
Ote Binary Stdout Contract ✅ Passed No OTE Binary Stdout Contract violations found. All process-level code uses logrus framework for logging with no direct stdout writes. Changes are safe for OTE binary communication.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests added. Custom check applies only when new Ginkgo tests are added. This PR contains unit test modifications and integration fixture updates only.

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

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

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

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 7, 2026

[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 May 7, 2026
Copy link
Copy Markdown

@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 (1)
pkg/prowgen/prowgen.go (1)

43-65: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Propagate repo-level disable_rehearsals to non-test presubmits.

disableAllRehearsals is only threaded through the configSpec.Tests loop. The generated images and operator bundle presubmits below still call generatePresubmitForTest(...) without disableRehearsal, so a repo-wide prowgen.disable_rehearsals: true will stop suppressing rehearsals for those jobs after this migration.

Proposed fix
 		presubmits[orgrepo] = append(presubmits[orgrepo], *generatePresubmitForTest(jobBaseGen, imagesTestName, info, func(options *generatePresubmitOptions) {
+			options.disableRehearsal = disableAllRehearsals
 			options.optional = optional
 			options.runIfChanged = configSpec.Images.RunIfChanged
 			options.skipIfOnlyChanged = configSpec.Images.SkipIfOnlyChanged
 			options.pipelineRunIfChanged = configSpec.Images.PipelineRunIfChanged
 			options.pipelineSkipIfOnlyChanged = configSpec.Images.PipelineSkipIfOnlyChanged
@@
 			presubmits[orgrepo] = append(presubmits[orgrepo], *generatePresubmitForTest(jobBaseGen, testName, info, func(options *generatePresubmitOptions) {
+				options.disableRehearsal = disableAllRehearsals
 				options.optional = bundle.Optional
 				options.Capabilities = bundle.Capabilities
 			}))
@@
-			presubmits[orgrepo] = append(presubmits[orgrepo], *generatePresubmitForTest(jobBaseGen, name, info))
+			presubmits[orgrepo] = append(presubmits[orgrepo], *generatePresubmitForTest(jobBaseGen, name, info, func(options *generatePresubmitOptions) {
+				options.disableRehearsal = disableAllRehearsals
+			}))

Also applies to: 143-149, 181-208

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/prowgen/prowgen.go` around lines 43 - 65, The repo-level
disableAllRehearsals flag is computed when iterating configSpec.Tests but never
propagated into the other presubmit generators, so generatePresubmitForTest(...)
calls for images and operator bundles ignore it; update the call sites that
create non-test presubmits (calls to generatePresubmitForTest and any wrappers
that build presubmits) to accept and pass a disableRehearsal boolean (derived
from disableAllRehearsals || element.DisableRehearsal or appropriate repo-level
value), and adjust the signature of generatePresubmitForTest (and any helper
like NewProwJobBaseBuilderForTest usage) to honor that parameter so rehearsals
are suppressed consistently. Ensure all places noted in the review (the
additional presubmit generation blocks) pass the propagated disableRehearsal
flag.
🧹 Nitpick comments (1)
cmd/ci-operator-prowgen/main.go (1)

123-136: ⚡ Quick win

Wrap GenerateJobs failures with repo context.

The raw return err here drops which org/repo was being processed, so one bad config becomes hard to isolate during a full tree run.

Proposed fix
 		generated, err := prowgen.GenerateJobs(configSpec, pInfo)
 		if err != nil {
-			return err
+			return fmt.Errorf("generate jobs for %s: %w", orgRepo, err)
 		}

As per coding guidelines, "Wrap errors with fmt.Errorf("context: %w", err), lowercase messages, no trailing punctuation"

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cmd/ci-operator-prowgen/main.go` around lines 123 - 136, The call to
prowgen.GenerateJobs in generateJobs returns an error that is currently returned
raw, losing repo context; update the error return to wrap the failure with the
org/repo context (use orgRepo) using fmt.Errorf with the %w verb and a
lowercase, no-trailing-punctuation message (e.g., "generate jobs for %s: %w",
orgRepo, err) so failures from prowgen.GenerateJobs include which repository
failed while keeping existing variables (configSpec, pInfo, generated)
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/prowgen/prowgen.go`:
- Around line 262-275: slackReporterConfig currently only reads
tests[*].reporter_config and thus drops reporter settings for
synthesized/non-test jobs; update slackReporterConfig (and its callers) to
accept and merge a repo-level reporter config (e.g., a second parameter
repoSlackConfig *cioperatorapi.SlackReporterConfig) so that if testSlackConfig
is nil or missing fields you fall back to repoSlackConfig, then apply the
existing default-job-states logic and return the merged prowv1.ReporterConfig;
reference slackReporterConfig, cioperatorapi.SlackReporterConfig and
prowv1.ReporterConfig when locating where to implement the merge.

---

Outside diff comments:
In `@pkg/prowgen/prowgen.go`:
- Around line 43-65: The repo-level disableAllRehearsals flag is computed when
iterating configSpec.Tests but never propagated into the other presubmit
generators, so generatePresubmitForTest(...) calls for images and operator
bundles ignore it; update the call sites that create non-test presubmits (calls
to generatePresubmitForTest and any wrappers that build presubmits) to accept
and pass a disableRehearsal boolean (derived from disableAllRehearsals ||
element.DisableRehearsal or appropriate repo-level value), and adjust the
signature of generatePresubmitForTest (and any helper like
NewProwJobBaseBuilderForTest usage) to honor that parameter so rehearsals are
suppressed consistently. Ensure all places noted in the review (the additional
presubmit generation blocks) pass the propagated disableRehearsal flag.

---

Nitpick comments:
In `@cmd/ci-operator-prowgen/main.go`:
- Around line 123-136: The call to prowgen.GenerateJobs in generateJobs returns
an error that is currently returned raw, losing repo context; update the error
return to wrap the failure with the org/repo context (use orgRepo) using
fmt.Errorf with the %w verb and a lowercase, no-trailing-punctuation message
(e.g., "generate jobs for %s: %w", orgRepo, err) so failures from
prowgen.GenerateJobs include which repository failed while keeping existing
variables (configSpec, pInfo, generated) unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: dc6a2fde-2869-489f-84b3-9bb7477a288f

📥 Commits

Reviewing files that changed from the base of the PR and between 53463e8 and 55deef5.

📒 Files selected for processing (29)
  • cmd/check-gh-automation/main.go
  • cmd/ci-operator-prowgen/main.go
  • cmd/ci-operator-prowgen/main_test.go
  • pkg/config/load.go
  • pkg/config/load_test.go
  • pkg/image-graph-generator/operator.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_ci_operator_config_takes_precedence_over_prowgen_config.yaml
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_is_configured_for_slack_reporting.yaml
  • pkg/prowgen/testdata/zz_fixture_TestNewProwJobBaseBuilderForTest_job_excluded_by_patterns_should_not_have_slack_reporter_config.yaml
  • test/integration/ci-operator-prowgen/input/config/norehearsals/duper/.config.prowgen
  • test/integration/ci-operator-prowgen/input/config/norehearsals/duper/norehearsals-duper-master.yaml
  • test/integration/ci-operator-prowgen/input/config/norehearsals/stuper/.config.prowgen
  • test/integration/ci-operator-prowgen/input/config/norehearsals/stuper/norehearsals-stuper-master.yaml
  • test/integration/ci-operator-prowgen/input/config/private-org/.config.prowgen
  • test/integration/ci-operator-prowgen/input/config/private-org/duper/private-org-duper-master.yaml
  • test/integration/ci-operator-prowgen/input/config/private-org/super/private-org-super-master.yaml
  • test/integration/ci-operator-prowgen/input/config/private/duper/.config.prowgen
  • test/integration/ci-operator-prowgen/input/config/private/duper/private-duper-master.yaml
  • test/integration/ci-operator-prowgen/input/config/slack-report/duper/.config.prowgen
  • test/integration/ci-operator-prowgen/input/config/slack-report/duper/slack-report-duper-master.yaml
  • test/integration/ci-operator-prowgen/input/config/super/duper/.config.prowgen
  • test/integration/ci-operator-prowgen/input/config/super/duper/super-duper-release-4.19__periodics.yaml
  • test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-periodics.yaml
  • test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-postsubmits.yaml
  • test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-presubmits.yaml
💤 Files with no reviewable changes (16)
  • test/integration/ci-operator-prowgen/input/config/norehearsals/stuper/.config.prowgen
  • test/integration/ci-operator-prowgen/input/config/private-org/.config.prowgen
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_ci_operator_config_takes_precedence_over_prowgen_config.yaml
  • test/integration/ci-operator-prowgen/input/config/norehearsals/duper/.config.prowgen
  • pkg/prowgen/testdata/zz_fixture_TestNewProwJobBaseBuilderForTest_job_excluded_by_patterns_should_not_have_slack_reporter_config.yaml
  • test/integration/ci-operator-prowgen/input/config/super/duper/.config.prowgen
  • test/integration/ci-operator-prowgen/input/config/private/duper/.config.prowgen
  • test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-presubmits.yaml
  • test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-periodics.yaml
  • test/integration/ci-operator-prowgen/input/config/slack-report/duper/.config.prowgen
  • test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-postsubmits.yaml
  • pkg/image-graph-generator/operator.go
  • pkg/prowgen/testdata/zz_fixture_TestGenerateJobs_images_job_is_configured_for_slack_reporting.yaml
  • pkg/config/load_test.go
  • cmd/check-gh-automation/main.go
  • pkg/config/load.go

Comment thread pkg/prowgen/prowgen.go
Comment on lines +262 to +275
func slackReporterConfig(testSlackConfig *cioperatorapi.SlackReporterConfig) *prowv1.ReporterConfig {
if testSlackConfig == nil {
return nil
}
if slackReporter := info.Config.GetSlackReporterConfigForJobName(jobName, testName, info.Metadata.Variant); slackReporter != nil {
return &prowv1.ReporterConfig{
Slack: &prowv1.SlackReporterConfig{
Channel: slackReporter.Channel,
JobStatesToReport: slackReporter.JobStatesToReport,
ReportTemplate: slackReporter.ReportTemplate,
},
}
jobStatesToReport := testSlackConfig.JobStatesToReport
if len(jobStatesToReport) == 0 {
jobStatesToReport = cioperatorapi.DefaultSlackReporterJobStatesToReport
}
return &prowv1.ReporterConfig{
Slack: &prowv1.SlackReporterConfig{
Channel: testSlackConfig.Channel,
JobStatesToReport: jobStatesToReport,
ReportTemplate: testSlackConfig.ReportTemplate,
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

This migration drops reporter config for generated images jobs.

After narrowing slackReporterConfig to tests[*].reporter_config only, synthesized jobs like the images promotion postsubmit have no inline field that can ever reach this helper. Repos that previously configured Slack reporting for those jobs via .config.prowgen lose that behavior with no replacement.

If that deprecation is intentional, it should be called out explicitly; otherwise this needs a non-test reporter-config source before the old path is removed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/prowgen/prowgen.go` around lines 262 - 275, slackReporterConfig currently
only reads tests[*].reporter_config and thus drops reporter settings for
synthesized/non-test jobs; update slackReporterConfig (and its callers) to
accept and merge a repo-level reporter config (e.g., a second parameter
repoSlackConfig *cioperatorapi.SlackReporterConfig) so that if testSlackConfig
is nil or missing fields you fall back to repoSlackConfig, then apply the
existing default-job-states logic and return the merged prowv1.ReporterConfig;
reference slackReporterConfig, cioperatorapi.SlackReporterConfig and
prowv1.ReporterConfig when locating where to implement the merge.

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/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant