Package io.jenkins.plugins.explain_error
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
Global configuration for the plugin.
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.SelfNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.Descriptor
clazz -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoCheckAutoExplainMaxPerHour(int value) doCheckLogPattern(String value) doCheckMaxProviderCallsPerWindow(int value) doCheckRedactionPatterns(String value) static GlobalConfigurationImplget()Get the singleton instance of GlobalConfigurationImpl.intintMaximum number of AI provider calls made for automatic explanations per hour.The regular expression that narrows the log lines sent down to those it matches, for every explanation whoseexplainError()step sets no pattern of its own: automatic ones, and those asked for on the console or Stages page.intgetModel()Get the raw configured model without defaults, used for validation.Regular expressions of the administrator's own, one per line, whose matches are masked in what is sent to the AI provider.booleanWhether nothing is sent when something was masked, instead of sending what is left.booleanbooleanbooleanbooleanWhether the built-in rules mask secrets (tokens, keys, passwords) in what is sent to the AI provider.voidsetAiProvider(BaseAIProvider aiProvider) voidvoidvoidsetAutoExplainMaxLogLines(int autoExplainMaxLogLines) voidsetAutoExplainMaxPerHour(int autoExplainMaxPerHour) voidsetBlockWhenRedacted(boolean blockWhenRedacted) voidsetCustomContext(String customContext) voidsetEnableAutoExplainOnFailure(boolean enableAutoExplainOnFailure) voidsetEnableExplanation(boolean enableExplanation) voidsetEnableQuota(boolean enableQuota) voidsetLanguage(String language) voidsetLogPattern(String logPattern) voidsetMaxProviderCallsPerWindow(int maxProviderCallsPerWindow) voidvoidsetProvider(AIProvider provider) voidsetQuotaWindow(QuotaWindow quotaWindow) voidsetRedactionPatterns(String redactionPatterns) voidsetRedactSecrets(boolean redactSecrets) voidsetTemperature(Double temperature) booleanAttempts to acquire a quota slot for a real AI provider call.Methods inherited from class jenkins.model.GlobalConfiguration
all, configure, configure, getDescriptor, getGlobalConfigPageMethods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
GlobalConfigurationImpl
public GlobalConfigurationImpl()
-
-
Method Details
-
get
Get the singleton instance of GlobalConfigurationImpl.- Returns:
- the GlobalConfigurationImpl instance
-
readResolve
-
getAiProvider
-
setAiProvider
-
getApiKey
-
setApiKey
-
getProvider
-
setProvider
-
getApiUrl
-
setApiUrl
-
getModel
-
getRawModel
Get the raw configured model without defaults, used for validation. -
setModel
-
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
The regular expression that narrows the log lines sent down to those it matches, for every explanation whoseexplainError()step sets no pattern of its own: automatic ones, and those asked for on the console or Stages page.nullsends the last lines as they are. -
setLogPattern
-
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 ownpatternsapply either way. -
setRedactSecrets
@DataBoundSetter public void setRedactSecrets(boolean redactSecrets) -
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 namedsecretmasks that group only. Blank lines and lines starting with#are left out. -
setRedactionPatterns
-
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
-
setCustomContext
-
getLanguage
-
setLanguage
-
getTemperature
-
setTemperature
-
isEnableQuota
public boolean isEnableQuota() -
setEnableQuota
@DataBoundSetter public void setEnableQuota(boolean enableQuota) -
getQuotaWindow
-
setQuotaWindow
-
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:
trueif the call is allowed (quota disabled, or within the limit);falseif the quota is enabled and has been exceeded
-
doFillQuotaWindowItems
-
doCheckLogPattern
-
doCheckRedactionPatterns
-
doCheckAutoExplainMaxPerHour
-
doCheckMaxProviderCallsPerWindow
-
getDisplayName
- Overrides:
getDisplayNamein classDescriptor<GlobalConfiguration>
-