prowgen: support inline slack reporter config for images jobs#5166
prowgen: support inline slack reporter config for images jobs#5166Prucek wants to merge 3 commits intoopenshift:mainfrom
Conversation
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>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (2)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR extends Slack notification capabilities to image build jobs by introducing a ChangesSlack Reporter Configuration for Image Build Jobs
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 13 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (13 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/label tide/merge-method-squash |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
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 winThread
images.reporter_configinto the promotion periodic too.This block fixes the images postsubmit, but the
promotion.cronpath still drops the same Slack config. Repos that set bothimages.reporter_configandpromotion.cronwill 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
📒 Files selected for processing (6)
pkg/api/types.gopkg/prowgen/prowgen.gotest/integration/ci-operator-prowgen/input/config/slack-report-inline/duper/slack-report-inline-duper-master.yamltest/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-periodics.yamltest/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-postsubmits.yamltest/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: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Summary
report_templatefill-in fromslackReporterConfig()so inline configs behave the same as.config.prowgenfallback (no template = Prow uses its own default)DefaultSlackReporterReportTemplateconstantSlackReporterConfigfield toImageConfigurationso images presubmit/postsubmit jobs can receive inline slack reporter config, removing the need for.config.prowgenfallback for images jobsContext
PR #5149 added per-test
reporter_configsupport in ci-operator configs. This PR fixes a behavior difference where the inline path filled in a defaultreport_templatebut the.config.prowgenpath did not, and extends support to images jobs which are generated from theimages:section rather thantests:.This unblocks the migration of remaining
.config.prowgenslack_reporterentries that target theimagestest name.