-
Notifications
You must be signed in to change notification settings - Fork 872
Generate metrics configuration s3 operations #4090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates S3 Metrics Configuration operations from custom (handwritten) code to generated code. The changes replace manual implementations with code generator templates while preserving custom logic through partial methods and customizations.
Key Changes:
- Moves
PutBucketMetricsConfiguration,GetBucketMetricsConfiguration,ListBucketMetricsConfigurations, andDeleteBucketMetricsConfigurationoperations from custom to generated code - Preserves custom behavior through partial methods for marshalling/unmarshalling
- Updates the code generator to support required field checks and custom XML marshalling injection
- Adds appropriate dev config file for patch-level change
Reviewed Changes
Copilot reviewed 17 out of 38 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sdk/src/Services/S3/Generated/Model/*.cs | Generated request/response model classes for metrics configuration operations |
| sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/*.cs | Generated marshaller/unmarshaller implementations |
| sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/*.cs | Custom partial implementations preserving legacy behavior |
| generator/ServiceModels/s3/s3.customizations.json | Customization configurations for code generation |
| generator/ServiceClientGeneratorLib/*.cs | Generator updates to support new features |
| generator/.DevConfigs/*.json | Dev config for version tracking |
| listMarshallName = overrideDataType.AlternateLocationName; | ||
| } | ||
| else | ||
| if (listMarshallName == null) |
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing from else to if (listMarshallName == null) alters the logic. Previously, the default would only be set when there was no overrideDataType. Now it sets the default whenever listMarshallName is null, even after attempting to get it from overrideDataType.AlternateLocationName. This could cause incorrect marshalling behavior if overrideDataType.AlternateLocationName is explicitly set to null.
| if (listMarshallName == null) | |
| else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 17 out of 38 changed files in this pull request and generated no new comments.
|
Here is the breaking change AI analysis (done internally via cline). What I did: did a Not gonna paste the prompt here b/c it is pretty long but this was the output. The things it listed as "breaking changes" are acceptable (changing from Breaking Changes Analysis Report - CORRECTEDAfter re-analyzing with the understanding that marshallers are split between custom and generated files that work together, I found the following: NO BREAKING CHANGES in Marshaller LogicThe marshaller logic is correctly preserved through the split file pattern: 1. GetBucketMetricsConfigurationRequestMarshaller - ✅ NO ISSUES
2. PutBucketMetricsConfigurationRequestMarshaller - ✅ NO ISSUES
3. PutLifecycleConfigurationRequestMarshaller - ✅ NO ISSUES
BREAKING CHANGES FOUND in Model Classes1. PutBucketMetricsConfigurationRequest.cs -
|
|
I tested For the request, what the AI says is true, an empty string would get past the marshaller but either way an empty continuation token is invalid. |
cec5422 to
cdb5b3e
Compare
|
Updated AI prompt run on latest revision. The added validation isn't a breaking change because the request will fail and throw Now I have all the information needed to provide a comprehensive analysis. Let me compare the deleted custom files with the generated ones and examine all the marshaller changes: Task Completed Breaking Changes Analysis - S3 Custom to Generated MigrationAfter analyzing all deleted custom files, their generated replacements, and modified marshallers, I have identified the following breaking changes: BREAKING CHANGES IDENTIFIED:1. AbortMultipartUploadRequestMarshaller.cs - NEW VALIDATION ADDEDIssue: Added new required field validation that didn't exist before: if (string.IsNullOrEmpty(publicRequest.UploadId))
throw new AmazonS3Exception("Request object does not have required field UploadId set");Impact: Customer code that previously could make AbortMultipartUpload requests without UploadId set will now throw an exception. 2. CopyPartRequestMarshaller.cs - NEW VALIDATIONS ADDEDIssue: Added two new required field validations: if (publicRequest.PartNumber == null)
throw new AmazonS3Exception("Request object does not have required field PartNumber set");
if (string.IsNullOrEmpty(publicRequest.UploadId))
throw new AmazonS3Exception("Request object does not have required field UploadId set");Impact: Customer code that previously could make CopyPart requests without PartNumber or UploadId set will now throw exceptions. 3. ListPartsRequestMarshaller.cs - NEW VALIDATION ADDEDIssue: Added new required field validation: if (string.IsNullOrEmpty(publicRequest.UploadId))
throw new AmazonS3Exception("Request object does not have required field UploadId set");Impact: Customer code that previously could make ListParts requests without UploadId set will now throw an exception. NO BREAKING CHANGES FOUND IN:Model Files Migration (✅ SAFE)
Differences are non-breaking:
Marshaller Logic Preservation (✅ SAFE)
SUMMARY:
The breaking changes are all related to new validation logic being added to existing marshallers rather than logic being lost during migration. These validations enforce that required fields are set before making API calls, which technically makes the SDK more strict than before. |
Description
Generates 4 S3 operations.
Best way to review is by pulling up the custom version of the file on one side and the generated version of the file on the other side and compare. Although, now that we have fuzz testing I feel much more confident about the results.
Motivation and Context
Testing
Dry run passes: DRY_RUN-dc08f946-112a-4d5a-b85a-f33695a422d6
I've reviewed the fuzz-tests results. nothing backwards incompatible
Screenshots (if appropriate)
Types of changes
Checklist
License