Default global AI provider to OpenAI#137
Merged
shenxianpeng merged 2 commits intojenkinsci:mainfrom Apr 8, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the plugin’s global configuration behave as documented by ensuring an OpenAI provider is used by default when no AI provider has been configured yet, and adds regression tests to keep backend behavior and the Jenkins “Configure System” UI in sync.
Changes:
- Default
GlobalConfigurationImplto anOpenAIProviderwhenaiProvideris unset. - Introduce
OpenAIProvider.DEFAULT_MODELand use it as the OpenAI default model source of truth. - Add regression tests for backend defaulting and UI default provider selection.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/main/java/io/jenkins/plugins/explain_error/GlobalConfigurationImpl.java |
Implements defaulting logic for aiProvider in readResolve() when unconfigured. |
src/main/java/io/jenkins/plugins/explain_error/provider/OpenAIProvider.java |
Centralizes the default model into a constant and reuses it in the descriptor. |
src/test/java/io/jenkins/plugins/explain_error/GlobalConfigurationImplTest.java |
Adds backend + UI regression tests to verify OpenAI is the default when unconfigured. |
src/main/java/io/jenkins/plugins/explain_error/GlobalConfigurationImpl.java
Outdated
Show resolved
Hide resolved
src/test/java/io/jenkins/plugins/explain_error/GlobalConfigurationImplTest.java
Show resolved
Hide resolved
shenxianpeng
approved these changes
Apr 8, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aligns the implementation with the documented behavior by making OpenAI the default global AI provider when no provider has been configured yet.
It also adds regression coverage to ensure both the backend default and the Jenkins configuration UI stay consistent.
The README says OpenAI is the default AI provider.
Before this change, the code had no real default provider and could end up with no provider configured.
With this fix, runtime behavior and the configuration UI now match the documented expectation.
before:

after:

Testing done
Submitter checklist