From 70184f0be2eeaa57cbc3b70fa3d29ac1c421d67c Mon Sep 17 00:00:00 2001 From: Prucek Date: Thu, 30 Apr 2026 12:10:17 +0200 Subject: [PATCH] prowgen: allow per-test slack reporter config in ci-operator config Add a `reporter_config` field to `TestStepConfiguration` that lets ci-operator config files specify Slack notifications directly on individual tests, with an optional `job_types` filter to control which generated job types (presubmit/postsubmit/periodic) receive the config. Per-test config takes precedence over `.config.prowgen` slack_reporter, which remains as a fallback during the migration period. Co-Authored-By: Claude Opus 4.6 --- pkg/api/types.go | 22 ++ pkg/api/zz_generated.deepcopy.go | 47 ++- pkg/prowgen/prowgen.go | 85 ++++-- pkg/validation/test.go | 9 + .../zz_generated.ci_operator_reference.go | 20 ++ .../slack-report-inline-duper-master.yaml | 65 +++++ ...-report-inline-duper-master-periodics.yaml | 141 +++++++++ ...eport-inline-duper-master-postsubmits.yaml | 69 +++++ ...report-inline-duper-master-presubmits.yaml | 271 ++++++++++++++++++ 9 files changed, 688 insertions(+), 41 deletions(-) create mode 100644 test/integration/ci-operator-prowgen/input/config/slack-report-inline/duper/slack-report-inline-duper-master.yaml create mode 100644 test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-periodics.yaml create mode 100644 test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-postsubmits.yaml create mode 100644 test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-presubmits.yaml diff --git a/pkg/api/types.go b/pkg/api/types.go index 35f0119ad8..a83056253a 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -24,6 +24,25 @@ func IsPromotionJob(jobLabels map[string]string) bool { return ok } +var ( + DefaultSlackReporterJobStatesToReport = []prowv1.ProwJobState{ + prowv1.SuccessState, + prowv1.FailureState, + prowv1.ErrorState, + } + DefaultSlackReporterReportTemplate = `{{if eq .Status.State "success"}} :slack-green: Job *{{.Spec.Job}}* ended with *{{.Status.State}}*. <{{.Status.URL}}|View logs> {{else}} :failed: Job *{{.Spec.Job}}* ended with *{{.Status.State}}*. <{{.Status.URL}}|View logs> {{end}}` +) + +type SlackReporterConfig struct { + Channel string `json:"channel"` + JobStatesToReport []prowv1.ProwJobState `json:"job_states_to_report,omitempty"` + ReportTemplate string `json:"report_template,omitempty"` + // ReportPresubmit controls whether the presubmit job generated from a + // periodic test with `presubmit: true` also gets this slack config. + // Only valid when the test has `presubmit: true`. + ReportPresubmit bool `json:"report_presubmit,omitempty"` +} + type ProwgenOverrides struct { DisableRehearsals bool `json:"disable_rehearsals,omitempty"` SkipOperatorPresubmits bool `json:"skip_operator_presubmits,omitempty"` @@ -885,6 +904,9 @@ type TestStepConfiguration struct { // MaxConcurrency sets the maximum number of this job running concurrently. 0 means no limit. MaxConcurrency int `json:"max_concurrency,omitempty"` + // SlackReporterConfig configures Slack notifications for this test's generated jobs. + SlackReporterConfig *SlackReporterConfig `json:"reporter_config,omitempty"` + // Only one of the following can be not-null. ContainerTestConfiguration *ContainerTestConfiguration `json:"container,omitempty"` MultiStageTestConfiguration *MultiStageTestConfiguration `json:"steps,omitempty"` diff --git a/pkg/api/zz_generated.deepcopy.go b/pkg/api/zz_generated.deepcopy.go index 6a5ddf8e65..c8e6bd8c20 100644 --- a/pkg/api/zz_generated.deepcopy.go +++ b/pkg/api/zz_generated.deepcopy.go @@ -5,8 +5,8 @@ package api import ( - "github.com/openshift/api/image/v1" - prowjobsv1 "sigs.k8s.io/prow/pkg/apis/prowjobs/v1" + imagev1 "github.com/openshift/api/image/v1" + "sigs.k8s.io/prow/pkg/apis/prowjobs/v1" "sigs.k8s.io/prow/pkg/config" ) @@ -149,7 +149,7 @@ func (in *ClusterClaim) DeepCopyInto(out *ClusterClaim) { } if in.Timeout != nil { in, out := &in.Timeout, &out.Timeout - *out = new(prowjobsv1.Duration) + *out = new(v1.Duration) **out = **in } } @@ -813,7 +813,7 @@ func (in *Integration) DeepCopyInto(out *Integration) { *out = *in if in.ReferencePolicy != nil { in, out := &in.ReferencePolicy, &out.ReferencePolicy - *out = new(v1.TagReferencePolicyType) + *out = new(imagev1.TagReferencePolicyType) **out = **in } } @@ -839,12 +839,12 @@ func (in *LiteralTestStep) DeepCopyInto(out *LiteralTestStep) { in.Resources.DeepCopyInto(&out.Resources) if in.Timeout != nil { in, out := &in.Timeout, &out.Timeout - *out = new(prowjobsv1.Duration) + *out = new(v1.Duration) **out = **in } if in.GracePeriod != nil { in, out := &in.GracePeriod, &out.GracePeriod - *out = new(prowjobsv1.Duration) + *out = new(v1.Duration) **out = **in } if in.Credentials != nil { @@ -1147,7 +1147,7 @@ func (in *MultiStageTestConfigurationLiteral) DeepCopyInto(out *MultiStageTestCo } if in.Timeout != nil { in, out := &in.Timeout, &out.Timeout - *out = new(prowjobsv1.Duration) + *out = new(v1.Duration) **out = **in } } @@ -1194,12 +1194,12 @@ func (in *Observer) DeepCopyInto(out *Observer) { in.Resources.DeepCopyInto(&out.Resources) if in.Timeout != nil { in, out := &in.Timeout, &out.Timeout - *out = new(prowjobsv1.Duration) + *out = new(v1.Duration) **out = **in } if in.GracePeriod != nil { in, out := &in.GracePeriod, &out.GracePeriod - *out = new(prowjobsv1.Duration) + *out = new(v1.Duration) **out = **in } if in.Environment != nil { @@ -1839,7 +1839,7 @@ func (in *ReleaseTagConfiguration) DeepCopyInto(out *ReleaseTagConfiguration) { *out = *in if in.ReferencePolicy != nil { in, out := &in.ReferencePolicy, &out.ReferencePolicy - *out = new(v1.TagReferencePolicyType) + *out = new(imagev1.TagReferencePolicyType) **out = **in } } @@ -1940,6 +1940,26 @@ func (in *Secret) DeepCopy() *Secret { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SlackReporterConfig) DeepCopyInto(out *SlackReporterConfig) { + *out = *in + if in.JobStatesToReport != nil { + in, out := &in.JobStatesToReport, &out.JobStatesToReport + *out = make([]v1.ProwJobState, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackReporterConfig. +func (in *SlackReporterConfig) DeepCopy() *SlackReporterConfig { + if in == nil { + return nil + } + out := new(SlackReporterConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SourceStepConfiguration) DeepCopyInto(out *SourceStepConfiguration) { *out = *in @@ -2273,7 +2293,7 @@ func (in *TestStepConfiguration) DeepCopyInto(out *TestStepConfiguration) { } if in.Timeout != nil { in, out := &in.Timeout, &out.Timeout - *out = new(prowjobsv1.Duration) + *out = new(v1.Duration) **out = **in } if in.RestrictNetworkAccess != nil { @@ -2286,6 +2306,11 @@ func (in *TestStepConfiguration) DeepCopyInto(out *TestStepConfiguration) { *out = new(int) **out = **in } + if in.SlackReporterConfig != nil { + in, out := &in.SlackReporterConfig, &out.SlackReporterConfig + *out = new(SlackReporterConfig) + (*in).DeepCopyInto(*out) + } if in.ContainerTestConfiguration != nil { in, out := &in.ContainerTestConfiguration, &out.ContainerTestConfiguration *out = new(ContainerTestConfiguration) diff --git a/pkg/prowgen/prowgen.go b/pkg/prowgen/prowgen.go index 1f27526350..abf6f6138a 100644 --- a/pkg/prowgen/prowgen.go +++ b/pkg/prowgen/prowgen.go @@ -98,16 +98,18 @@ func GenerateJobs(configSpec *cioperatorapi.ReleaseBuildConfiguration, info *Pro options.DisableRehearsal = disableRehearsal options.Retry = element.Retry options.MaxConcurrency = element.MaxConcurrency + options.SlackReporterConfig = element.SlackReporterConfig }) periodics = append(periodics, *periodic) if element.Presubmit { - handlePresubmit(g, element, info, name, disableRehearsal, configSpec.Resources.RequirementsForStep(element.As).Requests, presubmits, orgrepo) + handlePresubmit(g, element, info, name, disableRehearsal, configSpec.Resources.RequirementsForStep(element.As).Requests, presubmits, orgrepo, true) } } else if element.Postsubmit { postsubmit := generatePostsubmitForTest(g, info, func(options *generatePostsubmitOptions) { options.runIfChanged = element.RunIfChanged options.Capabilities = element.Capabilities options.skipIfOnlyChanged = element.SkipIfOnlyChanged + options.slackReporterConfig = element.SlackReporterConfig }) postsubmit.MaxConcurrency = 1 if element.MaxConcurrency != 0 { @@ -115,7 +117,7 @@ func GenerateJobs(configSpec *cioperatorapi.ReleaseBuildConfiguration, info *Pro } postsubmits[orgrepo] = append(postsubmits[orgrepo], *postsubmit) } else { - handlePresubmit(g, element, info, name, disableRehearsal, configSpec.Resources.RequirementsForStep(element.As).Requests, presubmits, orgrepo) + handlePresubmit(g, element, info, name, disableRehearsal, configSpec.Resources.RequirementsForStep(element.As).Requests, presubmits, orgrepo, false) } } } @@ -222,7 +224,11 @@ func GenerateJobs(configSpec *cioperatorapi.ReleaseBuildConfiguration, info *Pro }, nil } -func handlePresubmit(g *prowJobBaseBuilder, element cioperatorapi.TestStepConfiguration, info *ProwgenInfo, name string, disableRehearsal bool, requests cioperatorapi.ResourceList, presubmits map[string][]prowconfig.Presubmit, orgrepo string) { +func handlePresubmit(g *prowJobBaseBuilder, element cioperatorapi.TestStepConfiguration, info *ProwgenInfo, name string, disableRehearsal bool, requests cioperatorapi.ResourceList, presubmits map[string][]prowconfig.Presubmit, orgrepo string, fromPeriodic bool) { + slackConfig := element.SlackReporterConfig + if fromPeriodic && (slackConfig == nil || !slackConfig.ReportPresubmit) { + slackConfig = nil + } presubmit := generatePresubmitForTest(g, name, info, func(options *generatePresubmitOptions) { options.pipelineRunIfChanged = element.PipelineRunIfChanged options.pipelineSkipIfOnlyChanged = element.PipelineSkipIfOnlyChanged @@ -233,6 +239,7 @@ func handlePresubmit(g *prowJobBaseBuilder, element cioperatorapi.TestStepConfig options.optional = element.Optional options.disableRehearsal = disableRehearsal options.maxConcurrency = element.MaxConcurrency + options.slackReporterConfig = slackConfig }) v, requestingKVM := requests[cioperatorapi.KVMDeviceLabel] if requestingKVM { @@ -251,6 +258,7 @@ type generatePresubmitOptions struct { optional bool disableRehearsal bool maxConcurrency int + slackReporterConfig *cioperatorapi.SlackReporterConfig } func (opts *generatePresubmitOptions) shouldAlwaysRun() bool { @@ -259,18 +267,36 @@ func (opts *generatePresubmitOptions) shouldAlwaysRun() bool { type generatePresubmitOption func(options *generatePresubmitOptions) -// addSlackReporterConfig sets the Slack reporter configuration on a job base if one is found -func addSlackReporterConfig(base *prowconfig.JobBase, jobName, testName string, info *ProwgenInfo) { - if slackReporter := info.Config.GetSlackReporterConfigForJobName(jobName, testName, info.Metadata.Variant); slackReporter != nil { - if base.ReporterConfig == nil { - base.ReporterConfig = &prowv1.ReporterConfig{} +// slackReporterConfig returns the Slack reporter configuration for a job. +// Per-test config (from ci-operator config) takes precedence over .config.prowgen. +func slackReporterConfig(jobName, testName string, testSlackConfig *cioperatorapi.SlackReporterConfig, info *ProwgenInfo) *prowv1.ReporterConfig { + if testSlackConfig != nil { + jobStatesToReport := testSlackConfig.JobStatesToReport + if len(jobStatesToReport) == 0 { + jobStatesToReport = cioperatorapi.DefaultSlackReporterJobStatesToReport + } + reportTemplate := testSlackConfig.ReportTemplate + if reportTemplate == "" { + reportTemplate = cioperatorapi.DefaultSlackReporterReportTemplate } - base.ReporterConfig.Slack = &prowv1.SlackReporterConfig{ - Channel: slackReporter.Channel, - JobStatesToReport: slackReporter.JobStatesToReport, - ReportTemplate: slackReporter.ReportTemplate, + return &prowv1.ReporterConfig{ + Slack: &prowv1.SlackReporterConfig{ + Channel: testSlackConfig.Channel, + JobStatesToReport: jobStatesToReport, + ReportTemplate: reportTemplate, + }, + } + } + 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, + }, } } + return nil } func generatePresubmitForTest(jobBaseBuilder *prowJobBaseBuilder, name string, info *ProwgenInfo, options ...generatePresubmitOption) *prowconfig.Presubmit { @@ -282,9 +308,8 @@ func generatePresubmitForTest(jobBaseBuilder *prowJobBaseBuilder, name string, i shortName := info.TestName(name) base := jobBaseBuilder.Rehearsable(!opts.disableRehearsal).Build(jc.PresubmitPrefix) - // Set slack reporter config using full job name for proper excluded_job_patterns matching fullJobName := info.JobName(jc.PresubmitPrefix, name) - addSlackReporterConfig(&base, fullJobName, name, info) + base.ReporterConfig = slackReporterConfig(fullJobName, name, opts.slackReporterConfig, info) pipelineOpt := false if opts.pipelineRunIfChanged != "" { @@ -326,9 +351,10 @@ func generatePresubmitForTest(jobBaseBuilder *prowJobBaseBuilder, name string, i } type generatePostsubmitOptions struct { - runIfChanged string - Capabilities []string - skipIfOnlyChanged string + runIfChanged string + Capabilities []string + skipIfOnlyChanged string + slackReporterConfig *cioperatorapi.SlackReporterConfig } type generatePostsubmitOption func(options *generatePostsubmitOptions) @@ -341,10 +367,9 @@ func generatePostsubmitForTest(jobBaseBuilder *prowJobBaseBuilder, info *Prowgen base := jobBaseBuilder.Build(jc.PostsubmitPrefix) - // Set slack reporter config using full job name for proper excluded_job_patterns matching testName := jobBaseBuilder.testName fullJobName := info.JobName(jc.PostsubmitPrefix, testName) - addSlackReporterConfig(&base, fullJobName, testName, info) + base.ReporterConfig = slackReporterConfig(fullJobName, testName, opts.slackReporterConfig, info) alwaysRun := opts.runIfChanged == "" && opts.skipIfOnlyChanged == "" pj := &prowconfig.Postsubmit{ @@ -373,15 +398,16 @@ func hashDailyCron(job string) string { } type GeneratePeriodicOptions struct { - Interval string - MinimumInterval string - Capabilities []string - Cron string - ReleaseController bool - PathAlias *string - DisableRehearsal bool - Retry *prowconfig.Retry - MaxConcurrency int + Interval string + MinimumInterval string + Capabilities []string + Cron string + ReleaseController bool + PathAlias *string + DisableRehearsal bool + Retry *prowconfig.Retry + MaxConcurrency int + SlackReporterConfig *cioperatorapi.SlackReporterConfig } type GeneratePeriodicOption func(options *GeneratePeriodicOptions) @@ -401,10 +427,9 @@ func GeneratePeriodicForTest(jobBaseBuilder *prowJobBaseBuilder, info *ProwgenIn // We are resetting PathAlias because it will be set on the `ExtraRefs` item base := jobBaseBuilder.Rehearsable(!opts.DisableRehearsal).PathAlias("").Build(jc.PeriodicPrefix) - // Set slack reporter config using full job name for proper excluded_job_patterns matching testName := jobBaseBuilder.testName fullJobName := info.JobName(jc.PeriodicPrefix, testName) - addSlackReporterConfig(&base, fullJobName, testName, info) + base.ReporterConfig = slackReporterConfig(fullJobName, testName, opts.SlackReporterConfig, info) cron := opts.Cron if cron == "@daily" { diff --git a/pkg/validation/test.go b/pkg/validation/test.go index 648cd2c8ef..b84d113bf0 100644 --- a/pkg/validation/test.go +++ b/pkg/validation/test.go @@ -213,6 +213,15 @@ func (v *Validator) validateTestStepConfiguration( } } + if test.SlackReporterConfig != nil { + if test.SlackReporterConfig.Channel == "" { + validationErrors = append(validationErrors, fmt.Errorf("%s.reporter_config.channel: must be set", fieldRootN)) + } + if test.SlackReporterConfig.ReportPresubmit && !test.Presubmit { + validationErrors = append(validationErrors, fmt.Errorf("%s.reporter_config.report_presubmit: can only be set when the test has `presubmit: true`", fieldRootN)) + } + } + maxJobTimeout := time.Hour * 72 if test.Timeout != nil && test.Timeout.Duration > maxJobTimeout { validationErrors = append(validationErrors, fmt.Errorf("%s: job timeout is limited to %s", fieldRootN, maxJobTimeout)) diff --git a/pkg/webreg/zz_generated.ci_operator_reference.go b/pkg/webreg/zz_generated.ci_operator_reference.go index 90a39df378..b66cb25651 100644 --- a/pkg/webreg/zz_generated.ci_operator_reference.go +++ b/pkg/webreg/zz_generated.ci_operator_reference.go @@ -1075,6 +1075,16 @@ const ciOperatorReferenceYaml = "# The list of base images describe\n" + " # The job must be configured as a verification or periodic job in a\n" + " # release-controller config file when this field is set to `true`.\n" + " release_controller: true\n" + + " # SlackReporterConfig configures Slack notifications for this test's generated jobs.\n" + + " reporter_config:\n" + + " channel: ' '\n" + + " job_states_to_report:\n" + + " - \"\"\n" + + " # ReportPresubmit controls whether the presubmit job generated from a\n" + + " # periodic test with `presubmit: true` also gets this slack config.\n" + + " # Only valid when the test has `presubmit: true`.\n" + + " report_presubmit: true\n" + + " report_template: ' '\n" + " # RestrictNetworkAccess restricts network access to RedHat intranet.\n" + " restrict_network_access: false\n" + " # Retry is a configuration entry for retrying periodic prowjobs\n" + @@ -1997,6 +2007,16 @@ const ciOperatorReferenceYaml = "# The list of base images describe\n" + " # The job must be configured as a verification or periodic job in a\n" + " # release-controller config file when this field is set to `true`.\n" + " release_controller: true\n" + + " # SlackReporterConfig configures Slack notifications for this test's generated jobs.\n" + + " reporter_config:\n" + + " channel: ' '\n" + + " job_states_to_report:\n" + + " - \"\"\n" + + " # ReportPresubmit controls whether the presubmit job generated from a\n" + + " # periodic test with `presubmit: true` also gets this slack config.\n" + + " # Only valid when the test has `presubmit: true`.\n" + + " report_presubmit: true\n" + + " report_template: ' '\n" + " # RestrictNetworkAccess restricts network access to RedHat intranet.\n" + " restrict_network_access: false\n" + " # Retry is a configuration entry for retrying periodic prowjobs\n" + diff --git a/test/integration/ci-operator-prowgen/input/config/slack-report-inline/duper/slack-report-inline-duper-master.yaml b/test/integration/ci-operator-prowgen/input/config/slack-report-inline/duper/slack-report-inline-duper-master.yaml new file mode 100644 index 0000000000..0af1cc89be --- /dev/null +++ b/test/integration/ci-operator-prowgen/input/config/slack-report-inline/duper/slack-report-inline-duper-master.yaml @@ -0,0 +1,65 @@ +base_images: + base: + name: origin-v4.0 + namespace: openshift + tag: base +build_root: + image_stream_tag: + name: release + namespace: openshift + tag: golang-1.10 +resources: + '*': + limits: + cpu: 500Mi + requests: + cpu: 10Mi +tag_specification: + name: origin-v4.0 + namespace: openshift +tests: +- as: unit + commands: make test-unit + container: + from: src + reporter_config: + channel: "#inline-channel" + job_states_to_report: + - failure + - error +- as: e2e + commands: make test-e2e + container: + from: src +- as: upload-results + commands: make upload-results + container: + from: src + postsubmit: true + reporter_config: + channel: "#postsubmit-channel" + job_states_to_report: + - failure +- as: lint + commands: make test-lint + container: + from: src + interval: 2h + presubmit: true + reporter_config: + channel: "#periodic-only-channel" + job_states_to_report: + - error +- as: verify + commands: make verify + container: + from: src + cron: '@daily' + presubmit: true + reporter_config: + channel: "#both-channel" + report_presubmit: true +zz_generated_metadata: + branch: master + org: slack-report-inline + repo: duper diff --git a/test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-periodics.yaml b/test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-periodics.yaml new file mode 100644 index 0000000000..4e8deff934 --- /dev/null +++ b/test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-periodics.yaml @@ -0,0 +1,141 @@ +periodics: +- agent: kubernetes + decorate: true + decoration_config: + skip_cloning: true + extra_refs: + - base_ref: master + org: slack-report-inline + repo: duper + interval: 2h + labels: + ci.openshift.io/generator: prowgen + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: periodic-ci-slack-report-inline-duper-master-lint + reporter_config: + slack: + channel: '#periodic-only-channel' + job_states_to_report: + - error + report_template: '{{if eq .Status.State "success"}} :slack-green: Job *{{.Spec.Job}}* + ended with *{{.Status.State}}*. <{{.Status.URL}}|View logs> {{else}} :failed: + Job *{{.Spec.Job}}* ended with *{{.Status.State}}*. <{{.Status.URL}}|View + logs> {{end}}' + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --report-credentials-file=/etc/report/credentials + - --target=lint + command: + - ci-operator + env: + - name: HTTP_SERVER_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest + imagePullPolicy: Always + name: "" + ports: + - containerPort: 8080 + name: http + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator +- agent: kubernetes + cron: 5 3 * * * + decorate: true + decoration_config: + skip_cloning: true + extra_refs: + - base_ref: master + org: slack-report-inline + repo: duper + labels: + ci.openshift.io/generator: prowgen + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: periodic-ci-slack-report-inline-duper-master-verify + reporter_config: + slack: + channel: '#both-channel' + job_states_to_report: + - success + - failure + - error + report_template: '{{if eq .Status.State "success"}} :slack-green: Job *{{.Spec.Job}}* + ended with *{{.Status.State}}*. <{{.Status.URL}}|View logs> {{else}} :failed: + Job *{{.Spec.Job}}* ended with *{{.Status.State}}*. <{{.Status.URL}}|View + logs> {{end}}' + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --report-credentials-file=/etc/report/credentials + - --target=verify + command: + - ci-operator + env: + - name: HTTP_SERVER_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest + imagePullPolicy: Always + name: "" + ports: + - containerPort: 8080 + name: http + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator diff --git a/test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-postsubmits.yaml b/test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-postsubmits.yaml new file mode 100644 index 0000000000..9c72001706 --- /dev/null +++ b/test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-postsubmits.yaml @@ -0,0 +1,69 @@ +postsubmits: + slack-report-inline/duper: + - agent: kubernetes + always_run: true + branches: + - ^master$ + decorate: true + decoration_config: + skip_cloning: true + labels: + ci.openshift.io/generator: prowgen + max_concurrency: 1 + name: branch-ci-slack-report-inline-duper-master-upload-results + reporter_config: + slack: + channel: '#postsubmit-channel' + job_states_to_report: + - failure + report_template: '{{if eq .Status.State "success"}} :slack-green: Job *{{.Spec.Job}}* + ended with *{{.Status.State}}*. <{{.Status.URL}}|View logs> {{else}} :failed: + Job *{{.Spec.Job}}* ended with *{{.Status.State}}*. <{{.Status.URL}}|View + logs> {{end}}' + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --report-credentials-file=/etc/report/credentials + - --target=upload-results + command: + - ci-operator + env: + - name: HTTP_SERVER_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest + imagePullPolicy: Always + name: "" + ports: + - containerPort: 8080 + name: http + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator diff --git a/test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-presubmits.yaml b/test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-presubmits.yaml new file mode 100644 index 0000000000..574959127f --- /dev/null +++ b/test/integration/ci-operator-prowgen/output/jobs/slack-report-inline/duper/slack-report-inline-duper-master-presubmits.yaml @@ -0,0 +1,271 @@ +presubmits: + slack-report-inline/duper: + - agent: kubernetes + always_run: true + branches: + - ^master$ + - ^master- + context: ci/prow/e2e + decorate: true + decoration_config: + skip_cloning: true + labels: + ci.openshift.io/generator: prowgen + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: pull-ci-slack-report-inline-duper-master-e2e + rerun_command: /test e2e + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --report-credentials-file=/etc/report/credentials + - --target=e2e + command: + - ci-operator + env: + - name: HTTP_SERVER_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest + imagePullPolicy: Always + name: "" + ports: + - containerPort: 8080 + name: http + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator + trigger: (?m)^/test( | .* )e2e,?($|\s.*) + - agent: kubernetes + always_run: true + branches: + - ^master$ + - ^master- + context: ci/prow/lint + decorate: true + decoration_config: + skip_cloning: true + labels: + ci.openshift.io/generator: prowgen + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: pull-ci-slack-report-inline-duper-master-lint + rerun_command: /test lint + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --report-credentials-file=/etc/report/credentials + - --target=lint + command: + - ci-operator + env: + - name: HTTP_SERVER_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest + imagePullPolicy: Always + name: "" + ports: + - containerPort: 8080 + name: http + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator + trigger: (?m)^/test( | .* )lint,?($|\s.*) + - agent: kubernetes + always_run: true + branches: + - ^master$ + - ^master- + context: ci/prow/unit + decorate: true + decoration_config: + skip_cloning: true + labels: + ci.openshift.io/generator: prowgen + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: pull-ci-slack-report-inline-duper-master-unit + reporter_config: + slack: + channel: '#inline-channel' + job_states_to_report: + - failure + - error + report_template: '{{if eq .Status.State "success"}} :slack-green: Job *{{.Spec.Job}}* + ended with *{{.Status.State}}*. <{{.Status.URL}}|View logs> {{else}} :failed: + Job *{{.Spec.Job}}* ended with *{{.Status.State}}*. <{{.Status.URL}}|View + logs> {{end}}' + rerun_command: /test unit + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --report-credentials-file=/etc/report/credentials + - --target=unit + command: + - ci-operator + env: + - name: HTTP_SERVER_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest + imagePullPolicy: Always + name: "" + ports: + - containerPort: 8080 + name: http + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator + trigger: (?m)^/test( | .* )unit,?($|\s.*) + - agent: kubernetes + always_run: true + branches: + - ^master$ + - ^master- + context: ci/prow/verify + decorate: true + decoration_config: + skip_cloning: true + labels: + ci.openshift.io/generator: prowgen + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: pull-ci-slack-report-inline-duper-master-verify + reporter_config: + slack: + channel: '#both-channel' + job_states_to_report: + - success + - failure + - error + report_template: '{{if eq .Status.State "success"}} :slack-green: Job *{{.Spec.Job}}* + ended with *{{.Status.State}}*. <{{.Status.URL}}|View logs> {{else}} :failed: + Job *{{.Spec.Job}}* ended with *{{.Status.State}}*. <{{.Status.URL}}|View + logs> {{end}}' + rerun_command: /test verify + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --report-credentials-file=/etc/report/credentials + - --target=verify + command: + - ci-operator + env: + - name: HTTP_SERVER_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest + imagePullPolicy: Always + name: "" + ports: + - containerPort: 8080 + name: http + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator + trigger: (?m)^/test( | .* )verify,?($|\s.*)