Update Pulumi stack selection/refactor logic into Mask command#649
Update Pulumi stack selection/refactor logic into Mask command#649forstmeier merged 2 commits intomasterfrom
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThe Pulumi stack initialization responsibility shifts from the GitHub Actions workflow to a pre-flight step in the repository. The workflow Sequence Diagram(s)sequenceDiagram
autonumber
participant GH as GitHub Actions
participant Repo as maskfile.sh
participant PulumiCLI as Pulumi CLI
participant PulumiBackend as Pulumi Cloud
rect rgb(240,248,255)
Note over GH: Old flow (before PR)
GH->>PulumiCLI: Install Pulumi + Initialize stack (stack select/create)
PulumiCLI->>PulumiBackend: Authenticate / select or create stack
GH->>PulumiCLI: pulumi up --diff --yes
PulumiCLI->>PulumiBackend: Deploy changes
end
rect rgb(245,255,240)
Note over GH,Repo: New flow (after PR)
GH->>Repo: Run deployment step (calls maskfile)
Repo->>PulumiCLI: pulumi whoami (get organization)
PulumiCLI->>PulumiBackend: Authenticate / return org
Repo->>PulumiCLI: pulumi stack select ${org}/pocketsizefund/production --create
PulumiCLI->>PulumiBackend: select/create stack
Repo->>PulumiCLI: pulumi up --diff --yes
PulumiCLI->>PulumiBackend: Deploy changes
end
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR refactors Pulumi stack initialization logic by moving it from a separate GitHub Actions workflow step into the Mask up command. The changes consolidate stack management by dynamically fetching the Pulumi organization name and handling stack selection within the deployment script.
Key Changes:
- Removed dedicated "Initialize Pulumi stack" workflow step from GitHub Actions
- Added organization name fetching and stack selection logic to the Mask
upcommand in maskfile.md
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| maskfile.md | Added Pulumi organization fetch and stack selection with dynamic organization name before pulumi up |
| .github/workflows/launch_infrastructure.yaml | Removed redundant "Initialize Pulumi stack" workflow step |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
maskfile.md (1)
113-117: Clarify stack selection semantics for maintainability.After line 115 selects the stack with
pulumi stack select, the explicit--stack productionflag on line 117 is redundant since the stack is already selected. While this doesn't cause functional issues, it may create confusion about which selection takes precedence.For clarity, consider either:
- Relying solely on the selected stack (remove
--stack productionfrom line 117), or- Documenting why both are used
🔎 Option 1: Remove redundant flag
pulumi stack select ${organization_name}/pocketsizefund/production --create -pulumi up --diff --yes --stack production +pulumi up --diff --yesBased on learnings, the preferred Pulumi stack naming convention is
pocketsizefund/pocketsizefund/production(organization/repository/environment), so ensuring this pattern is correctly applied throughout is important for consistency.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/launch_infrastructure.yamlmaskfile.md
💤 Files with no reviewable changes (1)
- .github/workflows/launch_infrastructure.yaml
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: forstmeier
Repo: pocketsizefund/pocketsizefund PR: 613
File: infrastructure/Pulumi.yaml:1-10
Timestamp: 2025-08-15T13:54:49.230Z
Learning: The user forstmeier prefers Pulumi stack naming convention as `pocketsizefund/pocketsizefund/production` to maintain organization/repository/environment mapping pattern for the pocketsizefund project.
Learnt from: CR
Repo: pocketsizefund/pocketsizefund PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-23T16:45:01.573Z
Learning: Place Pulumi infrastructure as code in the `infrastructure/` folder
📚 Learning: 2025-08-15T13:54:49.230Z
Learnt from: forstmeier
Repo: pocketsizefund/pocketsizefund PR: 613
File: infrastructure/Pulumi.yaml:1-10
Timestamp: 2025-08-15T13:54:49.230Z
Learning: The user forstmeier prefers Pulumi stack naming convention as `pocketsizefund/pocketsizefund/production` to maintain organization/repository/environment mapping pattern for the pocketsizefund project.
Applied to files:
maskfile.md
📚 Learning: 2025-12-23T16:45:01.573Z
Learnt from: CR
Repo: pocketsizefund/pocketsizefund PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-23T16:45:01.573Z
Learning: Place Pulumi infrastructure as code in the `infrastructure/` folder
Applied to files:
maskfile.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Run Rust code checks
🔇 Additional comments (1)
maskfile.md (1)
113-115: Stack name construction is correct; project name verified in configuration.The assumptions are valid:
infrastructure/Pulumi.yamlconfirms the project name is "pocketsizefund", and the stack reference format${organization_name}/pocketsizefund/productionaligns with the expected naming convention. Withset -euo pipefailin place, any failure frompulumi whoamiwill halt execution, preventing invalid stack references.Note: Line 18 includes
--stack productionwhich is redundant afterpulumi stack selecthas already set the stack, though this doesn't cause functional issues.
Overview
Changes
upcommandComments
More fixes and cleanup.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.