Add scripts/new_resources to resolve upstream new resources to their products - #3932
Add scripts/new_resources to resolve upstream new resources to their products#3932pose wants to merge 1 commit into
Conversation
…products Walks a terraform-provider-google-beta release tag to the magic-modules product each new resource belongs to, printing the product name in snake case. Covered by golden tests that replay recorded git and gh calls. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found.
About Unblocked
Unblocked has been set up to automatically review your team's pull requests to identify genuine bugs and issues.
📖 Documentation — Learn more in our docs.
💬 Ask questions — Mention @unblocked to request a review or summary, or ask follow-up questions.
👍 Give feedback — React to comments with 👍 or 👎 to help us improve.
⚙️ Customize — Adjust settings in your preferences.
| if sha is None: | ||
| sha = gh_json(f"repos/{TPG_REPO}/commits/{ref}", "{sha}")["sha"] | ||
|
|
||
| tags = run("git", "-C", upstream, "tag", "--points-at", sha).split() if upstream else [] |
There was a problem hiding this comment.
When upstream is not None but rev-parse failed at line 90 (ref not fetched locally), sha gets resolved via the GitHub API at line 94. Line 96 then unconditionally runs git tag --points-at sha against the local upstream repo. Since that sha isn't present locally, the git command will fail and run() raises an uncaught RuntimeError, crashing the tool.
Compare with changelog() (line 117-121) which correctly wraps its local git call in try/except for the same scenario.
| tags = run("git", "-C", upstream, "tag", "--points-at", sha).split() if upstream else [] | |
| try: | |
| tags = run("git", "-C", upstream, "tag", "--points-at", sha).split() if upstream else [] | |
| except RuntimeError: | |
| tags = [] |
Does the PR have any schema changes?Generated by schema-tools v0.8.1. Looking good! No breaking changes found. Maintainer note: consult the runbook for dealing with any breaking changes. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3932 +/- ##
======================================
Coverage 0.51% 0.51%
======================================
Files 8 8
Lines 1947 1947
======================================
Hits 10 10
Misses 1937 1937 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
guineveresaenger
left a comment
There was a problem hiding this comment.
Seems useful! Discoverability might be an issue, is there anywhere else we have where we could point to this script?
LGTM.
Walks a terraform-provider-google-beta release tag to the magic-modules product each new resource belongs to, printing the product name in snake case. Covered by golden tests that replay recorded
gitandghcalls, so they need no network.Also adds
ghto the rootmise.toml(the only dependency the repo toolchain was missing;pythonwas already there) and ignores__pycache__.