Implement getBuildArtifacts tool and optimize getBuild response #42
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 implements issue #32 by adding new tools for artifact management and optimizing the getBuild response size.
New Tools Added
getBuildArtifacts - Returns only the artifacts array from a build
o Takes jobFullName and optional buildNumber parameters
o Significantly reduces payload size compared to full getBuild response
o Returns empty array for jobs without artifacts or non-existent jobs
o Fixed JSON concatenation issue for top-level lists
getBuildArtifact - Provides paginated access to individual artifact file contents
o Supports offset/limit parameters for large files
o Returns artifact content as text with pagination metadata
o Includes safety limits to prevent excessive memory usage
Optimizations
o Created RunWithoutArtifactsSerializer to filter out artifacts
o Updated JenkinsExportedBeanSerializerModifier to use custom serializer
o Maintains all other build information while reducing response size
Testing done
Comprehensive test coverage
o BuildArtifactsExtensionTest - Integration tests for new tools
o GetBuildWithoutArtifactsTest - Verifies getBuild optimization
o BuildArtifactsExtensionCompileTest - Basic compilation verification
Manual test
o Augment Code MCP client w/
mvn hpi:run
- Found JSON issue with top-level listo Manual test with Augment Code and production Jenkins server
Submitter checklist