Repository navigation
test: Add required cloud tags to Azure resources in acceptance tests - #4771
marcabreracast wants to merge 3 commits into
Conversation
|
|
||
| // ConfigTags returns the Cloud Tag Policy tags as a resource-level tags attribute. | ||
| // azurerm does not support provider-level default_tags, so Azure resources set tags individually: https://github.com/hashicorp/terraform-provider-azurerm/issues/13776. | ||
| func ConfigTags() string { |
There was a problem hiding this comment.
This is a temporary resolution. Once default_tags are supported, we should be able to remove this method and reuse ConfigDefaultTags() for both AWS and Azure
There was a problem hiding this comment.
should we create a CLOUDP to track this follow up work?
There was a problem hiding this comment.
Sure, created CLOUDP-454792 to track this
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
All taggable Azure resources created by the affected acceptance-test helpers receive the required policy tags.
Review effort: Balanced
Findings: None
What changed in this PR
Adds mandatory Azure cloud-policy tags to resources created by acceptance tests.
Changes:
- Adds a reusable resource-level Azure tags helper.
- Tags Azure resource groups and storage accounts in shared test configurations.
| File | Description |
|---|---|
internal/testutil/acc/provider.go |
Adds the shared tag configuration helper. |
internal/testutil/acc/cloud_provider_access.go |
Tags shared Azure storage infrastructure. |
internal/testutil/acc/stream_privatelink_endpoint.go |
Tags Azure Blob Storage test resources. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Heads-up for reviewers: the CI acceptance test failures are expected for now. The tests now tag the Azure resources they create (required by the Cloud Tag Policy), but the CI users don't yet have tagging permissions, tracked in CLOUDP-451854. Looking for early feedback on the approach in the meantime, and won't merge until the permissions are in place and the tests run green. |
🤖 Augment PR SummarySummary: Adds resource-level Cloud Tag Policy tags to Azure resource groups and storage accounts generated by acceptance-test helpers. 🤖 Was this summary useful? React with 👍 or 👎 |
642854f to
fddd4da
Compare
|
This PR has gone 7 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 7 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy! |
Description
The upcoming Cloud Tag Policy requires
mongodb-ownerandmongodb-envtags on Azure resources. Our acceptance tests create Azure resources (resource groups, storage accounts, etc.), so these tests would start failing once enforcement begins.This PR tags all Azure resources created by acceptance tests by setting
tagson the resources directly (azurerm does not support provider-leveldefault_tags). Tag values come from theMONGODB_TAG_OWNER/MONGODB_TAG_ENVenv vars, defaulting to the team email andtestfor local runs.Link to any related issue(s): CLOUDP-441536
Type of change:
Required Checklist:
Further comments
Stacked on #4763, merge that one first.
Note: azurerm does not support provider-level
default_tags(hashicorp/terraform-provider-azurerm#13776), so tags are set on each resource instead.Verified via scoped CI runs:
TestAccLogIntegration_basicAzureandTestAccStreamRSStreamConnection_AzureBlobStorage(PrivateLink)pass with tagged resources.The CI-skipped
TestAccStreamPrivatelinkEndpointAzureBlobStorage_basicwas executed locally to verify it's working as expected: