Skip to content

Add automated infrastructure lifecycle management workflow#596

Merged
chrisaddy merged 1 commit intomasterfrom
06-09-add_automated_infrastructure_lifecycle_management_workflow
Jun 13, 2025
Merged

Add automated infrastructure lifecycle management workflow#596
chrisaddy merged 1 commit intomasterfrom
06-09-add_automated_infrastructure_lifecycle_management_workflow

Conversation

@forstmeier
Copy link
Copy Markdown
Collaborator

@forstmeier forstmeier commented Jun 10, 2025

Overview

Changes

  • add launch/teardown automated workflow

Comments

Not sure if we want this right just now but it should be something we include soon. We'll also want to monitor costs but IDK what that looks like currently.

Summary by CodeRabbit

  • Chores
    • Introduced a scheduled workflow to automatically launch and tear down infrastructure twice daily on weekdays.

Copilot AI review requested due to automatic review settings June 10, 2025 01:11
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 10, 2025

Walkthrough

A new GitHub Actions workflow file has been added to automate infrastructure management. It schedules two weekday jobs: one at 13:00 UTC to launch infrastructure and another at 23:00 UTC to tear it down. Both jobs run Pulumi commands within a Flox environment using secrets for authentication.

Changes

File(s) Change Summary
.github/workflows/lifecycle.yaml Added scheduled workflow with two jobs (launch and teardown) running Pulumi commands to deploy and dismantle infrastructure on weekdays.

Poem

At sunrise we build, at sunset we rest,
With Pulumi and Flox, our scripts are the best.
The clouds rise and fall on a schedule so neat,
Infrastructure’s dance, on GitHub repeat.
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 588fee9 and f8682ed.

📒 Files selected for processing (1)
  • .github/workflows/lifecycle.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/lifecycle.yaml
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Run Python tests

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@forstmeier forstmeier requested a review from chrisaddy June 10, 2025 01:12
Copy link
Copy Markdown
Collaborator Author

forstmeier commented Jun 10, 2025

@forstmeier forstmeier added this to the Refactor milestone Jun 10, 2025
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 introduces a new GitHub Actions workflow that automates the lifecycle management of infrastructure by scheduling launch and teardown jobs using Pulumi.

  • Adds a new workflow file (.github/workflows/lifecycle.yaml) with two jobs (launch and teardown) triggered by distinct cron schedules.
  • Integrates third-party actions to check out code, install necessary tooling, and execute infrastructure commands.
Comments suppressed due to low confidence (1)

.github/workflows/lifecycle.yaml:25

  • The command 'nu ping.nu' is unclear in purpose. Please add a comment explaining its role in the workflow to improve clarity.
nu ping.nu

Comment thread .github/workflows/lifecycle.yaml Outdated
Comment thread .github/workflows/lifecycle.yaml Outdated
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Jun 10, 2025

Graphite Automations

"Assign author to pull request" took an action on this PR • (06/10/25)

1 assignee was added to this PR based on John Forstmeier's automation.

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 (3)
.github/workflows/lifecycle.yaml (3)

3-6: Add manual trigger and clarify timezone in schedule
The on.schedule block only fires on two cron events, and the comments reference “EST” which shifts to EDT in summer. Consider:

  • Adding a workflow_dispatch trigger for ad-hoc runs.
  • Clarifying/removing local time comments or noting “Eastern Time (UTC-5/UTC-4)” to avoid confusion.

8-11: Verify GitHub environment and protect secrets
Both jobs use environment: pulumi to surface credentials (e.g. AWS keys) and enforce approvals. Ensure the pulumi environment exists in repo settings with all required secrets (PULUMI_ACCESS_TOKEN, cloud-provider creds) and any protection rules. Also consider adding:

  • A concurrency key to prevent overlapping deploy/teardown runs.
  • A branch filter (e.g. branches: [main]) if you only want this on your default branch.

Also applies to: 27-29


19-25: Refactor steps for maintainability and consistency

  • Use the step-level working-directory attribute instead of cd.
  • Verify that flox/activate-action@v1 accepts command (or if it should be script).
  • Ensure nu ping.nu runs inside the Flox environment (e.g. prefix with uv run nu).
  • Explicitly pass --stack or set PULUMI_STACK if you manage multiple stacks.

Example diff:

-      - name: Deploy with Pulumi
-        uses: flox/activate-action@v1
-        env:
-          PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
-        with:
-          command: |
-            cd infrastructure
-            uv run pulumi up --yes
-            nu ping.nu
+      - name: Deploy with Pulumi
+        uses: flox/activate-action@v1
+        working-directory: infrastructure
+        env:
+          PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
+        with:
+          command: |
+            pulumi up --yes --stack ${{ secrets.PULUMI_STACK }}
+            uv run nu ping.nu

Repeat the same refactor for the teardown job.

Also applies to: 37-42

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between df92352 and 588fee9.

📒 Files selected for processing (1)
  • .github/workflows/lifecycle.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Run Python tests

chrisaddy
chrisaddy previously approved these changes Jun 10, 2025
Copy link
Copy Markdown
Collaborator

@chrisaddy chrisaddy left a comment

Choose a reason for hiding this comment

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

I would make this like 8am just to be safe? otherwise I think this is good

@forstmeier forstmeier force-pushed the 06-09-add_automated_infrastructure_lifecycle_management_workflow branch from 588fee9 to f8682ed Compare June 11, 2025 01:32
@forstmeier
Copy link
Copy Markdown
Collaborator Author

@chrisaddy I adjusted the window and this is good for another review (the Copilot feedback was incorrect according to GitHub docs).

@chrisaddy chrisaddy merged commit 082251b into master Jun 13, 2025
6 checks passed
@chrisaddy chrisaddy deleted the 06-09-add_automated_infrastructure_lifecycle_management_workflow branch June 13, 2025 12:24
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.

3 participants