Skip to content

Commit

Permalink
Merge pull request #312 from jglick/Queue.id
Browse files Browse the repository at this point in the history
Allow location of `FlowExecutionList.xml` to be overridden
  • Loading branch information
jglick authored Sep 29, 2023
2 parents ca5fddb + 6a19561 commit 99c1093
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import hudson.init.TermMilestone;
import hudson.init.Terminator;
import hudson.model.Computer;
import hudson.model.Queue;
import hudson.model.listeners.ItemListener;
import hudson.remoting.SingleLaneExecutorService;
import hudson.util.CopyOnWriteList;
Expand All @@ -37,6 +38,7 @@
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.util.SystemProperties;
import org.jenkinsci.plugins.workflow.graph.FlowNode;
import org.jenkinsci.plugins.workflow.graphanalysis.LinearBlockHoppingScanner;

Expand Down Expand Up @@ -105,7 +107,14 @@ protected FlowExecution computeNext() {
if (configFile == null) {
Jenkins j = Jenkins.getInstanceOrNull();
if (j != null) {
configFile = new XmlFile(new File(j.getRootDir(), FlowExecutionList.class.getName() + ".xml"));
String id = SystemProperties.getString(Queue.class.getName() + ".id");
File f;
if (id != null) {

Check warning on line 112 in src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionList.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 112 is only partially covered, one branch is missing
f = new File(Jenkins.get().getRootDir(), FlowExecutionList.class.getName() + "/" + id + ".xml");

Check warning on line 113 in src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionList.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 113 is not covered by tests
} else {
f = new File(j.getRootDir(), FlowExecutionList.class.getName() + ".xml");
}
configFile = new XmlFile(f);
}
}
return configFile;
Expand Down

0 comments on commit 99c1093

Please sign in to comment.