Class GitHubSCMNavigator
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<jenkins.scm.api.SCMNavigator>
-
- jenkins.scm.api.SCMNavigator
-
- org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<jenkins.scm.api.SCMNavigator>
public class GitHubSCMNavigator extends jenkins.scm.api.SCMNavigator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GitHubSCMNavigator.DescriptorImpl
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description GitHubSCMNavigator(String repoOwner)
Constructor.GitHubSCMNavigator(String apiUri, String repoOwner, String scanCredentialsId, String checkoutCredentialsId)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
afterSave(jenkins.scm.api.SCMNavigatorOwner owner)
String
getApiUri()
Gets the API endpoint for the GitHub server.boolean
getBuildForkPRHead()
Deprecated.boolean
getBuildForkPRMerge()
Deprecated.boolean
getBuildOriginBranch()
Deprecated.boolean
getBuildOriginBranchWithPR()
Deprecated.boolean
getBuildOriginPRHead()
Deprecated.boolean
getBuildOriginPRMerge()
Deprecated.String
getCheckoutCredentialsId()
Deprecated.useSSHCheckoutTrait
String
getCredentialsId()
Gets theIdCredentials.getId()
of the credentials to use when accessingapiUri
(and also the default credentials to use for checking out).String
getExcludes()
Deprecated.useWildcardSCMHeadFilterTrait
.String
getIncludes()
Deprecated.useWildcardSCMHeadFilterTrait
.String
getPattern()
Deprecated.useRegexSCMSourceFilterTrait
String
getRepoOwner()
Gets the name of the owner who's repositories will be navigated.String
getScanCredentialsId()
Deprecated.usegetCredentialsId()
.List<jenkins.scm.api.trait.SCMTrait<? extends jenkins.scm.api.trait.SCMTrait<?>>>
getTraits()
Gets the behavioural traits that are applied to this navigator and anyGitHubSCMSource
instances it discovers.protected String
id()
static void
invalidatePrivateModeCache()
List<Action>
retrieveActions(jenkins.scm.api.SCMNavigatorOwner owner, jenkins.scm.api.SCMNavigatorEvent event, TaskListener listener)
void
setApiUri(String apiUri)
Sets the API endpoint for the GitHub server.void
setBuildForkPRHead(boolean buildForkPRHead)
Deprecated.void
setBuildForkPRMerge(boolean buildForkPRMerge)
Deprecated.void
setBuildOriginBranch(boolean buildOriginBranch)
Deprecated.void
setBuildOriginBranchWithPR(boolean buildOriginBranchWithPR)
Deprecated.void
setBuildOriginPRHead(boolean buildOriginPRHead)
Deprecated.void
setBuildOriginPRMerge(boolean buildOriginPRMerge)
Deprecated.void
setCredentialsId(String credentialsId)
Sets theIdCredentials.getId()
of the credentials to use when accessingapiUri
(and also the default credentials to use for checking out).void
setExcludes(String excludes)
Deprecated.useWildcardSCMHeadFilterTrait
.void
setIncludes(String includes)
Deprecated.useWildcardSCMHeadFilterTrait
.void
setPattern(String pattern)
Deprecated.useRegexSCMSourceFilterTrait
void
setScanCredentialsId(String scanCredentialsId)
Deprecated.void
setTraits(List<jenkins.scm.api.trait.SCMTrait<? extends jenkins.scm.api.trait.SCMTrait<?>>> traits)
Sets the behavioural traits that are applied to this navigator and anyGitHubSCMSource
instances it discovers.void
setTraits(jenkins.scm.api.trait.SCMTrait[] traits)
Sets the behavioural traits that are applied to this navigator and anyGitHubSCMSource
instances it discovers.void
visitSource(String sourceName, jenkins.scm.api.SCMSourceObserver observer)
void
visitSources(jenkins.scm.api.SCMSourceObserver observer)
-
-
-
Constructor Detail
-
GitHubSCMNavigator
@DataBoundConstructor public GitHubSCMNavigator(String repoOwner)
Constructor.- Parameters:
repoOwner
- the owner of the repositories to navigate.- Since:
- 2.2.0
-
GitHubSCMNavigator
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public GitHubSCMNavigator(String apiUri, String repoOwner, String scanCredentialsId, String checkoutCredentialsId)
Deprecated.Legacy constructor.- Parameters:
apiUri
- the API endpoint for the GitHub server.repoOwner
- the owner of the repositories to navigate.scanCredentialsId
- the credentials to use when accessingapiUri
(and also the default credentials to use for checking out).checkoutCredentialsId
- the credentials to use when checking out.
-
-
Method Detail
-
getApiUri
@CheckForNull public String getApiUri()
Gets the API endpoint for the GitHub server.- Returns:
- the API endpoint for the GitHub server.
-
setApiUri
@DataBoundSetter public void setApiUri(String apiUri)
Sets the API endpoint for the GitHub server.- Parameters:
apiUri
- the API endpoint for the GitHub server.- Since:
- 2.2.0
-
getCredentialsId
@CheckForNull public String getCredentialsId()
Gets theIdCredentials.getId()
of the credentials to use when accessingapiUri
(and also the default credentials to use for checking out).- Returns:
- the
IdCredentials.getId()
of the credentials to use when accessingapiUri
(and also the default credentials to use for checking out). - Since:
- 2.2.0
-
setCredentialsId
@DataBoundSetter public void setCredentialsId(@CheckForNull String credentialsId)
Sets theIdCredentials.getId()
of the credentials to use when accessingapiUri
(and also the default credentials to use for checking out).- Parameters:
credentialsId
- theIdCredentials.getId()
of the credentials to use when accessingapiUri
(and also the default credentials to use for checking out).- Since:
- 2.2.0
-
getRepoOwner
@NonNull public String getRepoOwner()
Gets the name of the owner who's repositories will be navigated.- Returns:
- the name of the owner who's repositories will be navigated.
-
getTraits
@NonNull public List<jenkins.scm.api.trait.SCMTrait<? extends jenkins.scm.api.trait.SCMTrait<?>>> getTraits()
Gets the behavioural traits that are applied to this navigator and anyGitHubSCMSource
instances it discovers.- Overrides:
getTraits
in classjenkins.scm.api.SCMNavigator
- Returns:
- the behavioural traits.
-
setTraits
@DataBoundSetter public void setTraits(@CheckForNull jenkins.scm.api.trait.SCMTrait[] traits)
Sets the behavioural traits that are applied to this navigator and anyGitHubSCMSource
instances it discovers. The new traits will take affect on the next navigation through any of thevisitSources(SCMSourceObserver)
overloads orvisitSource(String, SCMSourceObserver)
.- Parameters:
traits
- the new behavioural traits.
-
setTraits
public void setTraits(@CheckForNull List<jenkins.scm.api.trait.SCMTrait<? extends jenkins.scm.api.trait.SCMTrait<?>>> traits)
Sets the behavioural traits that are applied to this navigator and anyGitHubSCMSource
instances it discovers. The new traits will take affect on the next navigation through any of thevisitSources(SCMSourceObserver)
overloads orvisitSource(String, SCMSourceObserver)
.- Overrides:
setTraits
in classjenkins.scm.api.SCMNavigator
- Parameters:
traits
- the new behavioural traits.
-
getScanCredentialsId
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @CheckForNull public String getScanCredentialsId()
Deprecated.usegetCredentialsId()
.Legacy getter.- Returns:
getCredentialsId()
.
-
setScanCredentialsId
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setScanCredentialsId(@CheckForNull String scanCredentialsId)
Deprecated.Legacy setter.- Parameters:
scanCredentialsId
- the credentials.
-
getIncludes
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @NonNull public String getIncludes()
Deprecated.useWildcardSCMHeadFilterTrait
.Legacy getter.- Returns:
WildcardSCMHeadFilterTrait.getIncludes()
-
getExcludes
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @NonNull public String getExcludes()
Deprecated.useWildcardSCMHeadFilterTrait
.Legacy getter.- Returns:
WildcardSCMHeadFilterTrait.getExcludes()
-
setIncludes
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setIncludes(@NonNull String includes)
Deprecated.useWildcardSCMHeadFilterTrait
.Legacy setter.- Parameters:
includes
- seeWildcardSCMHeadFilterTrait(String, String)
-
setExcludes
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setExcludes(@NonNull String excludes)
Deprecated.useWildcardSCMHeadFilterTrait
.Legacy setter.- Parameters:
excludes
- seeWildcardSCMHeadFilterTrait(String, String)
-
getBuildOriginBranch
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public boolean getBuildOriginBranch()
Deprecated.Legacy getter.- Returns:
BranchDiscoveryTrait.isBuildBranch()
.
-
setBuildOriginBranch
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setBuildOriginBranch(boolean buildOriginBranch)
Deprecated.Legacy setter.- Parameters:
buildOriginBranch
- seeBranchDiscoveryTrait(boolean, boolean)
.
-
getBuildOriginBranchWithPR
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public boolean getBuildOriginBranchWithPR()
Deprecated.Legacy getter.
-
setBuildOriginBranchWithPR
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setBuildOriginBranchWithPR(boolean buildOriginBranchWithPR)
Deprecated.Legacy setter.- Parameters:
buildOriginBranchWithPR
- seeBranchDiscoveryTrait(boolean, boolean)
.
-
getBuildOriginPRMerge
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public boolean getBuildOriginPRMerge()
Deprecated.Legacy getter.
-
setBuildOriginPRMerge
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setBuildOriginPRMerge(boolean buildOriginPRMerge)
Deprecated.Legacy setter.- Parameters:
buildOriginPRMerge
- seeOriginPullRequestDiscoveryTrait(Set)
.
-
getBuildOriginPRHead
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public boolean getBuildOriginPRHead()
Deprecated.Legacy getter.
-
setBuildOriginPRHead
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setBuildOriginPRHead(boolean buildOriginPRHead)
Deprecated.Legacy setter.- Parameters:
buildOriginPRHead
- seeOriginPullRequestDiscoveryTrait(Set)
.
-
getBuildForkPRMerge
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public boolean getBuildForkPRMerge()
Deprecated.Legacy getter.
-
setBuildForkPRMerge
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setBuildForkPRMerge(boolean buildForkPRMerge)
Deprecated.Legacy setter.- Parameters:
buildForkPRMerge
- seeForkPullRequestDiscoveryTrait(Set, SCMHeadAuthority)
.
-
getBuildForkPRHead
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public boolean getBuildForkPRHead()
Deprecated.Legacy getter.
-
setBuildForkPRHead
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setBuildForkPRHead(boolean buildForkPRHead)
Deprecated.Legacy setter.- Parameters:
buildForkPRHead
- seeForkPullRequestDiscoveryTrait(Set, SCMHeadAuthority)
.
-
getCheckoutCredentialsId
@CheckForNull @Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public String getCheckoutCredentialsId()
Deprecated.useSSHCheckoutTrait
Legacy getter.- Returns:
SSHCheckoutTrait.getCredentialsId()
with some mangling to preserve legacy behaviour.
-
getPattern
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public String getPattern()
Deprecated.useRegexSCMSourceFilterTrait
Legacy getter.- Returns:
RegexSCMSourceFilterTrait.getRegex()
.
-
setPattern
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setPattern(String pattern)
Deprecated.useRegexSCMSourceFilterTrait
Legacy setter.- Parameters:
pattern
- seeRegexSCMSourceFilterTrait(String)
.
-
id
@NonNull protected String id()
- Specified by:
id
in classjenkins.scm.api.SCMNavigator
-
visitSources
public void visitSources(jenkins.scm.api.SCMSourceObserver observer) throws IOException, InterruptedException
- Specified by:
visitSources
in classjenkins.scm.api.SCMNavigator
- Throws:
IOException
InterruptedException
-
visitSource
public void visitSource(String sourceName, jenkins.scm.api.SCMSourceObserver observer) throws IOException, InterruptedException
- Overrides:
visitSource
in classjenkins.scm.api.SCMNavigator
- Throws:
IOException
InterruptedException
-
retrieveActions
@NonNull public List<Action> retrieveActions(@NonNull jenkins.scm.api.SCMNavigatorOwner owner, @CheckForNull jenkins.scm.api.SCMNavigatorEvent event, @NonNull TaskListener listener) throws IOException, InterruptedException
- Overrides:
retrieveActions
in classjenkins.scm.api.SCMNavigator
- Throws:
IOException
InterruptedException
-
invalidatePrivateModeCache
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Initializer(after=JOB_CONFIG_ADAPTED) public static void invalidatePrivateModeCache()
-
afterSave
public void afterSave(@NonNull jenkins.scm.api.SCMNavigatorOwner owner)
- Overrides:
afterSave
in classjenkins.scm.api.SCMNavigator
-
-