-
Notifications
You must be signed in to change notification settings - Fork 1
Copier update: install pulumi #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
691df36
7f86fc9
efdfd26
044b086
2f6ff4b
d5c1cb6
4b5ab52
844c131
b0b972d
7a3bd82
31ad2c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -44,6 +44,12 @@ | |||||||||||||||||||||||||||||||
| default=False, | ||||||||||||||||||||||||||||||||
| help="Allow uv to install new versions of Python on the fly. This is typically only needed when instantiating the copier template.", | ||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||
| _ = parser.add_argument( | ||||||||||||||||||||||||||||||||
| "--skip-installing-pulumi-cli", | ||||||||||||||||||||||||||||||||
| action="store_true", | ||||||||||||||||||||||||||||||||
| default=False, | ||||||||||||||||||||||||||||||||
| help="Do not install the Pulumi CLI even if the lock file references it", | ||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| class PackageManager(str, enum.Enum): | ||||||||||||||||||||||||||||||||
|
|
@@ -127,6 +133,17 @@ def main(): | |||||||||||||||||||||||||||||||
| check=True, | ||||||||||||||||||||||||||||||||
| env=uv_env, | ||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||
| if ( | ||||||||||||||||||||||||||||||||
| not generate_lock_file_only | ||||||||||||||||||||||||||||||||
| and not args.skip_installing_pulumi_cli | ||||||||||||||||||||||||||||||||
| and platform.system() == "Linux" | ||||||||||||||||||||||||||||||||
| and env.lock_file.exists() | ||||||||||||||||||||||||||||||||
| and '"pulumi"' in env.lock_file.read_text() | ||||||||||||||||||||||||||||||||
| ): | ||||||||||||||||||||||||||||||||
| _ = subprocess.run( | ||||||||||||||||||||||||||||||||
| ["sh", str(REPO_ROOT_DIR / ".devcontainer" / "install-pulumi-cli.sh"), str(env.lock_file)], | ||||||||||||||||||||||||||||||||
| check=True, | ||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||
|
Comment on lines
+143
to
+146
|
||||||||||||||||||||||||||||||||
| _ = subprocess.run( | |
| ["sh", str(REPO_ROOT_DIR / ".devcontainer" / "install-pulumi-cli.sh"), str(env.lock_file)], | |
| check=True, | |
| ) | |
| pulumi_install_script = REPO_ROOT_DIR / ".devcontainer" / "install-pulumi-cli.sh" | |
| if pulumi_install_script.exists(): | |
| _ = subprocess.run( | |
| ["sh", str(pulumi_install_script), str(env.lock_file)], | |
| check=True, | |
| ) | |
| else: | |
| print( | |
| f"Warning: Pulumi CLI install script not found at {pulumi_install_script}; skipping Pulumi CLI installation.", | |
| file=sys.stderr, | |
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,9 +74,17 @@ | |
| "Bash(tail *)", | ||
| // Search | ||
| "Bash(rg *)", | ||
| // Research | ||
| "Bash(gh issue list *)", | ||
| "Bash(gh pr view *)", | ||
| "Bash(gh pr diff *)" | ||
| ], | ||
| "ask": [ | ||
| "Bash(gh *)", // let's hold off before we let it use the github CLI in any free running allow mode...I don't want it somehow approving PRs with the user's credentials | ||
| // let's hold off before we let it use the github CLI in any free running allow mode...I don't want it somehow approving PRs with the user's credentials | ||
| "Bash(gh repo *)", | ||
| "Bash(gh release *)", | ||
| "Bash(gh secret *)", | ||
| "Bash(gh ruleset *)", | ||
| "Bash(aws *)", // let's hold off before we let it use AWS CLI in any free running allow mode. We need to be very sure we don't have any access to staging or production credentials in our dev environment (...which we shouldn't...but we need to double check that or consider any other safeguards first) | ||
| "Bash(curl *)", | ||
| "Bash(ln *)", | ||
|
|
@@ -85,6 +93,17 @@ | |
| "deny": [ | ||
| // Exceptions to generally allowed AI tooling | ||
| "Bash(bd init*)", // we need to control the init process, don't let AI do that in the background | ||
| // Github | ||
| // Claude should not ever interfere with the PR process, that is how we gate AI's work | ||
| "Bash(gh pr create *)", | ||
| "Bash(gh pr edit *)", | ||
| "Bash(gh pr ready *)", | ||
| "Bash(gh pr review *)", | ||
| "Bash(gh pr merge *)", | ||
| "Bash(gh pr close *)", | ||
|
Comment on lines
+96
to
+103
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n template/.claude/settings/permissions/bash.jsonc | sed -n '90,110p'Repository: LabAutomationAndScreening/copier-nuxt-static-aws Length of output: 913 🏁 Script executed: # Get list of all gh pr subcommands that modify state
# Based on GitHub CLI documentation, let's identify all gh pr commands
# and classify which ones are mutating (write operations)
python3 <<'EOF'
# GitHub CLI gh pr subcommands
gh_pr_commands = {
# Read-only commands
"list": "list pull requests",
"view": "view a pull request",
"diff": "view changes in a pull request",
"status": "show status of relevant pull requests",
"checks": "show checks for a pull request",
# Mutating/Write commands
"create": "create a pull request",
"edit": "edit a pull request",
"close": "close a pull request",
"ready": "mark a pull request as ready for review",
"review": "add a review to a pull request",
"merge": "merge a pull request",
"reopen": "reopen a closed pull request",
"comment": "comment on a pull request",
"update-branch": "update a pull request branch",
"lock": "lock a pull request",
"unlock": "unlock a pull request",
"draft": "mark a pull request as a draft",
}
print("Mutating gh pr commands:")
mutating = {k: v for k, v in gh_pr_commands.items() if k in ["create", "edit", "close", "ready", "review", "merge", "reopen", "comment", "update-branch", "lock", "unlock", "draft"]}
for cmd in sorted(mutating.keys()):
print(f" - gh pr {cmd}")
EOFRepository: LabAutomationAndScreening/copier-nuxt-static-aws Length of output: 320 🏁 Script executed: cat -n template/.claude/settings/permissions/bash.jsonc | sed -n '85,125p'Repository: LabAutomationAndScreening/copier-nuxt-static-aws Length of output: 1862 Explicitly deny all remaining mutating The policy comment states Claude should never interfere with the PR process, but the current deny list is incomplete. Missing write-capable commands include 🤖 Prompt for AI Agents |
||
| "Bash(gh pr comment *)", | ||
| "Bash(gh pr update-branch *)", | ||
|
|
||
| // Destructive File Operations | ||
| "Bash(chmod -R *)", | ||
| "Bash(chown -R *)", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: LabAutomationAndScreening/copier-nuxt-static-aws
Length of output: 184
🏁 Script executed:
Repository: LabAutomationAndScreening/copier-nuxt-static-aws
Length of output: 1927
🏁 Script executed:
rg "gh pr (comment|reopen|update-branch)" ./.claude/settings/permissions/bash.jsoncRepository: LabAutomationAndScreening/copier-nuxt-static-aws
Length of output: 74
🌐 Web query:
gh pr subcommands github cli write mutating operations💡 Result:
The GitHub CLI gh pr command provides several subcommands that perform mutating operations on pull requests (i.e., those that create, update, or delete PR state or related resources on GitHub). These require write permissions to the repository. Mutating gh pr subcommands: - gh pr create: Creates a new pull request. Supports flags like --title, --body, --base, --draft, --assignee, --reviewer, --label, --milestone, --project. Aliases: gh pr new. - gh pr edit: Updates title, body, base branch, assignees, reviewers, labels, milestones, or projects for an existing PR. Flags include --title, --body, --add-assignee, --add-reviewer, --add-label, --remove-* variants. - gh pr merge: Merges a PR. Supports strategies --merge, --rebase, --squash; flags like --delete-branch, --auto. - gh pr close: Closes a PR. Flags: --comment, --delete-branch. - gh pr ready: Marks a draft PR as ready for review (or --undo to mark as draft). - gh pr update-branch: Updates the PR's head branch with latest base branch changes (merge by default, or --rebase). - gh pr revert: Creates a new PR that reverts a merged PR. Flags like --title, --body, --draft. - gh pr lock: Locks conversation on a PR. Flag: --reason. - gh pr unlock: Unlocks conversation on a PR. Non-mutating subcommands (view/query only): list, view, status, diff, checks, checkout (local git only). All subcommands support -R, --repo to target a specific repo. Use gh pr --help for full details. Examples: gh pr create --title "Fix bug" --body "Details" --reviewer user1 gh pr merge 123 --squash --delete-branch gh pr edit 123 --add-label "bug" --title "Updated title"
Citations:
pr revertcli/cli#8826Deny all write-capable
gh prsubcommands to prevent PR process interference.The current deny list covers
create,edit,ready,review,merge, andclose, but is missing other write-capable PR operations:gh pr update-branch(updates PR head branch),gh pr revert(creates a revert PR),gh pr lock, andgh pr unlock. All of these should be explicitly denied to fully close the write surface on PR operations.🤖 Prompt for AI Agents