一键导入
fixing-tgc-resource-or-test-failures
Guide for Phase 6 of TGC Main Loop (Fix). Use to understand how to fix failures.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guide for Phase 6 of TGC Main Loop (Fix). Use to understand how to fix failures.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Skill for reviewing Magic Modules schemas. Currently covers the Enum vs. String decision via the knowledge base.
Opt resource into MMv1 list-resource generation by setting `generate_list_resource: true`, validate it locally, and open a one-resource PR against GoogleCloudPlatform/magic-modules. Invoke when the user asks to add list-resource support for a specific MMv1 resource or to enable `generate_list_resource` for an eligible resource.
Fallback workflow for general implementation and debugging tasks that do not involve creating a new resource.
Workflow specifically for creating a new resource, supporting both autogen and manual generation.
Create a Pull Request (PR) against GoogleCloudPlatform/magic-modules following repository standards, including branch management, commit formatting, mandatory release notes, pre-PR verification checks, and gh CLI commands.
Validate that changes to the generated providers don't introduce breaking changes or fields with missing tests or missing documentation. Use this skill when the user wants to check for breaking changes, missing tests, or missing documentation, or other problems in the downstream providers.
| name | fixing-tgc-resource-or-test-failures |
| description | Guide for Phase 6 of TGC Main Loop (Fix). Use to understand how to fix failures. |
If a failure is detected or provided, you MUST report it using the following template before proceeding.
[The command that failed][Paste the full, relevant error logs here]
[Yes/No] (Confirm you have read tgc-fix-handwritten-resources-tests-skill or tgc-fix-integration-tests-skill)[Analyze the cause of the failure][Outline the solution and ask for user approval before applying it]You MUST perform a strict Triage & Identification process before proposing or applying any changes. Do NOT use is_missing_in_cai: true as a shortcut to pass tests if the CAI asset actually supports the field.
diagnose_test_failure.py)To automate this triage, run the integration test with WRITE_FILES=1 enabled:
export WRITE_FILES=1
TF_CLI_CONFIG_FILE="${PWD}/tf-dev-override.tfrc" GO111MODULE=on go test -v ./test/services/<service> -run="<TestName>"
The Go test assertion runner will automatically execute ./test/diagnose_test_failure.py on failure, producing a side-by-side report comparing original CAI assets, HCL exports, and roundtrip configurations. Review this report in the standard test logs.
Inspect the raw CAI asset file (Test.json or Test_export.json) generated during the failed integration test run (or the automated diagnostics report).
"gpuDirectStrategy": "RDMA") is present in the CAI asset, it is NOT missing in CAI.is_missing_in_cai: true is strictly forbidden. You MUST implement full schema mapping, expander, and flattener logic.is_missing_in_cai: true if you have verified that the field is permanently omitted from CAI schemas and CAI asset payloads across all tests for this resource.Determine whether the failing resource is handwritten or generated by checking these conditions:
_cai2hcl.go and _tfplan2cai.go for the resource in mmv1/third_party/tgc_next/ (even if a YAML file exists in products/).products/ AND does NOT contain exclude_resource: true, AND_cai2hcl.go or _tfplan2cai.go in mmv1/third_party/tgc_next/ for this resource.Based on the resource type, read the corresponding skill before designing a fix:
tgc-fix-handwritten-resources-tests-skill.tgc-fix-integration-tests-skill.node_config.go.tmpl) maps the field.mmv1/templates/terraform or shared helper files/templates in mmv1/third_party/terraform. You may modify templates in mmv1/templates/tgc_next.mmv1/third_party/cai2hcl or mmv1/third_party/tgc. All changes must be made to TGC Next code in mmv1/third_party/tgc_next.mmv1/api/resource/custom_code.go unless guided by the user.mmv1/api/resource.go to hardcode or manually append ignored fields for tests. Use resource YAML property renaming with api_name instead to align with the actual Terraform schema.