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/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class jenkins.scm.api.SCMNavigator
PRONOUN
-
Constructor Summary
ConstructorDescriptionGitHubSCMNavigator
(String repoOwner) Constructor.GitHubSCMNavigator
(String apiUri, String repoOwner, String scanCredentialsId, String checkoutCredentialsId) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterSave
(jenkins.scm.api.SCMNavigatorOwner owner) Gets the API endpoint for the GitHub server.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.Deprecated.useSSHCheckoutTrait
Gets theIdCredentials.getId()
of the credentials to use when accessingapiUri
(and also the default credentials to use for checking out).Deprecated.useWildcardSCMHeadFilterTrait
.Deprecated.useWildcardSCMHeadFilterTrait
.Deprecated.useRegexSCMSourceFilterTrait
Gets the name of the owner who's repositories will be navigated.Deprecated.usegetCredentialsId()
.List<jenkins.scm.api.trait.SCMTrait<? extends jenkins.scm.api.trait.SCMTrait<?>>>
Gets the behavioural traits that are applied to this navigator and anyGitHubSCMSource
instances it discovers.protected String
id()
static void
boolean
Return if the avatar retrieval is enabled.retrieveActions
(jenkins.scm.api.SCMNavigatorOwner owner, jenkins.scm.api.SCMNavigatorEvent event, TaskListener listener) void
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
setEnableAvatar
(boolean enableAvatar) Enable retrieval of the organization avatar.void
setExcludes
(String excludes) Deprecated.useWildcardSCMHeadFilterTrait
.void
setIncludes
(String includes) Deprecated.useWildcardSCMHeadFilterTrait
.void
setPattern
(String pattern) Deprecated.useRegexSCMSourceFilterTrait
void
setScanCredentialsId
(String scanCredentialsId) Deprecated.void
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) Methods inherited from class jenkins.scm.api.SCMNavigator
checkInterrupt, defaultListener, fetchActions, getCategories, getDescriptor, getId, getPronoun, isCategoryEnabled, resetId, visitSources, visitSources
-
Constructor Details
-
GitHubSCMNavigator
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 Details
-
getApiUri
Gets the API endpoint for the GitHub server.- Returns:
- the API endpoint for the GitHub server.
-
setApiUri
Sets the API endpoint for the GitHub server.- Parameters:
apiUri
- the API endpoint for the GitHub server.- Since:
- 2.2.0
-
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
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
-
isEnableAvatar
@NonNull public boolean isEnableAvatar()Return if the avatar retrieval is enabled.- Returns:
- true is enabled, false otherwise
-
setEnableAvatar
@DataBoundSetter public void setEnableAvatar(boolean enableAvatar) Enable retrieval of the organization avatar.- Parameters:
enableAvatar
- true to enable, false to disable
-
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
- 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
-
invalidatePrivateModeCache
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Initializer(after=JOB_CONFIG_ADAPTED) public static void invalidatePrivateModeCache()
-
GitHubSCMNavigator(String)
,setApiUri(String)
,setCredentialsId(String)
andSSHCheckoutTrait