Skip to content

Update Pulumi stack selection/refactor logic into Mask command#649

Merged
forstmeier merged 2 commits intomasterfrom
launch-infrastructure-pulumi-fixes
Dec 26, 2025
Merged

Update Pulumi stack selection/refactor logic into Mask command#649
forstmeier merged 2 commits intomasterfrom
launch-infrastructure-pulumi-fixes

Conversation

@forstmeier
Copy link
Copy Markdown
Collaborator

@forstmeier forstmeier commented Dec 26, 2025

Overview

Changes

  • add Pulumi organization fetch
  • refactor logic into Mask up command

Comments

More fixes and cleanup.

Summary by CodeRabbit

  • Chores
    • Reworked deployment flow to consolidate and relocate stack initialization steps.
    • Added a pre-flight validation and explicit stack selection/create path with clearer error handling.
    • Removed a redundant initialization step so deployment proceeds more directly after installation, improving reliability and transparency of the deployment process.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 26, 2025

Note

Other AI code review bot(s) detected

CodeRabbit 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.

Walkthrough

The Pulumi stack initialization responsibility shifts from the GitHub Actions workflow to a pre-flight step in the repository. The workflow .github/workflows/launch_infrastructure.yaml removes the dedicated "Initialize Pulumi stack" step and proceeds directly from "Install Flox" to "Deploy with Pulumi." maskfile.md adds pre-flight logic: it runs pulumi whoami to obtain/validate the organization, then runs pulumi stack select ${organization_name}/pocketsizefund/production --create before invoking pulumi up --diff --yes, including an explicit error exit on failure.

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
Loading

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: moving Pulumi stack selection logic from the workflow into the Mask command, which aligns with the PR description and file modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch launch-infrastructure-pulumi-fixes

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1319766 and b615fb4.

📒 Files selected for processing (1)
  • maskfile.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • 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

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
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 up command 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.

Comment thread maskfile.md
Comment thread maskfile.md Outdated
Copy link
Copy Markdown
Contributor

@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: 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 production flag 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:

  1. Relying solely on the selected stack (remove --stack production from line 117), or
  2. 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 --yes

Based 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

📥 Commits

Reviewing files that changed from the base of the PR and between 86bcb8a and 1319766.

📒 Files selected for processing (2)
  • .github/workflows/launch_infrastructure.yaml
  • maskfile.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.yaml confirms the project name is "pocketsizefund", and the stack reference format ${organization_name}/pocketsizefund/production aligns with the expected naming convention. With set -euo pipefail in place, any failure from pulumi whoami will halt execution, preventing invalid stack references.

Note: Line 18 includes --stack production which is redundant after pulumi stack select has already set the stack, though this doesn't cause functional issues.

@forstmeier forstmeier merged commit 39da526 into master Dec 26, 2025
4 checks passed
@forstmeier forstmeier deleted the launch-infrastructure-pulumi-fixes branch December 26, 2025 21:10
@coderabbitai coderabbitai Bot mentioned this pull request Feb 12, 2026
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