Class AutoFixOrchestrator

java.lang.Object
io.jenkins.plugins.explain_error.autofix.AutoFixOrchestrator

public class AutoFixOrchestrator extends Object
Main coordinator for the AI auto-fix workflow.

Asks the configured AI provider for a fix suggestion, validates all file paths and diffs, applies changes to a new branch via the SCM API, and opens a pull request.

  • Constructor Details

    • AutoFixOrchestrator

      public AutoFixOrchestrator()
  • Method Details

    • attemptAutoFix

      public AutoFixResult attemptAutoFix(Run<?,?> run, String errorLogs, BaseAIProvider aiProvider, String credentialsId, String remoteUrl, String scmTypeOverride, String githubEnterpriseUrl, String gitlabUrl, String bitbucketUrl, List<String> allowedPathGlobs, boolean draftPr, int timeoutSeconds, TaskListener listener, String prTemplate)
      Attempts to automatically fix the build failure described by errorLogs.
      Parameters:
      run - the failing build run
      errorLogs - the error logs to analyse
      aiProvider - the configured AI provider
      credentialsId - Jenkins credentials ID for SCM token (StringCredentials)
      remoteUrl - explicit SCM remote URL; if null or blank, extracted from the job's SCM config
      scmTypeOverride - optional override for SCM type detection ("github"/"gitlab"/"bitbucket")
      githubEnterpriseUrl - optional GitHub Enterprise API base URL (e.g. https://ghe.example.com)
      gitlabUrl - optional self-hosted GitLab base URL
      bitbucketUrl - optional self-hosted Bitbucket base URL
      allowedPathGlobs - list of glob patterns that restrict which files may be changed
      draftPr - whether to open a draft PR
      timeoutSeconds - overall timeout in seconds
      listener - task listener for build-log output
      Returns:
      the result of the auto-fix attempt