Class AbstractGitStepHandler
- java.lang.Object
-
- io.jenkins.plugins.opentelemetry.job.step.AbstractGitStepHandler
-
- All Implemented Interfaces:
StepHandler
,Comparable<StepHandler>
- Direct Known Subclasses:
GitCheckoutStepHandler
,GitStepHandler
public abstract class AbstractGitStepHandler extends Object implements StepHandler
-
-
Constructor Summary
Constructors Constructor Description AbstractGitStepHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.opentelemetry.api.trace.SpanBuilder
createSpanBuilder(String gitUrl, String gitBranch, String credentialsId, String stepFunctionName, io.opentelemetry.api.trace.Tracer tracer, org.jenkinsci.plugins.workflow.job.WorkflowRun run)
See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/rpc.md https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocolsprotected io.opentelemetry.api.trace.SpanBuilder
createSpanBuilderFromGitDetails(String gitUrl, String gitBranch, String gitUserName, String stepFunctionName, io.opentelemetry.api.trace.Tracer tracer)
Visible for testing.protected String
sanitizeUrl(org.eclipse.jgit.transport.URIish gitUri)
Remove the `username` and the `password` params of the URL.String
searchGitUserName(String credentialsId, org.jenkinsci.plugins.workflow.job.WorkflowRun run)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.jenkins.plugins.opentelemetry.job.step.StepHandler
afterSpanCreated, canCreateSpanBuilder, compareTo, createSpanBuilder, ordinal
-
-
-
-
Method Detail
-
searchGitUserName
public String searchGitUserName(@Nullable String credentialsId, @NonNull org.jenkinsci.plugins.workflow.job.WorkflowRun run)
-
createSpanBuilder
@NonNull public io.opentelemetry.api.trace.SpanBuilder createSpanBuilder(@NonNull String gitUrl, @Nullable String gitBranch, @Nullable String credentialsId, @NonNull String stepFunctionName, @NonNull io.opentelemetry.api.trace.Tracer tracer, @NonNull org.jenkinsci.plugins.workflow.job.WorkflowRun run)
See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/rpc.md https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols
-
createSpanBuilderFromGitDetails
protected io.opentelemetry.api.trace.SpanBuilder createSpanBuilderFromGitDetails(@Nullable String gitUrl, @Nullable String gitBranch, @Nullable String gitUserName, @NonNull String stepFunctionName, @NonNull io.opentelemetry.api.trace.Tracer tracer)
Visible for testing. UsercreateSpanBuilder(String, String, String, String, Tracer, WorkflowRun)
instead of this method
-
sanitizeUrl
@NonNull protected String sanitizeUrl(@NonNull org.eclipse.jgit.transport.URIish gitUri)
Remove the `username` and the `password` params of the URL.Example: "https://my_username:my_password@github.com/open-telemetry/opentelemetry-java.git" is sanitized as "https://github.com/open-telemetry/opentelemetry-java.git"
- Parameters:
gitUri
- to sanitize- Returns:
- sanitized url
-
-