Mise à niveau des fournisseurs Pulumi

VérifiéPrudence

Automatise la mise à niveau des dépôts de fournisseurs Pulumi via l'outil upgrade-provider, avec gestion des erreurs courantes en boucle jusqu'au succès.

Spar Skills Guide Bot
DevOpsAvancé
20/09/2026
Claude Code
#pulumi#provider-upgrade#devops#go#git

Recommandé pour

Synthèse automatique

Guide un agent pour exécuter l'outil upgrade-provider de Pulumi sur un dépôt de provider et itérer sur les erreurs jusqu'à la création de la pull request de mise à niveau.

Points forts

  • Automatise la boucle de mise à niveau avec un délai maximal explicite de 10 minutes et un suivi des erreurs pour éviter les boucles infinies.
  • Définit des conditions d'arrêt claires, notamment l'échec d'environnement lorsque la commande est introuvable (code 127).
  • Prévoit une étape post-exécution pour examiner les conflits de patches et les commits upstream appliqués.
  • Maintient les opérations git en lecture seule et laisse l'outil gérer les branches, commits et PR.

Limites

  • Suppose que le binaire upgrade-provider et l'environnement Go sont déjà installés et configurés, sans solution de repli.
  • Les correctifs précis dépendent d'un fichier de référence externe (references/upgrade-provider-errors.md) non fourni ici.
  • S'applique uniquement aux dépôts de providers Pulumi et nécessite un accès shell avec des commandes longues.
Quand l'utiliser

À utiliser pour mettre à niveau un dépôt de provider Pulumi vers une nouvelle version upstream avec l'outil upgrade-provider.

Quand l'éviter

À ne pas utiliser pour des dépôts non Pulumi, une première installation de l'outil ou un environnement sans exécution de commandes shell longues.

Analyse de sécurité

Prudence
Score qualité90/100

The skill automates a legitimate Pulumi provider upgrade workflow. It does not contain destructive or exfiltrating commands, but it does execute third-party code and perform network-based write operations, which warrant caution.

Points d'attention
  • •Installs and runs a third-party Go tool from GitHub via `go install`, introducing supply chain risk.
  • •Uses `gh api` to modify the PR body, which is a write operation to GitHub.
  • •Relies on network access for tool installation and GitHub CLI commands.
Comment cette analyse est faite

Exemples

Upgrade a Pulumi provider
Run upgrade-provider on pulumi/pulumi-aws from the repo root and fix any errors it reports until the upgrade PR is created.
Resolve patch conflicts
The upgrade-provider run for pulumi/pulumi-gcp failed with a patch conflict; inspect the output, apply a fix, and rerun it.
Review upstream patch commits
After the Pulumi provider upgrade, run ./scripts/upstream.sh checkout and summarize the intent and risk of each applied upstream commit.

name: pulumi-upgrade-provider description: Automate Pulumi provider repo upgrades with the upgrade-provider tool. Use when upgrading a pulumi provider repository to a new upstream version, running upgrade-provider, and addressing its common failure modes like patch conflicts or missing module mappings.

Pulumi Upgrade Provider

Prerequisites

First, install the upgrade-provider tool:

go install github.com/pulumi/upgrade-provider@latest

After installation, the tool will be in your PATH and you can run it directly as upgrade-provider.

IMPORTANT:

  • Do NOT try to modify PATH or use absolute paths to run the tool
  • Do NOT try to find where the tool was installed
  • Just run upgrade-provider directly after installing - if it's not found (exit code 127), report this as an environment configuration issue and stop

CRITICAL: Session Completion Requirements

DO NOT end this session until one of these conditions is met:

  1. Success: The upgrade-provider command completes successfully AND you have retrieved the PR URL
  2. Explicit failure: You have hit a stopping condition listed in "When to Stop and Report Failure" below

You MUST NOT end the session if:

  • A command is still running or you haven't checked its output
  • You encountered an error but haven't attempted to fix it
  • You haven't yet run upgrade-provider at least once
  • The upgrade-provider command failed but you haven't exhausted the error-fixing loop

Long-running commands: The upgrade-provider command can take up to 10 minutes. You MUST wait for it to complete. Use timeout: 600000 when running it via Bash.

Overview

Drive Pulumi provider upgrades by running the upgrade-provider tool and iterating on failures until the tool succeeds. Keep all git operations read-only in the repo; the tool owns branches, commits, and PRs.

Error Tracking

Track errors across iterations to avoid infinite loops:

  • Maintain a mental list of errors encountered and fixes attempted
  • An error is "the same" if it has the same error message and affects the same file/resource
  • After 3 failed attempts at the same error, stop and report failure

Run Loop

  1. Create the output directory first:
mkdir -p .pulumi
  1. Run the upgrade tool from the repo root with a 10-minute timeout:
upgrade-provider $ORG/$REPO --repo-path . > .pulumi/upgrade-provider-stdout.txt 2> /dev/null

Use timeout: 600000 (10 minutes) when invoking via Bash.

If exit code is 127 (command not found): This is an environment configuration issue. Report failure immediately - do NOT try to install the tool or find it manually.

  1. Wait for the command to fully complete (can take up to 10 minutes). Do not proceed or end the session until you see the final output.

  2. Read the output file to check for errors:

cat .pulumi/upgrade-provider-stdout.txt
  1. Scan the output for lines starting with error: .
  2. If failed:
    • Compare the error to previous attempts
    • If you've seen the same error 3 times, stop and report failure (see "When to Stop")
    • If this is a new/different error, fix it using references/upgrade-provider-errors.md
    • Rerun the command (go back to step 2)
  3. If a conflict was fixed, report exactly what changed (file paths + concrete edits or kept intent).
  4. If the upgrade required changes to patches, run ./scripts/upstream.sh checkout and review the applied commits:
    • List commit SHAs/titles from upstream.
    • Summarize the intent of each commit in plain language.
    • Call out any behavioral changes or risks.
  5. When the tool completes successfully, proceed to Post-run Tasks.

When to Stop and Report Failure

Stop iterating and exit with failure if any of these conditions are met:

  1. Command not found (exit code 127): The upgrade-provider tool is not in PATH. This is an environment configuration issue - do NOT try to install the tool yourself
  2. Same error 3 times: You've attempted to fix the same error 3 times without success
  3. Unknown error pattern: The error is not covered in references/upgrade-provider-errors.md and you cannot determine a safe fix
  4. Requires human judgment: The fix requires decisions that need human input, such as:
    • Choosing between multiple valid approaches
    • Breaking changes that affect public API
    • Deprecation strategies
    • Architectural decisions about module organization
  5. Circular issues: Fix A causes error B, fix B causes error A
  6. Complexity escalation: Each fix attempt reveals more issues, suggesting deeper problems

When stopping, you MUST report:

  1. The error(s) encountered
  2. What fixes were attempted (with file paths and changes)
  3. Why you believe human intervention is needed
  4. Any partial progress that was made

Post-run Tasks

The tool creates a PR when the upgrade completes successfully.

  1. MUST fetch the PR URL for the current branch using read-only commands:
gh pr view --json url --jq .url || gh pr list --head "$(git branch --show-current)" --json url --jq '.[0].url'
  1. MUST append a "Fixes applied to unblock upgrade" section to the existing PR body if any fixes were applied (do not overwrite):
repo=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
pr_number=$(gh pr view --json number --jq .number)
gh pr view --json body --jq .body > /tmp/pr_body.txt

cat <<'EOF' >> /tmp/pr_body.txt

---

### Fixes applied to unblock upgrade

- <list concrete unblocker edits here, with file paths and intent>
EOF

gh api -X PATCH "repos/$repo/pulls/$pr_number" --raw-field body="$(cat /tmp/pr_body.txt)"

Use REST (gh api) instead of gh pr edit to avoid GraphQL project-card errors. Keep the original content intact; only append the new section.

Notes

  • git rebase --continue --no-edit is not supported in older git versions. Use git rebase --continue and accept the existing commit message when prompted.
  • To avoid the editor prompt during git rebase --continue, run it with GIT_EDITOR=true (or GIT_EDITOR=:).

Working Directory

IMPORTANT: Always run commands from the repository root. Do NOT use cd to change directories - it causes state confusion and is not allowed.

Working with the upstream submodule

The upstream/ directory is a git submodule containing the Terraform provider source. Use these patterns:

Git commands - use -C upstream:

# Check status
git -C upstream status

# View log
git -C upstream log --oneline -10

# Check current branch
git -C upstream branch --show-current

# Continue a rebase (with auto-accept message)
GIT_EDITOR=: git -C upstream rebase --continue

# Stage files after resolving conflicts
git -C upstream add <file>

Reading files - use the Read tool with path from repo root:

Read upstream/docs/resources/droplet.md
Read upstream/go.mod

Editing files - use the Edit tool with path from repo root:

Edit upstream/docs/resources/droplet.md

Listing files - use full paths:

ls -la upstream/
ls -la upstream/vendor/github.com/digitalocean/godo/

Scripts - run from repo root:

./scripts/upstream.sh checkout
./scripts/upstream.sh rebase -o refs/tags/v2.75.0
./scripts/upstream.sh check_in

Guardrails

  • Never commit, push, or create branches manually; only run read-only git commands.
  • ./scripts/upstream.sh checkout|rebase|check_in are allowed because the tool manages git state.
  • Do not stash changes; the tool manages git state.
  • Do not use cd - always work from the repository root.

References

  • Use this skill's references/upgrade-provider-errors.md for patch conflict and new module mapping fixes.

Final Reminder

Before ending this session, verify:

  • [ ] You ran upgrade-provider and waited for it to complete
  • [ ] If it failed, you attempted fixes per the error reference guide
  • [ ] If it succeeded, you retrieved and reported the PR URL
  • [ ] If stopping due to failure, you documented the error, attempted fixes, and why human intervention is needed

Do not end the session without completing one of the outcomes above.

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/pulumi-provider-upgrade-automation-mu99jolf/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/pulumi-provider-upgrade-automation-mu99jolf/download' --output '.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf/SKILL.md.part' && mv '.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf/SKILL.md.part' '.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Extrait original : Prerequisites

First, install the upgrade-provider tool:

go install github.com/pulumi/upgrade-provider@latest

After installation, the tool will be in your PATH and you can run it directly as upgrade-provider.

IMPORTANT:

  • Do NOT try to modify PATH or use absolute paths to run the tool
  • Do NOT try to find where the tool was installed
  • Just run upgrade-provider directly after installing - if it's not found (exit code 127), report this as an environment configuration issue and stop

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf/SKILL.md' && test -s '.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/pulumi-upgrade-provider' && cp -R '.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf' '.claude/skills/pulumi-upgrade-provider'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf'

openskills read 'pulumi-provider-upgrade-automation-mu99jolf'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/pulumi-provider-upgrade-automation-mu99jolf/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires