deprecate-resource-or-field-workflow
Note to AI Agents: You MUST read the YAML frontmatter above first. Only read the rest of this file if the
descriptionmatches your required task.
This workflow governs adding deprecation notices and establishing forwards-compatibility on the main branch prior to a major release.
Prerequisites
- You must be operating on the
mainbranch in themagic-modulesroot directory. - You must know the target resource/data source (e.g.,
google_beyondcorp_app_connector) and the field (or entire resource/data source) to deprecate. - You must know the replacement path (if applicable) or the reason for deprecation.
Execution Steps
1. Context & Guidance
Before beginning implementation, consult:
docs/content/breaking-changes/make-a-breaking-change.md— Section Add deprecations and warnings to the main branch.docs/content/reference/field.mdanddocs/content/reference/resource.md— Configuration references..agents/knowledge/index.md— General knowledge index.
2. Forwards-Compatibility & Replacement
- Required Fields: If a required field is being deprecated for future removal, make it optional (
required: true$\rightarrow$optional: truein MMv1 YAML orRequired: false, Optional: truein Go) so configurations can begin omitting it prior to the major release. - Renames / Replacements: Ensure the replacement field or resource is implemented, tested, and available on
mainbefore or alongside the deprecation.
3. Apply Deprecation Notice
Follow the conventions in docs/content/breaking-changes/make-a-breaking-change.md:
- MMv1 Resources/Fields: Set
deprecation_messageon the target property or resource inmmv1/products/<product>/<Resource>.yaml. - Handwritten Resources/Data Sources: Set
Deprecated(fields) orDeprecationMessage(resources / data sources) in Go schema (mmv1/third_party/terraform/services/<product>/...) and add deprecation warnings to markdown documentation inwebsite/docs/r/orwebsite/docs/d/.
4. Run Pre-Gen Checks
- Execute run-pre-gen-checks to verify Go formatting, YAML linting, template validation, and unit tests.
5. Generate Provider & Verify Build
- Execute generate-provider.
- Run
make buildin the downstream provider repository to verify compilation.
6. Verification Testing
- Invoke qa-test-runner to verify acceptance tests pass (
PASS).