Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-38669] (1/3) FlowDefinition.getSCMs #111

Merged
merged 5 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<version>2.16</version>
<version>2.20</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down Expand Up @@ -127,7 +127,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>script-security</artifactId>
<version>1.46</version>
<version>1.62</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -139,7 +139,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>structs</artifactId>
<version>1.17</version>
<version>1.18</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.test</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@
import hudson.model.Action;
import hudson.model.TaskListener;
import hudson.util.LogTaskListener;
import hudson.scm.SCM;

import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
Expand Down Expand Up @@ -76,4 +79,17 @@ public FlowExecution create(FlowExecutionOwner handle, List<? extends Action> ac
return (FlowDefinitionDescriptor) super.getDescriptor();
}

/**
* Returns a list of all {@link SCM SCMs} that are part of the static configuration of the {@link FlowDefinition}.
* Subclasses of {@link FlowDefinition} may override this method to return statically configured SCMs
* that they may be aware of. For example, {@code CpsScmFlowDefinition} returns SCM used to retrieve
* Jenkinsfile.
* Does not include any SCMs used dynamically during Pipeline execution.
* May be empty (or not overridden) if the Pipeline does not include any statically configured SCMs.
* This method is used in {@code WorkflowJob} class which will combine lists of static and dynamic SCMs.
*/
public Collection<? extends SCM> getSCMs() {
jglick marked this conversation as resolved.
Show resolved Hide resolved
return Collections.emptyList();
}

}