Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/src/main/java/hudson/model/BuildableItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,8 @@
}

boolean scheduleBuild(int quietPeriod, Cause c);

default boolean isBuildable() {
return true;

Check warning on line 62 in core/src/main/java/hudson/model/BuildableItem.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 62 is not covered by tests
};

Check warning on line 63 in core/src/main/java/hudson/model/BuildableItem.java

View check run for this annotation

ci.jenkins.io / Java Compiler

spotbugs:spotbugs

ERROR: Unnecessary semicolon. [UnnecessarySemicolonAfterTypeMemberDeclaration]

Check warning on line 63 in core/src/main/java/hudson/model/BuildableItem.java

View check run for this annotation

ci.jenkins.io / Java Compiler

spotbugs:spotbugs

ERROR: ';' should be separated from previous line. [EmptyLineSeparator]

Check warning on line 63 in core/src/main/java/hudson/model/BuildableItem.java

View check run for this annotation

ci.jenkins.io / Java Compiler

ERROR: Unnecessary semicolon. [UnnecessarySemicolonAfterTypeMemberDeclaration]

Check warning on line 63 in core/src/main/java/hudson/model/BuildableItem.java

View check run for this annotation

ci.jenkins.io / Java Compiler

ERROR: ';' should be separated from previous line. [EmptyLineSeparator]

Check warning on line 63 in core/src/main/java/hudson/model/BuildableItem.java

View check run for this annotation

ci.jenkins.io / Java Compiler

checkstyle:check

ERROR: Unnecessary semicolon. [UnnecessarySemicolonAfterTypeMemberDeclaration]

Check warning on line 63 in core/src/main/java/hudson/model/BuildableItem.java

View check run for this annotation

ci.jenkins.io / Java Compiler

checkstyle:check

ERROR: ';' should be separated from previous line. [EmptyLineSeparator]

Check warning on line 63 in core/src/main/java/hudson/model/BuildableItem.java

View check run for this annotation

ci.jenkins.io / CheckStyle

UnnecessarySemicolonAfterTypeMemberDeclarationCheck

ERROR: Unnecessary semicolon.

Check warning on line 63 in core/src/main/java/hudson/model/BuildableItem.java

View check run for this annotation

ci.jenkins.io / CheckStyle

EmptyLineSeparatorCheck

ERROR: ';' should be separated from previous line.
Raw output
<p>Since Checkstyle 5.8</p><p> Checks for empty line separators after header, package, all import declarations, fields, constructors, methods, nested classes, static initializers and instance initializers. </p><p> ATTENTION: empty line separator is required between AST siblings, not after line where token is found. </p>
}
12 changes: 11 additions & 1 deletion core/src/main/java/jenkins/model/ParameterizedJobMixIn.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import hudson.model.Cause;
import hudson.model.CauseAction;
import hudson.model.Item;
import hudson.model.ItemGroup;
import hudson.model.Items;
import hudson.model.Job;
import hudson.model.ParameterDefinition;
Expand Down Expand Up @@ -562,8 +563,17 @@
return null;
}

@Override
default boolean isBuildable() {
return !isDisabled() && !((Job) this).isHoldOffBuildUntilSave();
if (isDisabled() || ((Job) this).isHoldOffBuildUntilSave()) {
return false;
}
// If parent is disabled, child jobs (e.g., branch jobs) should not be buildable
ItemGroup<? extends Item> parentGroup = ((Job) this).getParent();
if (parentGroup instanceof BuildableItem bi) {

Check warning on line 573 in core/src/main/java/jenkins/model/ParameterizedJobMixIn.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 573 is only partially covered, one branch is missing
return bi.isBuildable();

Check warning on line 574 in core/src/main/java/jenkins/model/ParameterizedJobMixIn.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 574 is not covered by tests
}
return true;
}

@Extension
Expand Down
Loading