@@ -88,6 +88,9 @@ func GenerateJobs(configSpec *cioperatorapi.ReleaseBuildConfiguration, info *Pro
88
88
}
89
89
} else if element .Postsubmit {
90
90
postsubmit := generatePostsubmitForTest (g , info , func (options * generatePostsubmitOptions ) {
91
+ if element .AlwaysRun != nil {
92
+ options .alwaysRun = element .AlwaysRun
93
+ }
91
94
options .runIfChanged = element .RunIfChanged
92
95
options .skipIfOnlyChanged = element .SkipIfOnlyChanged
93
96
})
@@ -180,13 +183,16 @@ func GenerateJobs(configSpec *cioperatorapi.ReleaseBuildConfiguration, info *Pro
180
183
181
184
func handlePresubmit (g * prowJobBaseBuilder , element api.TestStepConfiguration , info * ProwgenInfo , disableRehearsal bool , requests api.ResourceList , presubmits map [string ][]prowconfig.Presubmit , orgrepo string ) {
182
185
presubmit := generatePresubmitForTest (g , element .As , info , func (options * generatePresubmitOptions ) {
183
- options .pipelineRunIfChanged = element .PipelineRunIfChanged
184
- options .Capabilities = element .Capabilities
185
- options .runIfChanged = element .RunIfChanged
186
- options .skipIfOnlyChanged = element .SkipIfOnlyChanged
187
- options .defaultDisable = element .AlwaysRun != nil && ! * element .AlwaysRun
188
- options .optional = element .Optional
189
- options .disableRehearsal = disableRehearsal
186
+ if element .AlwaysRun != nil {
187
+ options .alwaysRun = element .AlwaysRun
188
+ options .defaultDisable = ! * element .AlwaysRun
189
+ }
190
+ options .Capabilities = element .Capabilities
191
+ options .disableRehearsal = disableRehearsal
192
+ options .optional = element .Optional
193
+ options .pipelineRunIfChanged = element .PipelineRunIfChanged
194
+ options .runIfChanged = element .RunIfChanged
195
+ options .skipIfOnlyChanged = element .SkipIfOnlyChanged
190
196
})
191
197
v , requestingKVM := requests [cioperatorapi .KVMDeviceLabel ]
192
198
if requestingKVM {
@@ -205,6 +211,7 @@ func testContainsLease(test *cioperatorapi.TestStepConfiguration) bool {
205
211
}
206
212
207
213
type generatePresubmitOptions struct {
214
+ alwaysRun * bool
208
215
pipelineRunIfChanged string
209
216
Capabilities []string
210
217
runIfChanged string
@@ -238,7 +245,6 @@ func generatePresubmitForTest(jobBaseBuilder *prowJobBaseBuilder, name string, i
238
245
}
239
246
pj := & prowconfig.Presubmit {
240
247
JobBase : base ,
241
- AlwaysRun : opts .runIfChanged == "" && opts .skipIfOnlyChanged == "" && ! opts .defaultDisable && opts .pipelineRunIfChanged == "" ,
242
248
Brancher : prowconfig.Brancher {Branches : sets .List (sets .New [string ](jc .ExactlyBranch (info .Branch ), jc .FeatureBranch (info .Branch )))},
243
249
Reporter : prowconfig.Reporter {
244
250
Context : fmt .Sprintf ("ci/prow/%s" , shortName ),
@@ -251,11 +257,17 @@ func generatePresubmitForTest(jobBaseBuilder *prowJobBaseBuilder, name string, i
251
257
},
252
258
Optional : opts .optional ,
253
259
}
260
+ if opts .alwaysRun != nil {
261
+ pj .AlwaysRun = * opts .alwaysRun
262
+ } else {
263
+ pj .AlwaysRun = opts .runIfChanged == "" && opts .skipIfOnlyChanged == "" && ! opts .defaultDisable && opts .pipelineRunIfChanged == ""
264
+ }
254
265
injectCapabilities (pj .Labels , opts .Capabilities )
255
266
return pj
256
267
}
257
268
258
269
type generatePostsubmitOptions struct {
270
+ alwaysRun * bool
259
271
runIfChanged string
260
272
Capabilities []string
261
273
skipIfOnlyChanged string
0 commit comments