Skip to content

prowgen: support inline slack reporter config for images jobs#5166

Open
Prucek wants to merge 3 commits intoopenshift:mainfrom
Prucek:migrate-slack-reporter
Open

prowgen: support inline slack reporter config for images jobs#5166
Prucek wants to merge 3 commits intoopenshift:mainfrom
Prucek:migrate-slack-reporter

Conversation

@Prucek
Copy link
Copy Markdown
Member

@Prucek Prucek commented May 7, 2026

Summary

  • Remove default report_template fill-in from slackReporterConfig() so inline configs behave the same as .config.prowgen fallback (no template = Prow uses its own default)
  • Remove unused DefaultSlackReporterReportTemplate constant
  • Add SlackReporterConfig field to ImageConfiguration so images presubmit/postsubmit jobs can receive inline slack reporter config, removing the need for .config.prowgen fallback for images jobs

Context

PR #5149 added per-test reporter_config support in ci-operator configs. This PR fixes a behavior difference where the inline path filled in a default report_template but the .config.prowgen path did not, and extends support to images jobs which are generated from the images: section rather than tests:.

This unblocks the migration of remaining .config.prowgen slack_reporter entries that target the images test name.

Prucek and others added 2 commits May 7, 2026 14:02
When report_template is not specified in per-test reporter_config,
don't fill in the default template. This keeps the behavior consistent
with the .config.prowgen path and avoids unnecessary diffs during
migration. Prow applies its own default template when none is set.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add SlackReporterConfig field to ImageConfiguration so that images
presubmit/postsubmit jobs can receive inline slack reporter config,
removing the need for .config.prowgen fallback for images jobs.

Also remove unused DefaultSlackReporterReportTemplate.

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Important

Review skipped

Review was skipped due to path filters

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

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 5abdfc12-cae5-4be0-b3d6-648708726bbb

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

Walkthrough

The PR extends Slack notification capabilities to image build jobs by introducing a SlackReporterConfig field to ProjectDirectoryImageBuildStepConfiguration, wiring it through job generation logic, and refactoring default template handling to compute templates inline rather than using static constants.

Changes

Slack Reporter Configuration for Image Build Jobs

Layer / File(s) Summary
Type Definition
pkg/api/types.go
ProjectDirectoryImageBuildStepConfiguration gains SlackReporterConfig field; DefaultSlackReporterReportTemplate constant removed.
Job Generation
pkg/prowgen/prowgen.go
GenerateJobs passes configSpec.Images.SlackReporterConfig to generated presubmit and postsubmit job options.
Helper Refactor
pkg/prowgen/prowgen.go
slackReporterConfig function inlines ReportTemplate defaulting logic instead of using a local variable.
Test Fixtures
test/integration/ci-operator-prowgen/input/config/slack-report-inline/duper/slack-report-inline-duper-master.yaml
Input config adds images section with base-to-image mapping and Slack reporter settings for #images-channel.
Generated Job Outputs
test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/*.yaml
Periodic, postsubmit, and presubmit jobs reflect removal of inline report_template strings; new branch-ci-slack-report-inline-duper-master-images and pull-ci-slack-report-inline-duper-master-images jobs added with Slack reporting to #images-channel.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 13 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Single Node Openshift (Sno) Test Compatibility ❓ Inconclusive No result was produced after verification. Marking as INCONCLUSIVE. Re-run the check or adjust instructions to produce a final result.
✅ Passed checks (13 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 Go error handling patterns are correct. All pointer dereferences are protected with nil checks. Images field is a value type (never nil). No new panic() calls or unhandled error patterns introduced.
Test Coverage For New Features ✅ Passed New functionality has adequate test coverage via comprehensive integration test fixtures (slack-report-inline) validating config→output transformation plus unit tests with golden file assertions.
Stable And Deterministic Test Names ✅ Passed This PR does not introduce Ginkgo tests. The codebase uses standard Go testing (testing.T). All test names are static and descriptive with no dynamic information.
Test Structure And Quality ✅ Passed No Ginkgo test code present in this PR. Changes consist of Go type/implementation files and YAML integration test fixture files only. Check is not applicable.
Microshift Test Compatibility ✅ Passed PR does not add any Ginkgo e2e tests. Changes are to API types, prowgen logic, and CI config fixtures only. Check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies Prow CI job config generation and type definitions only. No deployment manifests, operators, or scheduling constraints introduced. Not applicable to topology-aware check.
Ote Binary Stdout Contract ✅ Passed PR modifies library code only (pkg/api/types.go and pkg/prowgen/prowgen.go). No process-level code found. No stdout writes detected. Safe for OTE binary contract.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR does not add Ginkgo e2e tests. It modifies Go source code (types and Prow generation logic) and YAML config fixtures. Check only applies to new Ginkgo test code.
Title check ✅ Passed The title clearly describes the main change: adding support for inline Slack reporter configuration in prowgen for image build jobs, which aligns with the changeset modifications across types.go, prowgen.go, and test integration files.

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

@Prucek
Copy link
Copy Markdown
Member Author

Prucek commented May 7, 2026

/label tide/merge-method-squash

@openshift-ci openshift-ci Bot requested review from danilo-gemoli and smg247 May 7, 2026 13:14
@openshift-ci openshift-ci Bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label May 7, 2026
@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.

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)

164-178: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Thread images.reporter_config into the promotion periodic too.

This block fixes the images postsubmit, but the promotion.cron path still drops the same Slack config. Repos that set both images.reporter_config and promotion.cron will get Slack notifications for presubmit/postsubmit, but not for the periodic promotion job.

Suggested fix
 			if configSpec.PromotionConfiguration.Cron != "" {
 				periodic := GeneratePeriodicForTest(jobBaseGen, info, func(options *GeneratePeriodicOptions) {
 					//not needed in promotion job, the same way postsubmit does not need it
 					options.DisableRehearsal = true
 					options.Cron = configSpec.PromotionConfiguration.Cron
+					options.SlackReporterConfig = configSpec.Images.SlackReporterConfig
 				})
🤖 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 164 - 178, The promotion periodic
created by GeneratePeriodicForTest is missing the images Slack reporter config;
inside the GeneratePeriodicForTest call (and its options parameter of type
GeneratePeriodicOptions) set options.slackReporterConfig =
configSpec.Images.SlackReporterConfig in the same way you do for the postsubmit
(see generatePostsubmitForTest and its options.slackReporterConfig usage) so the
periodic promotion job inherits the Slack reporter configuration.
🤖 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.

Outside diff comments:
In `@pkg/prowgen/prowgen.go`:
- Around line 164-178: The promotion periodic created by GeneratePeriodicForTest
is missing the images Slack reporter config; inside the GeneratePeriodicForTest
call (and its options parameter of type GeneratePeriodicOptions) set
options.slackReporterConfig = configSpec.Images.SlackReporterConfig in the same
way you do for the postsubmit (see generatePostsubmitForTest and its
options.slackReporterConfig usage) so the periodic promotion job inherits the
Slack reporter configuration.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 96640fda-dbd8-4cb5-9756-12d0910f5be5

📥 Commits

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

📒 Files selected for processing (6)
  • pkg/api/types.go
  • pkg/prowgen/prowgen.go
  • test/integration/ci-operator-prowgen/input/config/slack-report-inline/duper/slack-report-inline-duper-master.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 (1)
  • test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-periodics.yaml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Prucek Prucek changed the title prowgen: slack reporter config fix prowgen: support inline slack reporter config for images jobs May 7, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 7, 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 e576dad link true /test images
ci/prow/breaking-changes e576dad link false /test breaking-changes

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. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant