upstream-patches

द्वारा pulumi

Create, amend, remove, and rebase patches for Terraform provider submodules using `./scripts/upstream.sh`. Use when `upgrade-provider` or manual patch work…

npx skills add https://github.com/pulumi/agent-skills --skill upstream-patches

Upstream Patches

upstream/ is a git submodule pointing to the upstream Terraform provider. patches/ contains patch files applied on top of it. Use ./scripts/upstream.sh to manage patch state.

Default Behavior

  • If fixing a regression introduced by an existing patch, amend the owning patch commit.
  • Do not create a new patch unless the user explicitly asks.

Commands Reference

CommandDescription
./scripts/upstream.sh initInitialize upstream and apply patches to working directory
./scripts/upstream.sh init -fDestructively discard checkout/rebase state and re-initialize upstream
./scripts/upstream.sh checkoutCreate branch with patches as commits for editing
./scripts/upstream.sh rebase -iInteractively edit patch commits
./scripts/upstream.sh rebase -o <commit>Rebase patches onto a new upstream commit
./scripts/upstream.sh check_inWrite commits back to patches and exit checkout mode

Guardrails

  • Never commit directly to upstream/ without checkout/check_in.
  • Direct edits under upstream/ outside checkout are ephemeral during upgrade-provider; the tool resets submodule state.
  • Do not hand-edit patches/*.patch unless intentionally doing raw patch surgery.
  • Prefer non-interactive rewrite flow over interactive rebase for agents.

Find Owning Patch First

Before editing patch content, identify the owning patch/commit.

./scripts/upstream.sh checkout

# Find candidate patch files by touched file path or unique hunk text
rg -n "path/to/file|unique_symbol" patches/*.patch

# Optional: inspect candidate patch header/hunks
sed -n '1,120p' patches/00NN-Example.patch

# Map patch file to commit in upstream checkout branch
patch=patches/00NN-Example.patch
subject=$(sed -n 's/^Subject: \[PATCH\] //p' "$patch" | head -n1)
cd upstream
git log --oneline pulumi/patch-checkout --grep "$subject"

# If needed, disambiguate by touched path
git log --oneline pulumi/patch-checkout -- path/to/file
cd ..

If rg is unavailable, use grep -En for the patch search. Set target_sha to the owning commit and edit that commit, not HEAD.

Amend Existing Patch (Preferred, Non-Interactive)

./scripts/upstream.sh checkout
cd upstream

target_sha=<owning-commit-sha>
base_sha=$(git rev-parse "${target_sha}^")
tmp_branch="rewrite-${target_sha:0:8}"

# Rebuild history from parent of target commit
git checkout -b "$tmp_branch" "$base_sha"
git cherry-pick "$target_sha"

# Apply fix and amend target commit
# ...edit files...
git add <files>
git commit --amend --no-edit

# Replay remaining commits
git cherry-pick "${target_sha}..pulumi/patch-checkout"

# If cherry-pick conflicts occur:
#   resolve files
#   git add <resolved files>
#   git cherry-pick --continue

# Move checkout branch to rewritten history
git branch -f pulumi/patch-checkout HEAD
git checkout pulumi/patch-checkout
git branch -D "$tmp_branch"
cd ..

Interactive fallback:

./scripts/upstream.sh checkout
./scripts/upstream.sh rebase -i
# mark target commit as edit, amend, then continue

Remove Entire Patch

Use when a patch should be deleted completely.

rm patches/00NN-Description.patch
./scripts/upstream.sh checkout
./scripts/upstream.sh check_in

Remove Part of a Patch

Use when only selected hunks/files should be removed from an existing patch.

  1. Find owning patch/commit (target_sha) and use the amend workflow above.
  2. Revert only unwanted changes from the target commit, then amend.

Example during amend step:

cd upstream
# Restore specific docs-only files from parent of amended commit
git checkout HEAD^ -- path/to/docs-only-file path/to/another-doc-file
git add path/to/docs-only-file path/to/another-doc-file
git commit --amend --no-edit
cd ..

Create New Patch (Only If Requested)

./scripts/upstream.sh checkout
cd upstream
# ...make changes...
git add <files>
git commit -m "Describe new patch"
cd ..
./scripts/upstream.sh check_in

Rebasing Patches to a New Upstream Version

./scripts/upstream.sh checkout

# Rebase onto the new upstream commit
./scripts/upstream.sh rebase -o <new_commit_sha>
# Resolve any conflicts that arise

# Write updated patch files
./scripts/upstream.sh check_in

Verification Checklist

Before check_in:

  • Confirm expected patch count change (0 by default; -1 for full patch removal).
  • Confirm whether target patch should remain present (default yes) or be removed (explicit deletion case).
  • Confirm you are editing the owning commit, not adding a new commit by accident.

After check_in:

  • Verify patch count matches expectation.
  • Verify target patch number/purpose is still present when expected.
  • Verify no unexpected new 00NN-*.patch was introduced.

Interrupted Checkout or Rebase

Preserve work by default. Inspect git -C upstream status, complete the active git am/rebase, verify that every patch was applied, and run ./scripts/upstream.sh check_in before rerunning automation. An interrupted checkout invokes git am separately for each patch, so later patch files may not have been reached.

Use ./scripts/upstream.sh init -f only when intentionally discarding all interrupted work. It can remove conflict resolution, patch commits, operation metadata, and untracked files; it is not routine recovery for a stuck checkout.

pulumi की और Skills

package-usage
pulumi
पूरे Pulumi संगठन में कौन से स्टैक एक विशिष्ट पैकेज का उपयोग करते हैं और किस संस्करण पर, इसका ट्रैक रखें। क्रॉस-स्टैक ऑडिट, पुराने या अनुरक्षित नहीं किए गए पैकेजों की पहचान करने के लिए उपयोग करें…
official
pulumi-automation-api
pulumi
पुलुमी बुनियादी ढांचे के संचालन का प्रोग्रामेटिक ऑर्केस्ट्रेशन, जो कई स्टैक और अनुप्रयोगों में काम करता है। यह स्थानीय स्रोत (मौजूदा पुलुमी प्रोजेक्ट) और इनलाइन स्रोत (एम्बेडेड प्रोग्राम) दोनों आर्किटेक्चर का समर्थन करता है, जिससे सरल से लेकर जटिल मल्टी-स्टैक परिदृश्यों तक लचीली तैनाती पैटर्न संभव होती है। यह निर्भरता अनुक्रमण, समानांतर स्वतंत्र तैनाती, और समन्वित बुनियाद
official
pulumi-best-practices
pulumi
विश्वसनीय और रखरखाव योग्य Pulumi इंफ्रास्ट्रक्चर कोड लिखने के लिए व्यापक सर्वोत्तम अभ्यास। apply() कॉलबैक के अंदर संसाधन बनाने से बचें; निर्भरता ट्रैकिंग और पूर्वावलोकन दृश्यता को संरक्षित करने के लिए Output ऑब्जेक्ट को सीधे इनपुट के रूप में पास करें। ComponentResource क्लास का उपयोग करके संबंधित संसाधनों को parent: this के माध्यम से उचित पैरेंट-चाइल्ड पदानुक्रम के साथ पुन: प्रयोज्य तार्किक इकाइयों में समूहित करें।
official
pulumi-component
pulumi
बहु-भाषा समर्थन, उचित डिफ़ॉल्ट और संरचना पैटर्न के साथ पुन: प्रयोज्य बुनियादी ढांचा घटक। चार मुख्य तत्वों की आवश्यकता है: ComponentResource का विस्तार करें, मानक पैरामीटर स्वीकार करें, सभी चाइल्ड पर parent: this सेट करें, और कंस्ट्रक्टर के अंत में registerOutputs() को कॉल करें। Args इंटरफ़ेस को Input<T> रैपर का उपयोग करना चाहिए, यूनियन प्रकार और फ़ंक्शन से बचना चाहिए, और बहु-भाषा SDK जनरेशन का समर्थन करने के लिए संरचनाओ
official
pulumi-debug-failed-operation
pulumi
एक Pulumi अपडेट या प्रीव्यू जो विफल हुआ, उसे डीबग करें: पहले से रिकॉर्ड की गई विफलता को पढ़ें, इसका कारण खोजें, और इसे ठीक करें। इस स्किल को लोड करें जब उपयोगकर्ता पूछे…
official
pulumi-esc
pulumi
Pulumi बुनियादी ढांचे और अनुप्रयोगों के लिए केंद्रीकृत रहस्य, कॉन्फ़िगरेशन और गतिशील क्रेडेंशियल प्रबंधन। आयात और लेयरिंग के माध्यम से पर्यावरण संरचना का समर्थन करता है, जिसमें environmentVariables , pulumiConfig , और files के लिए आरक्षित कुंजियाँ हैं। AWS, Azure और GCP के लिए OIDC के माध्यम से अल्पकालिक क्रेडेंशियल उत्पन्न करता है; AWS Secrets Manager, Azure Key Vault, HashiCorp Vault और 1Password के साथ एकीकृत होता है। मुख्य CLI कमांड में pulumi env init , pulumi env edit , pulumi env open (प्रकट
official
pulumi-neo-handoff
pulumi
वर्तमान थ्रेड को एक नए Pulumi Neo कार्य को एकतरफा स्थानांतरण के रूप में सौंपें। तब उपयोग करें जब उपयोगकर्ता स्पष्ट रूप से सौंपने, भेजने, स्थानांतरित करने या वर्तमान जारी रखने के लिए कहे…
official
pulumi-overview
pulumi
इस कौशल का उपयोग किसी भी कार्य के लिए करें जो क्लाउड इंफ्रास्ट्रक्चर या SaaS कॉन्फ़िगरेशन बनाता, संशोधित करता, निरीक्षण करता, या नष्ट करता है, एक बार के CLI ऑपरेशन से लेकर पूर्ण…
official