Fix broken Python/YAML code snippets across 5 doc pages - #21074
Fix broken Python/YAML code snippets across 5 doc pages#21074workprentice[bot] wants to merge 1 commit into
Conversation
Parser-verified sweep of every fenced code block under content/docs/** (ast.parse for Python, yaml.safe_load for YAML) found five copy-paste- breaking syntax defects, fixed here: - deployments/concepts/webhooks.md: wrong module name (pulumi_service -> pulumi_pulumiservice) and colon syntax instead of Python keyword arguments. - iac/concepts/functions/resource-methods.md: function stub missing its trailing colon and body. - iac/languages-sdks/python/python-blocking-async.md: missing comma between keyword arguments, plus the adjacent is-not/int-literal comparison and an uncalled bound method in the same snippet. - iac/get-started/gcp/create-component.md: stray backslash-escaped braces in a dict literal. - iac/get-started/terraform/convert-hcl.md: unquoted interpolation in a YAML flow sequence. Fixes #21073.
Pre-merge Review — Last updated 2026-08-22T14:16:25ZTip Summary: A five-file copy-editing sweep that repairs code snippets a reader would otherwise paste and watch fail: a Python example in the deployments webhooks page that used Review confidence:
Investigation log
🔍 Verification trail5 claims extracted · 4 verified · 0 unverifiable · 1 contradicted · 1 detector finding
🚨 Outstanding in this PRNo outstanding issues.
|
|
Your site preview for commit 203f1a6 is ready! 🎉 http://www-testing-pulumi-docs-origin-pr-21074-203f1a6b.s3-website.us-west-2.amazonaws.com Changed pages: |
Summary
A parser-verified sweep of every fenced code block under
content/docs/**(Python viaast.parse, YAML viayaml.safe_load, JSON viajson.loads, Go/TypeScript/C#/Java via a delimiter-balance heuristic) found five real, copy-paste-breaking syntax defects. Illustrative snippets using...elisions, narrative placeholders, or intentional excerpt fragments were excluded as false positives; each defect below was independently confirmed against the real parser before being fixed.Fixes #21073.
Changes
deployments/concepts/webhooks.md: the PythonWebhookexample calledpulumi_service.Webhook(...)after importingpulumi_pulumiservice, and usedkey: valuecolon syntax instead of Python keyword arguments (key=value).iac/concepts/functions/resource-methods.md: theget_kubeconfigfunction stub was missing its trailing colon and body.iac/languages-sdks/python/python-blocking-async.md: missing comma between thestdout=andstderr=keyword arguments tocreate_subprocess_shell; also tightened the adjacentis not 0int-literal comparison to!= 0and fixed an uncalledstdout.decodebound-method reference tostdout.decode()in the same snippet.iac/get-started/gcp/create-component.md: thewebsite={...}dict literal in the completeGcpStorageWebsitelisting used stray backslash-escaped braces (\{/\}) instead of plain{/}.iac/get-started/terraform/convert-hcl.md: the converted Pulumi YAML program hadvpcSecurityGroupIds: [${web-sg.id}], an unquoted interpolation inside a YAML flow sequence, which YAML parses as an (invalid) flow mapping opener; quoted it as["${web-sg.id}"].Verification
ast.parsefor Python,yaml.safe_loadfor the YAML snippet) to confirm it is now syntactically valid.node ./scripts/lint/lint-markdown.js: 1846 files parsed, 0 errors../scripts/prettier.sh --checkon the five changed files: all pass.🧠 This PR was created by workprentice.