DEV: Add hidden s3_inventory_bucket_region site setting (#27786)

This commit adds a hidden `s3_inventory_bucket_region` site setting to
specify the region of the `s3_inventory_bucket` when the `S3Inventory`
class initializes an instance of the `S3Helper`. By default, the
`S3Helper` class uses the value of the `s3_region` site setting but the
region of the `s3_inventory_bucket` is not always the same as the
`s3_region` configured.
This commit is contained in:
Alan Guo Xiang Tan
2024-07-09 12:03:43 +08:00
committed by GitHub
parent 7111d5e4bf
commit 86e5f46175
4 changed files with 28 additions and 3 deletions

View File

@ -18,6 +18,21 @@ RSpec.describe S3Inventory do
expect(output).to eq("Failed to list inventory from S3\n")
end
it "should forward custom s3 options to the S3Helper when initializing" do
inventory =
S3Inventory.new(
:upload,
s3_inventory_bucket: "some-inventory-bucket",
s3_options: {
region: "us-west-1",
},
)
inventory.s3_helper.stub_client_responses!
expect(inventory.s3_helper.s3_client.config.region).to eq("us-west-1")
end
describe "verifying uploads" do
before do
freeze_time