Skip to content

Commit 9f63e0d

Browse files
committed
Use NOT_BUILT to emphasize that there need not have been anything wrong with the build, we just did not even really try it
1 parent 84b1852 commit 9f63e0d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/main/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import hudson.model.DescriptorVisibilityFilter;
3535
import hudson.model.ItemGroup;
3636
import hudson.model.Queue;
37+
import hudson.model.Result;
3738
import hudson.model.Run;
3839
import hudson.model.TaskListener;
3940
import hudson.scm.SCM;
@@ -134,6 +135,7 @@ public SCMBinder(String scriptPath) {
134135
listener.error("Could not compare lightweight checkout of trusted revision").println(Functions.printThrowable(x).trim());
135136
}
136137
if (tipScript != null && !script.equals(tipScript)) {
138+
build.setResult(Result.NOT_BUILT);
137139
throw new AbortException(Messages.ReadTrustedStep__has_been_modified_in_an_untrusted_revis(scriptPath));
138140
}
139141
}

src/test/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public static void assertRevisionAction(WorkflowRun build) {
265265
assertNotNull(b);
266266
assertEquals(1, b.getNumber());
267267
assertRevisionAction(b);
268-
r.assertBuildStatus(Result.FAILURE, b);
268+
r.assertBuildStatus(Result.NOT_BUILT, b);
269269
r.assertLogContains(Messages.ReadTrustedStep__has_been_modified_in_an_untrusted_revis("Jenkinsfile"), b);
270270
r.assertLogContains("not trusting", b);
271271
SCMBinder.IGNORE_UNTRUSTED_EDITS = true;
@@ -298,7 +298,7 @@ public static void assertRevisionAction(WorkflowRun build) {
298298
b = p.getLastBuild();
299299
assertNotNull(b);
300300
assertEquals(4, b.getNumber());
301-
r.assertBuildStatus(Result.FAILURE, b);
301+
r.assertBuildStatus(Result.NOT_BUILT, b);
302302
r.assertLogContains(Messages.ReadTrustedStep__has_been_modified_in_an_untrusted_revis("Jenkinsfile"), b);
303303
r.assertLogContains("not trusting", b);
304304
b = p.scheduleBuild2(0, new CauseAction(new Cause.UserIdCause())).get();

0 commit comments

Comments
 (0)