fix(cloudwatch-mcp-server): make storedBytes optional in LogGroupMetadata#2872
Open
mtmtcode wants to merge 3 commits intoawslabs:mainfrom
Open
fix(cloudwatch-mcp-server): make storedBytes optional in LogGroupMetadata#2872mtmtcode wants to merge 3 commits intoawslabs:mainfrom
mtmtcode wants to merge 3 commits intoawslabs:mainfrom
Conversation
…data AWS DescribeLogGroups API may not return storedBytes for log groups where storage size has not been calculated yet. This caused a Pydantic validation error, breaking the entire describe_log_groups tool response. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verify LogGroupMetadata handles missing and present storedBytes correctly, matching the AWS DescribeLogGroups API behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2872 +/- ##
=======================================
Coverage 91.37% 91.37%
=======================================
Files 1014 1014
Lines 74946 74946
Branches 12044 12044
=======================================
Hits 68484 68484
Misses 3990 3990
Partials 2472 2472 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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.
Summary
storedBytesfield optional inLogGroupMetadatamodel to match AWS API behaviorDescribeLogGroupsAPI may omitstoredBytesfor log groups where storage size has not been calculated yetField required [type=missing]), breaking the entiredescribe_log_groupstool responseChanges
src/cloudwatch-mcp-server/awslabs/cloudwatch_mcp_server/cloudwatch_logs/models.py: ChangedstoredBytes: int = Field(...)tostoredBytes: Optional[int] = Field(default=None, ...), consistent with other optional fields likeretentionInDaysandkmsKeyIdin the same modeltests/cloudwatch_logs/test_logs_models.py: Added tests verifyingLogGroupMetadatahandles both missing and presentstoredBytesChecklist
Test plan
storedBytesdefaults toNonewhen omittedstoredBytesis correctly set when providedAcknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.