Skip to content

feat: add AWS Bedrock provider#95

Merged
shenxianpeng merged 4 commits intojenkinsci:mainfrom
lidiams96:feature/add-bedrock-provider
Feb 17, 2026
Merged

feat: add AWS Bedrock provider#95
shenxianpeng merged 4 commits intojenkinsci:mainfrom
lidiams96:feature/add-bedrock-provider

Conversation

@lidiams96
Copy link
Contributor

Summary

Add AWS Bedrock as a new AI provider, enabling models like Claude 3.5 Sonnet, Llama 3, Amazon Nova, and other Bedrock-supported models.

Motivation

AWS Bedrock is widely used in enterprise environments running Jenkins on AWS infrastructure. Adding Bedrock support allows users to:

  • Use models like Claude 3.5 Sonnet for high-quality error analysis
  • Leverage EU cross-region inference profiles for data residency compliance
  • Authenticate using the default AWS credential chain (instance profiles, environment variables) — no API keys needed

Changes

File Description
pom.xml Added langchain4j-bedrock dependency
BedrockProvider.java Provider implementation with region and model configuration
config.jelly Jenkins UI configuration form with region and model fields
help-region.html Help text for the region field
help-model.html Help text with model ID examples
ProviderTest.java Added validation tests for null/empty model

Configuration

  • Region: AWS region (e.g., eu-west-1, us-east-1). Optional — falls back to default AWS SDK region resolution.
  • Model: Bedrock model ID or inference profile (e.g., eu.anthropic.claude-3-5-sonnet-20240620-v1:0).
  • Authentication: Uses the default AWS credential chain. No API key field needed.

Testing

  • Validation tests for null/empty model added to ProviderTest.java
  • Follows the same pattern as existing Ollama, OpenAI, and Gemini providers

Add support for AWS Bedrock as an AI provider, enabling models like
Claude 3.5 Sonnet, Llama 3, and Amazon Nova.

Uses langchain4j-bedrock module with the default AWS credential chain
(environment variables, instance profile, etc.), making it suitable
for Jenkins instances running on AWS infrastructure.

New files:
- BedrockProvider.java - Provider implementation with region and model config
- config.jelly - UI configuration form
- help-region.html, help-model.html - Field documentation
- Tests for null/empty model validation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lidiams96 lidiams96 requested a review from a team as a code owner February 16, 2026 07:18
- Use var instead of non-existent BedrockChatModelBuilder inner class
- Set temperature via defaultRequestParameters(BedrockChatRequestParameters)
  instead of direct builder method which doesn't exist in langchain4j-bedrock

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@shenxianpeng shenxianpeng requested review from Copilot and removed request for a team February 16, 2026 09:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds AWS Bedrock as a new BaseAIProvider implementation so Jenkins users can run error analysis against Bedrock-hosted models (via the default AWS credential/region resolution chain).

Changes:

  • Introduces BedrockProvider with region + model configuration and a “Test Configuration” UI action.
  • Adds Jenkins UI resources (config + help) for the new provider.
  • Extends provider validation tests and adds the Bedrock LangChain4j dependency.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pom.xml Adds langchain4j-bedrock dependency needed for Bedrock integration.
src/main/java/io/jenkins/plugins/explain_error/provider/BedrockProvider.java Implements the Bedrock-backed provider, including region handling and test endpoint.
src/main/resources/io/jenkins/plugins/explain_error/provider/BedrockProvider/config.jelly Adds Jenkins configuration form fields for region/model and a test button.
src/main/resources/io/jenkins/plugins/explain_error/provider/BedrockProvider/help-region.html Documents how region selection works (including default AWS resolution).
src/main/resources/io/jenkins/plugins/explain_error/provider/BedrockProvider/help-model.html Documents expected model IDs and links to Bedrock model list.
src/test/java/io/jenkins/plugins/explain_error/provider/ProviderTest.java Adds null/empty model validation tests for Bedrock provider.

- Add rel="noopener noreferrer" to external link in help-model.html
  to prevent reverse-tabnabbing
- Configure ResponseFormat.JSON in BedrockChatRequestParameters
  for consistent structured output with other providers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@shenxianpeng
Copy link
Member

@lidiams96 Thanks for the PR. I installed the package and try with AWS Bedrock, does it miss some filed, any idea?

Screenshot 2026-02-16 at 17 24 45

@shenxianpeng shenxianpeng added the enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Feb 16, 2026
@lidiams96
Copy link
Contributor Author

lidiams96 commented Feb 17, 2026

@shenxianpeng Thanks for reporting this. I’ve pushed a fix in a new commit—please try again when you can.

Root cause: the Bedrock provider was setting responseFormat in BedrockChatRequestParameters, which isn’t supported by the Bedrock SDK and caused assistant creation to fail. I removed that parameter and added a small test to cover the configuration. All tests pass on my side.

image

@shenxianpeng
Copy link
Member

Thanks @lidiams96! I don’t have an environment available to test it myself, but based on your testing and the screenshot, it looks good. I’m going to go ahead and merge it

@shenxianpeng shenxianpeng merged commit ce4993e into jenkinsci:main Feb 17, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants