Skip to content

Install Pulumi in devcontainer (when needed)#141

Merged
ejfine merged 14 commits intomainfrom
agents-all-day
Mar 30, 2026
Merged

Install Pulumi in devcontainer (when needed)#141
ejfine merged 14 commits intomainfrom
agents-all-day

Conversation

@ejfine
Copy link
Copy Markdown
Contributor

@ejfine ejfine commented Mar 30, 2026

Why is this change necessary?

It was annoying not having it available by default.

How does this change address the issue?

If the lock file has been generated, then when manual-setup-deps.py is run, the Pulumi CLI will be installed

What side effects does this change have?

CI actions needed to be tweaked to not install the Pulumi CLI when not needed (e.g. for running pre-commit hooks)

How is this change tested?

Downstream repos

Other

Updated some agent instructions and claude permissions

Summary by CodeRabbit

  • New Features

    • Added an option to skip Pulumi CLI installation during development setup.
  • Documentation

    • Enhanced testing guidance with test isolation steps and cassette-vs-mocks best practices.
  • Chores

    • Made GitHub CLI permissions more granular: allowed common read/reference commands and explicitly blocked PR write/merge/close/comment actions.
    • Updated development workflows and setup tooling to conditionally manage Pulumi CLI installation.

@ejfine ejfine self-assigned this Mar 30, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

📝 Walkthrough

Walkthrough

Refines Claude Bash GitHub CLI permissions, adds a skip flag to control Pulumi CLI installation across scripts/actions/workflows, updates the devcontainer context hash, and expands AGENTS.md testing guidance.

Changes

Cohort / File(s) Summary
Bash/GitHub CLI Permissions
.claude/settings/permissions/bash.jsonc
Replaced broad Bash(gh *) ask wildcard with narrower Bash(gh repo *), Bash(gh release *), Bash(gh secret *), Bash(gh ruleset *); added allow entries for read-only gh commands (gh issue list *, gh pr view *, gh pr diff *); added explicit deny rules for PR write/lifecycle commands (gh pr create *, gh pr edit *, gh pr ready *, gh pr review *, gh pr merge *, gh pr close *, gh pr comment *, gh pr update-branch *).
Pulumi installation control (script + CI input)
.devcontainer/manual-setup-deps.py, template/.github/actions/install_deps/action.yml.jinja-base
Added CLI arg --skip-installing-pulumi-cli to manual-setup-deps.py and composite-action input skip-installing-pulumi-cli (default: true) to control whether the Pulumi CLI installer runs.
Workflows passing flag
template/.github/workflows/pre-commit.yaml.jinja-base, template/template/.github/workflows/...pulumi-aws.yml...jinja-base
Updated workflow templates to pass skip-installing-pulumi-cli: true into the ./.github/actions/install_deps step.
Development Environment
.devcontainer/devcontainer.json
Updated devcontainer context hash comment value from 01a288c4 to 5ecc43b1.
Documentation
AGENTS.md
Expanded test-discovery wording and single-test iteration guidance; clarified cassette-vs-mocks guidance; minor formatting fixes and command-directory guidance.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer/CI
    participant Action as install_deps Action
    participant Script as manual-setup-deps.py
    participant Installer as install-pulumi-cli.sh
    Note over Dev,Action: Workflow run or local setup triggers
    Dev->>Action: invoke `./.github/actions/install_deps` (input: skip-installing-pulumi-cli=true/false)
    Action->>Script: run `manual-setup-deps.py` (appends `--skip-installing-pulumi-cli` when true)
    Script->>Script: run uv sync, check platform & lockfile for "pulumi"
    alt skip flag true OR conditions not met
        Script->>Action: skip Pulumi installer
    else conditions met and skip false
        Script->>Installer: execute `.devcontainer/install-pulumi-cli.sh`
        Installer->>Script: return install result
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • zendern
  • idonaldson
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main purpose of the PR: conditionally installing Pulumi in the devcontainer when needed based on lock file presence.
Description check ✅ Passed The PR description covers all required template sections with adequate detail about motivation, implementation, side effects, testing approach, and additional changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/settings/permissions/bash.jsonc:
- Around line 94-95: The blanket deny entry "Bash(gh pr *)" breaks read-only PR
workflows used by the polish command; remove that blanket deny and replace it
with explicit allow entries for read-only commands (e.g., "Bash(gh pr view)" and
"Bash(gh pr diff)") and explicit deny entries for mutating PR commands (e.g.,
"Bash(gh pr create)", "Bash(gh pr close)", "Bash(gh pr merge)", "Bash(gh pr
checkout)", "Bash(gh pr comment)", "Bash(gh pr edit)", "Bash(gh pr reopen)").
Update the permissions JSON where "Bash(gh pr *)" appears so the polish workflow
referenced in .claude/commands/polish.md can use gh pr view/diff while still
preventing any mutating PR operations.

In @.devcontainer/manual-setup-deps.py:
- Around line 136-145: The Pulumi install block runs even when lock-only mode is
active; update the conditional that gates the subprocess.run call so it also
checks the lock-only flag (e.g., add "and not generate_lock_file_only" or "and
not args.only_create_lock") so the block (which checks
args.skip_installing_pulumi_cli, platform.system(), env.lock_file.exists(),
'"pulumi"' in env.lock_file.read_text() and then calls subprocess.run to run
install-pulumi-cli.sh) is skipped when
generate_lock_file_only/--only-create-lock is set.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4c8c6789-5a07-4549-a1af-202df0bb77b1

📥 Commits

Reviewing files that changed from the base of the PR and between 7e437a3 and 6819bcf.

📒 Files selected for processing (7)
  • .claude/settings/permissions/bash.jsonc
  • .devcontainer/devcontainer.json
  • .devcontainer/manual-setup-deps.py
  • AGENTS.md
  • template/.github/actions/install_deps/action.yml.jinja-base
  • template/.github/workflows/pre-commit.yaml.jinja-base
  • template/template/.github/workflows/{% if template_uses_pulumi %}pulumi-aws.yml{% endif %}.jinja-base

@ejfine ejfine marked this pull request as ready for review March 30, 2026 11:10
@ejfine ejfine requested review from idonaldson and zendern March 30, 2026 11:10
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
.claude/settings/permissions/bash.jsonc (1)

96-103: ⚠️ Potential issue | 🟠 Major

The PR hard-block list is still incomplete.

Blocking gh pr review is not enough here: GitHub CLI still exposes separate PR-mutating commands such as gh pr comment, gh pr lock, gh pr reopen, gh pr revert, gh pr unlock, and gh pr update-branch, and none of them are denied in this block. That leaves Line 97’s “should not ever interfere with the PR process” policy only partially enforced. (cli.github.com)

Suggested deny expansion
       "Bash(gh pr create *)",
+      "Bash(gh pr comment *)",
       "Bash(gh pr edit *)",
+      "Bash(gh pr lock *)",
       "Bash(gh pr ready *)",
+      "Bash(gh pr reopen *)",
       "Bash(gh pr review *)",
       "Bash(gh pr merge *)",
       "Bash(gh pr close *)",
+      "Bash(gh pr revert *)",
+      "Bash(gh pr unlock *)",
+      "Bash(gh pr update-branch *)",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/settings/permissions/bash.jsonc around lines 96 - 103, The PR
hard-block list is incomplete: extend the deny entries alongside the existing
"Bash(gh pr create *)", "Bash(gh pr edit *)", "Bash(gh pr ready *)", "Bash(gh pr
review *)", "Bash(gh pr merge *)", "Bash(gh pr close *)" to also include other
PR-mutating GitHub CLI commands such as "Bash(gh pr comment *)", "Bash(gh pr
lock *)", "Bash(gh pr reopen *)", "Bash(gh pr revert *)", "Bash(gh pr unlock
*)", and "Bash(gh pr update-branch *)" so the intent from the comment (“should
not ever interfere with the PR process”) is fully enforced.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.claude/settings/permissions/bash.jsonc:
- Around line 96-103: The PR hard-block list is incomplete: extend the deny
entries alongside the existing "Bash(gh pr create *)", "Bash(gh pr edit *)",
"Bash(gh pr ready *)", "Bash(gh pr review *)", "Bash(gh pr merge *)", "Bash(gh
pr close *)" to also include other PR-mutating GitHub CLI commands such as
"Bash(gh pr comment *)", "Bash(gh pr lock *)", "Bash(gh pr reopen *)", "Bash(gh
pr revert *)", "Bash(gh pr unlock *)", and "Bash(gh pr update-branch *)" so the
intent from the comment (“should not ever interfere with the PR process”) is
fully enforced.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 12618970-1509-4a40-a106-e5e81d1528d1

📥 Commits

Reviewing files that changed from the base of the PR and between 6819bcf and eea3fe8.

📒 Files selected for processing (3)
  • .claude/settings/permissions/bash.jsonc
  • .devcontainer/devcontainer.json
  • .devcontainer/manual-setup-deps.py

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@AGENTS.md`:
- Line 55: Update the contradictory guidance so there's one rule: prohibit using
`pnpm --prefix <path>`, `uv --directory <path>`, or `cd &&` chains and require
using absolute paths (or commands that include absolute paths) when running
terminal commands; remove the allowance that permits a separate `cd <path>` call
and instead state that the working directory should be set outside agent
commands or ensured by the caller, and that the cwd persistence between Bash
tool calls may not be relied on—always prefer absolute paths to avoid breaking
the permission allow-list matcher.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b516dc51-5bcb-410e-82cf-362de18ec4a6

📥 Commits

Reviewing files that changed from the base of the PR and between eea3fe8 and 469f0ce.

📒 Files selected for processing (1)
  • AGENTS.md

- For linting and type-checking, prefer `pre-commit run <hook-id>` over invoking tools directly — this matches the permission allow-list and mirrors what CI runs. Key hook IDs: `typescript-check`, `eslint`, `pyright`, `ruff`, `ruff-format`.
- Never rely on IDE diagnostics for ruff warnings — the IDE may not respect the project's ruff.toml config. Run `pre-commit run ruff -a` to get accurate results.
- When running terminal commands, execute exactly one command per tool call. Do not chain commands with &&, ||, ;, or & — this prohibition has no exceptions, even for `cd && ...` patterns. Use absolute paths instead of `cd` to avoid needing to chain. Pipes (|) are allowed for output transformation (e.g., head, tail, grep). If two sequential commands are needed, run them in separate tool calls. Chained commands break the permission allow-list matcher and cause unnecessary permission prompts
- Never use `pnpm --prefix <path>` or `uv --directory <path>` to target a different directory — these flags break the permission allow-list matcher the same way chained `cd &&` commands do. Instead, rely on the working directory already being correct (the cwd persists between Bash tool calls), or issue a plain `cd <path>` as a separate prior tool call to reposition before running the command.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Resolve contradiction with Line 54 about cd usage.

Line 55 allows a separate cd <path> call, but Line 54 says to use absolute paths instead of cd. Please reconcile into one consistent rule so agents don’t get conflicting directives.

Based on learnings: "When running terminal commands... Use absolute paths instead of cd to avoid needing to chain."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` at line 55, Update the contradictory guidance so there's one rule:
prohibit using `pnpm --prefix <path>`, `uv --directory <path>`, or `cd &&`
chains and require using absolute paths (or commands that include absolute
paths) when running terminal commands; remove the allowance that permits a
separate `cd <path>` call and instead state that the working directory should be
set outside agent commands or ensured by the caller, and that the cwd
persistence between Bash tool calls may not be relied on—always prefer absolute
paths to avoid breaking the permission allow-list matcher.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
AGENTS.md (1)

54-55: ⚠️ Potential issue | 🟠 Major

Resolve conflicting directory-execution guidance (cd vs absolute paths).

These lines now instruct using separate cd calls and relying on cwd persistence, which conflicts with the established rule to use absolute paths and avoid cd-dependent flows. Please keep one consistent rule to prevent allow-list mismatches and brittle command behavior.

Based on learnings: "When running terminal commands, execute exactly one command per tool call. Do not chain commands with &&, ||, ;, or &. Use absolute paths instead of cd to avoid needing to chain. Pipes (|) are allowed for output transformation."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` around lines 54 - 55, The two bullets conflict over whether to use
cd/cwd persistence or absolute paths; choose the absolute-path rule and
remove/replace the cd/cwd guidance: update the first bullet ("When running
terminal commands, execute exactly one command per tool call. Do not chain...
Use `cd` to change to the directory you want before running the command...") to
instead require absolute paths (e.g., "Use absolute paths rather than changing
directories or chaining commands") and remove the sentence about cwd
persistence, and update the second bullet ("Never use `pnpm --prefix <path>` or
`uv --directory <path>`... Instead, rely on the working directory... or issue a
plain `cd <path>`") to explicitly forbid `pnpm --prefix` and `uv --directory`
and instruct contributors to use absolute paths for targets or run a single
prior tool call that uses an absolute path; ensure both bullets consistently
reference and prohibit chaining (&&, ||, ;, &) and allow pipes (|).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/settings/permissions/bash.jsonc:
- Around line 96-106: The deny list for GitHub PR commands omits the mutating
action to reopen PRs; add the entry "Bash(gh pr reopen *)" alongside the other
denied commands (e.g., "Bash(gh pr create *)", "Bash(gh pr edit *)") so that
reopen operations are blocked as intended; update the permissions array to
include this exact string to ensure "gh pr reopen" is treated as a denied Bash
action.

---

Duplicate comments:
In `@AGENTS.md`:
- Around line 54-55: The two bullets conflict over whether to use cd/cwd
persistence or absolute paths; choose the absolute-path rule and remove/replace
the cd/cwd guidance: update the first bullet ("When running terminal commands,
execute exactly one command per tool call. Do not chain... Use `cd` to change to
the directory you want before running the command...") to instead require
absolute paths (e.g., "Use absolute paths rather than changing directories or
chaining commands") and remove the sentence about cwd persistence, and update
the second bullet ("Never use `pnpm --prefix <path>` or `uv --directory
<path>`... Instead, rely on the working directory... or issue a plain `cd
<path>`") to explicitly forbid `pnpm --prefix` and `uv --directory` and instruct
contributors to use absolute paths for targets or run a single prior tool call
that uses an absolute path; ensure both bullets consistently reference and
prohibit chaining (&&, ||, ;, &) and allow pipes (|).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: cb85ee48-4e44-46a2-80bc-3171287d2cdd

📥 Commits

Reviewing files that changed from the base of the PR and between 469f0ce and 53495f3.

📒 Files selected for processing (3)
  • .claude/settings/permissions/bash.jsonc
  • AGENTS.md
  • template/template/.github/workflows/{% if template_uses_pulumi %}pulumi-aws.yml{% endif %}.jinja-base

Comment on lines +96 to +106
// 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 *)",
"Bash(gh pr comment *)",
"Bash(gh pr update-branch *)",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Consider adding gh pr reopen * to the deny list.

The deny list comprehensively blocks PR mutation commands, but gh pr reopen * is missing. Reopening a closed PR is a mutating operation that could interfere with the PR process, which contradicts the stated intent in the comment on lines 97-98.

Suggested fix
       "Bash(gh pr close *)",
       "Bash(gh pr comment *)",
       "Bash(gh pr update-branch *)",
+      "Bash(gh pr reopen *)",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// 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 *)",
"Bash(gh pr comment *)",
"Bash(gh pr update-branch *)",
// 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 *)",
"Bash(gh pr comment *)",
"Bash(gh pr update-branch *)",
"Bash(gh pr reopen *)",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/settings/permissions/bash.jsonc around lines 96 - 106, The deny list
for GitHub PR commands omits the mutating action to reopen PRs; add the entry
"Bash(gh pr reopen *)" alongside the other denied commands (e.g., "Bash(gh pr
create *)", "Bash(gh pr edit *)") so that reopen operations are blocked as
intended; update the permissions array to include this exact string to ensure
"gh pr reopen" is treated as a denied Bash action.

@ejfine ejfine merged commit f01259a into main Mar 30, 2026
7 checks passed
@ejfine ejfine deleted the agents-all-day branch March 30, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants