Class GlobalConfigurationImpl

java.lang.Object
hudson.model.Descriptor<GlobalConfiguration>
jenkins.model.GlobalConfiguration
io.jenkins.plugins.explain_error.GlobalConfigurationImpl
All Implemented Interfaces:
ExtensionPoint, Describable<GlobalConfiguration>, Saveable, Loadable, OnMaster

@Extension @Symbol("explainError") public class GlobalConfigurationImpl extends GlobalConfiguration
Global configuration for the plugin.
  • Constructor Details

    • GlobalConfigurationImpl

      public GlobalConfigurationImpl()
  • Method Details

    • get

      public static GlobalConfigurationImpl get()
      Get the singleton instance of GlobalConfigurationImpl.
      Returns:
      the GlobalConfigurationImpl instance
    • readResolve

      public Object readResolve()
    • getAiProvider

      public BaseAIProvider getAiProvider()
    • setAiProvider

      public void setAiProvider(BaseAIProvider aiProvider)
    • getApiKey

      public Secret getApiKey()
    • setApiKey

      @DataBoundSetter public void setApiKey(Secret apiKey)
    • getProvider

      public AIProvider getProvider()
    • setProvider

      @DataBoundSetter public void setProvider(AIProvider provider)
    • getApiUrl

      public String getApiUrl()
    • setApiUrl

      @DataBoundSetter public void setApiUrl(String apiUrl)
    • getModel

      public String getModel()
    • getRawModel

      public String getRawModel()
      Get the raw configured model without defaults, used for validation.
    • setModel

      @DataBoundSetter public void setModel(String model)
    • isEnableExplanation

      public boolean isEnableExplanation()
    • setEnableExplanation

      @DataBoundSetter public void setEnableExplanation(boolean enableExplanation)
    • isEnableAutoExplainOnFailure

      public boolean isEnableAutoExplainOnFailure()
    • setEnableAutoExplainOnFailure

      @DataBoundSetter public void setEnableAutoExplainOnFailure(boolean enableAutoExplainOnFailure)
    • getAutoExplainMaxLogLines

      public int getAutoExplainMaxLogLines()
    • setAutoExplainMaxLogLines

      @DataBoundSetter public void setAutoExplainMaxLogLines(int autoExplainMaxLogLines)
    • getLogPattern

      @CheckForNull public String getLogPattern()
      The regular expression that narrows the log lines sent down to those it matches, for every explanation whose explainError() step sets no pattern of its own: automatic ones, and those asked for on the console or Stages page. null sends the last lines as they are.
    • setLogPattern

      @DataBoundSetter public void setLogPattern(@CheckForNull String logPattern)
    • isRedactSecrets

      public boolean isRedactSecrets()
      Whether the built-in rules mask secrets (tokens, keys, passwords) in what is sent to the AI provider. On by default; the administrator's own patterns apply either way.
    • setRedactSecrets

      @DataBoundSetter public void setRedactSecrets(boolean redactSecrets)
    • getRedactionPatterns

      @CheckForNull public String getRedactionPatterns()
      Regular expressions of the administrator's own, one per line, whose matches are masked in what is sent to the AI provider. A pattern with a group named secret masks that group only. Blank lines and lines starting with # are left out.
    • setRedactionPatterns

      @DataBoundSetter public void setRedactionPatterns(@CheckForNull String redactionPatterns)
    • isBlockWhenRedacted

      public boolean isBlockWhenRedacted()
      Whether nothing is sent when something was masked, instead of sending what is left. For those who would rather go without an explanation than trust the masking.
    • setBlockWhenRedacted

      @DataBoundSetter public void setBlockWhenRedacted(boolean blockWhenRedacted)
    • getAutoExplainMaxPerHour

      public int getAutoExplainMaxPerHour()
      Maximum number of AI provider calls made for automatic explanations per hour. A failed build that was counted but never reached the provider gives its slot back.
    • setAutoExplainMaxPerHour

      @DataBoundSetter public void setAutoExplainMaxPerHour(int autoExplainMaxPerHour)
    • getCustomContext

      public String getCustomContext()
    • setCustomContext

      @DataBoundSetter public void setCustomContext(String customContext)
    • getLanguage

      public String getLanguage()
    • setLanguage

      @DataBoundSetter public void setLanguage(String language)
    • getTemperature

      public Double getTemperature()
    • setTemperature

      @DataBoundSetter public void setTemperature(Double temperature)
    • isEnableQuota

      public boolean isEnableQuota()
    • setEnableQuota

      @DataBoundSetter public void setEnableQuota(boolean enableQuota)
    • getQuotaWindow

      public QuotaWindow getQuotaWindow()
    • setQuotaWindow

      @DataBoundSetter public void setQuotaWindow(QuotaWindow quotaWindow)
    • getMaxProviderCallsPerWindow

      public int getMaxProviderCallsPerWindow()
    • setMaxProviderCallsPerWindow

      @DataBoundSetter public void setMaxProviderCallsPerWindow(int maxProviderCallsPerWindow)
    • tryAcquireQuota

      public boolean tryAcquireQuota()
      Attempts to acquire a quota slot for a real AI provider call.
      Returns:
      true if the call is allowed (quota disabled, or within the limit); false if the quota is enabled and has been exceeded
    • doFillQuotaWindowItems

      @POST public ListBoxModel doFillQuotaWindowItems()
    • doCheckLogPattern

      @POST public FormValidation doCheckLogPattern(@QueryParameter String value)
    • doCheckRedactionPatterns

      @POST public FormValidation doCheckRedactionPatterns(@QueryParameter String value)
    • doCheckAutoExplainMaxPerHour

      @POST public FormValidation doCheckAutoExplainMaxPerHour(@QueryParameter int value)
    • doCheckMaxProviderCallsPerWindow

      @POST public FormValidation doCheckMaxProviderCallsPerWindow(@QueryParameter int value)
    • getDisplayName

      public String getDisplayName()
      Overrides:
      getDisplayName in class Descriptor<GlobalConfiguration>