chore: autogen otel using skill#4533
Conversation
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Additionally, the subject of the title must start with an uppercase character (e.g. feat: New Details: contributing development guide |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new autogenerated Terraform resource/data sources for Atlas Metric Integrations (OTEL metrics export), wires them into the provider, and adds supporting codegen configuration + helper “skill” scripts for regenerating resources from different OpenAPI spec sources.
Changes:
- Add autogenerated
mongodbatlas_metric_integrationresource plus singular/plural data sources underinternal/serviceapi/metricintegration. - Register the new resource/data sources in the framework provider and add an acceptance test.
- Update codegen inputs (
tools/codegen/config.yml, model YAML, and flattened OpenAPI spec) and add.cursor/skills/autogen-resource-from-mmsscripts/docs.
Reviewed changes
Copilot reviewed 10 out of 19 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/codegen/models/metric_integration.yaml | New codegen model describing metric integration schema/operations. |
| tools/codegen/config.yml | Adds codegen configuration for the new metric_integration resource + data sources. |
| tools/codegen/atlasapispec/multi-version-api-spec.flattened.yml | Updates flattened OpenAPI spec snapshot used for generation. |
| internal/serviceapi/metricintegration/resource.go | Autogenerated CRUD implementation for the new resource. |
| internal/serviceapi/metricintegration/resource_schema.go | Autogenerated Terraform schema + TF models for the resource. |
| internal/serviceapi/metricintegration/data_source.go | Autogenerated singular data source implementation. |
| internal/serviceapi/metricintegration/data_source_schema.go | Autogenerated singular data source schema + TF models. |
| internal/serviceapi/metricintegration/plural_data_source.go | Autogenerated plural data source implementation (list). |
| internal/serviceapi/metricintegration/plural_data_source_schema.go | Autogenerated plural data source schema + TF models. |
| internal/serviceapi/metricintegration/resource_test.go | New acceptance test covering basic create/update/import/destroy. |
| internal/serviceapi/metricintegration/main_test.go | TestMain wiring for acceptance tests in this package. |
| internal/provider/provider.go | Registers the new resource and data sources in the provider. |
| .cursor/skills/autogen-resource-from-mms/SKILL.md | Adds internal “skill” documentation for end-to-end autogen workflow. |
| .cursor/skills/autogen-resource-from-mms/scripts/autogen-resource.sh | Wrapper script to fetch+flatten+generate. |
| .cursor/skills/autogen-resource-from-mms/scripts/fetch-spec.sh | Fetches OpenAPI spec from prod/dev or MMS branch/PR. |
| .cursor/skills/autogen-resource-from-mms/scripts/flatten-spec.sh | Flattens fetched spec for codegen. |
| .cursor/skills/autogen-resource-from-mms/scripts/generate-resource.sh | Runs the generator and prints generated file paths. |
Files not reviewed (6)
- internal/serviceapi/metricintegration/data_source.go: Generated file
- internal/serviceapi/metricintegration/data_source_schema.go: Generated file
- internal/serviceapi/metricintegration/plural_data_source.go: Generated file
- internal/serviceapi/metricintegration/plural_data_source_schema.go: Generated file
- internal/serviceapi/metricintegration/resource.go: Generated file
- internal/serviceapi/metricintegration/resource_schema.go: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - string: {} | ||
| description: Type of metric integration. Identifies which protocol will be used for the integration. This value cannot be modified after the integration is created. | ||
| computed_optional_required: required | ||
| tf_schema_name: integration_type | ||
| tf_model_name: IntegrationType | ||
| api_name: integrationType | ||
| req_body_usage: all_request_bodies | ||
| sensitive: false | ||
| create_only: false | ||
| present_in_any_response: true | ||
| request_only_required_on_create: false |
| "integration_type": schema.StringAttribute{ | ||
| Required: true, | ||
| MarkdownDescription: "Type of metric integration. Identifies which protocol will be used for the integration. This value cannot be modified after the integration is created.", | ||
| }, |
| INPUT_SPEC="${1:-tools/codegen/atlasapispec/raw-multi-version-api-spec.json}" | ||
| OUTPUT_SPEC="${2:-tools/codegen/atlasapispec/multi-version-api-spec.flattened.yml}" |
| if [[ ! -f "$INPUT_SPEC" ]]; then | ||
| echo "Error: Input spec not found at ${INPUT_SPEC}" | ||
| echo "Run fetch-mms-spec.sh first to download the spec" | ||
| exit 1 | ||
| fi |
| logintegration.DataSource, | ||
| logintegration.PluralDataSource, | ||
| metricintegration.DataSource, | ||
| metricintegration.PluralDataSource, |
|
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
Please include a summary of the fix/feature/change, including any relevant motivation and context.
Link to any related issue(s):
Type of change:
Required Checklist:
Further comments