Skip to content

feat: add userdata support - #10

Merged
dwhswenson merged 4 commits into
omsf-eco-infra:mainfrom
ethanholz:feat/userdata
Mar 30, 2026
Merged

dwhswenson merged 4 commits into
omsf-eco-infra:mainfrom
ethanholz:feat/userdata

Conversation

@ethanholz

Copy link
Copy Markdown
Contributor

This pull request enhances the DevBox CLI and launch script with improved option handling, user data script support, and overall code consistency. The most significant update is the addition of a --userdata-file option to allow passing a cloud-init script when launching a new EC2 instance. Additionally, the code has been refactored for better readability and consistency, especially in argument parsing and dictionary key usage.

User data script support:

  • Added a --userdata-file option to the launch CLI command and the launch_programmatic interface, allowing users to specify a cloud-init format script to be passed as instance user data. This includes a new read_userdata_file helper and the necessary wiring in both cli.py and launch.py to read and pass the file contents. [1] [2] [3] [4] [5]

CLI and argument parsing improvements:

  • Standardized the use of double quotes for Click argument and option names, and restructured multi-line option definitions for clarity in cli.py. [1] [2] [3] [4]
  • Updated the argument parser in launch.py to use more readable multi-line calls and consistent double quotes.

General code consistency and cleanup:

  • Improved dictionary key usage throughout the CLI to use double quotes for consistency. [1] [2] [3] [4]
  • Minor improvements to error handling, code formatting, and documentation for better maintainability and clarity. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

This PR chooses not to store userdata in AWS because you most likely will not rerun userdata on every launch since most of the time it is used to populate the home directory. This enables you to also use other scripts on launching the new instance if needed.

@ethanholz
ethanholz requested a review from Copilot February 2, 2026 19:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@ethanholz
ethanholz requested a review from Copilot February 2, 2026 20:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/devbox/launch.py Outdated
Comment thread src/devbox/launch.py Outdated
@ethanholz
ethanholz requested a review from dwhswenson February 3, 2026 17:51
@ethanholz

Copy link
Copy Markdown
Contributor Author

@dwhswenson this is ready for review whenever you are!

@codecov

codecov Bot commented Feb 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.75%. Comparing base (bbeadcd) to head (acd1568).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #10      +/-   ##
==========================================
+ Coverage   99.73%   99.75%   +0.01%     
==========================================
  Files          13       13              
  Lines        2690     2818     +128     
==========================================
+ Hits         2683     2811     +128     
  Misses          7        7              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dwhswenson dwhswenson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Finally got that merge done! LGTM

@dwhswenson
dwhswenson merged commit 1a63771 into omsf-eco-infra:main Mar 30, 2026
5 checks passed
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