Skip to content
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

Fix NOTEs on BucketReplicationConfigRules #5112

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

guineveresaenger
Copy link
Contributor

While this fix is not the complete underlying docsgen fix that would fix related issues, it will resolve the specific instance of difficulties experienced due to missing NOTEs on Rule.:wq

Fixes #4921.

  • Fix up Bucket Replication Config with missing note
  • build schema and SDKs

Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Maintainer note: consult the runbook for dealing with any breaking changes.

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 24.47%. Comparing base (63c9fbf) to head (3e2db58).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5112   +/-   ##
=======================================
  Coverage   24.46%   24.47%           
=======================================
  Files         361      361           
  Lines      144037   144065   +28     
=======================================
+ Hits        35243    35260   +17     
- Misses     108696   108707   +11     
  Partials       98       98           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@guineveresaenger guineveresaenger requested a review from a team January 17, 2025 17:16
Copy link
Member

@iwahbe iwahbe left a comment

Choose a reason for hiding this comment

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

One nit, otherwise this looks good.

@@ -351282,7 +351282,7 @@
"items": {
"$ref": "#/types/aws:s3/BucketReplicationConfigRule:BucketReplicationConfigRule"
},
"description": "List of configuration blocks describing the rules managing the replication. See below.\n"
"description": "List of configuration blocks describing the rules managing the replication. See below.\n\u003e **NOTE:** Replication to multiple destination buckets requires that `priority` is specified in the `rule` object. If the corresponding rule requires no filter, an empty configuration block `filter {}` must be specified.\n\n\u003e **NOTE:** Amazon S3's latest version of the replication configuration is V2, which includes the `filter` attribute for replication rules.\n\n\u003e **NOTE:** The `existing_object_replication` parameter is not supported by Amazon S3 at this time and should not be included in your `rule` configurations. Specifying this parameter will result in `MalformedXML` errors.\nTo replicate existing objects, please refer to the [Replicating existing objects with S3 Batch Replication](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-batch-replication-batch.html) documentation in the Amazon S3 User Guide.\n"
Copy link
Member

Choose a reason for hiding this comment

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

We should probably use TypeScript notation here, not HCL.

Suggested change
"description": "List of configuration blocks describing the rules managing the replication. See below.\n\u003e **NOTE:** Replication to multiple destination buckets requires that `priority` is specified in the `rule` object. If the corresponding rule requires no filter, an empty configuration block `filter {}` must be specified.\n\n\u003e **NOTE:** Amazon S3's latest version of the replication configuration is V2, which includes the `filter` attribute for replication rules.\n\n\u003e **NOTE:** The `existing_object_replication` parameter is not supported by Amazon S3 at this time and should not be included in your `rule` configurations. Specifying this parameter will result in `MalformedXML` errors.\nTo replicate existing objects, please refer to the [Replicating existing objects with S3 Batch Replication](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-batch-replication-batch.html) documentation in the Amazon S3 User Guide.\n"
"description": "List of configuration blocks describing the rules managing the replication. See below.\n\u003e **NOTE:** Replication to multiple destination buckets requires that `priority` is specified in the `rule` object. If the corresponding rule requires no filter, an empty configuration block `filter: {}` must be specified.\n\n\u003e **NOTE:** Amazon S3's latest version of the replication configuration is V2, which includes the `filter` attribute for replication rules.\n\n\u003e **NOTE:** The `existingObjectReplication` parameter is not supported by Amazon S3 at this time and should not be included in your `rule` configurations. Specifying this parameter will result in `MalformedXML` errors.\nTo replicate existing objects, please refer to the [Replicating existing objects with S3 Batch Replication](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-batch-replication-batch.html) documentation in the Amazon S3 User Guide.\n"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice catch! ty!

@@ -134,6 +135,24 @@ var fixUpEcsServiceNameForceNewDeployment = targetedSimpleReplace(
"(e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy "+
"`ordered_placement_strategy` and `placement_constraints` updates.\n"+
"When using the forceNewDeployment property you also need to configure the triggers property.\n")
var fixUpBucketReplicationConfig = targetedSimpleReplace(
"s3_bucket_replication_configuration.html.markdown",
Copy link
Member

Choose a reason for hiding this comment

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

Could we put a check in (a test) that ensures this content is matching upstream, if not take from upstream content directly? This way if upstream edits it away we'll remember to update the copy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have hard failure patterns during make schema; I'm happy to add those. we should add them for the other fixes as well. It may be noisy during upgrades; that's the tradeoff. I think you're right to request this though.

Copy link
Member

Choose a reason for hiding this comment

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

Not sure what the "hard failure patterns" are but appreciated - the change looks like we add content we own where in fact this is a workaround to propagate upstream content, this postpones the issue of possible discrepancies to the future, and I must assume this page is high visibility since we are attempting to patch it. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added a new function that follows the suggested pattern.

I'm going to follow up with a PR that addresses this for other large replaces.

return tfbridge.DocsEdit{
Path: filePath,
Edit: func(_ string, content []byte) ([]byte, error) {
if bytes.Contains(content, fromBytes) {
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately this does not ensure that toBytes does not digress, and yet we copied it from the source material. IN this case the toBytes is the bit that contains the notes we're copying.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're totally right. The new check is more specific to the situation and checks that both the added text and the fromBytes have not changed, else it errors.

…elsewhere have not changed, as well as ensure we can properly find the place to add to.
@guineveresaenger guineveresaenger force-pushed the guin/bucketreplicationconfig branch from 7bd3805 to b5f7f48 Compare January 17, 2025 22:51
provider/doc_edits.go Outdated Show resolved Hide resolved
@guineveresaenger guineveresaenger enabled auto-merge (squash) January 21, 2025 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing important upstream documentation related to BucketReplicationConfig
3 participants