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 Details

    • AbstractGitStepHandler

      public AbstractGitStepHandler()
  • Method Details

    • 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. User createSpanBuilder(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