-
Notifications
You must be signed in to change notification settings - Fork 207
chore: Adds provider_meta support to the provider #3618
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: master
Are you sure you want to change the base?
Conversation
…r agent operations
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 adds provider_meta support to enable module-level metadata tracking in the MongoDB Atlas Terraform provider. The feature allows terraform configurations to specify module names, versions, and additional User-Agent data that gets included in HTTP requests for analytics purposes.
- Implements provider_meta schema support for both framework and SDK v2 providers
- Adds User-Agent enhancement system to capture and transmit module metadata in HTTP headers
- Creates wrapper resources that inject analytics data into terraform operations
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
internal/provider/provider.go | Adds MetaSchema method and wraps resources with analytics functionality |
internal/provider/provider_sdk2.go | Implements ProviderMetaSchema for SDK v2 and wraps resources |
internal/config/user_agent.go | Core User-Agent metadata handling and context management |
internal/config/user_agent_test.go | Comprehensive test coverage for User-Agent functionality |
internal/config/transport.go | HTTP transport wrapper for User-Agent header modification |
internal/config/resource_base.go | Framework resource wrapper with analytics integration |
internal/config/resource_base_sdkv2.go | SDK v2 resource wrapper with analytics integration |
internal/config/resource_base_test.go | Tests ensuring resource interface preservation |
internal/config/transport_test.go | Minor formatting cleanup |
internal/config/client.go | Updates HTTP client transport chain configuration |
internal/testutil/unit/provider_mock.go | Simplifies mock provider by using embedding |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
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
Adds provider_meta support to the provider
Link to any related issue(s): CLOUDP-340210
Example usage
Terraform code
main.tf
Terraform code modules/project/main.tf
Logs example
terraform plan
(seeName/project
andName/custom_db_role
)Logs example
terraform apply
Type of change:
Required Checklist:
Further comments