Skip to content

Comments

Implement direnv#2240

Merged
alexrichey merged 2 commits intomainfrom
ar-envrc
Feb 19, 2026
Merged

Implement direnv#2240
alexrichey merged 2 commits intomainfrom
ar-envrc

Conversation

@alexrichey
Copy link
Contributor

@alexrichey alexrichey commented Feb 18, 2026

Never futz with your BUILD_ENGINE or BUILD_ENGINE_SERVER ever again!

Changes

Add .envrc Files

Adds .envrc files to pluto and facilities. These will set up your environment for you, namely:

  • make certain paths absolute, which is lovely for things like docker-compose.
  • set up your build engine stuff:
    • calculate your schema, based on your branch. (you can override this in the product .envs themselves)
    • so when you cd into products/pluto/ it will set your BUILD_ENGINE_DB to db-pluto, and calculate the build engine, etc.

Add /bash/bin

These are mostly just wrappers around existing bash utils. But this is the preferred way to do it for exporting functions. I think this is a pretty sweet setup... in your terminal you can just type dcp_ and tab-complete to have these fns immediately available. No more sourcing the utils files.

Setup Instructions

Install direnv and make sure to note the requirement to add the direnv hook to your shell.

Then once you cd into a directory with a .envrc you'll need to run direnv allow once to enable direnv.

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.00%. Comparing base (b695d9c) to head (00976be).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

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

@alexrichey alexrichey force-pushed the ar-envrc branch 4 times, most recently from 662637b to b7f61b6 Compare February 19, 2026 16:07
@alexrichey alexrichey marked this pull request as ready for review February 19, 2026 16:11
@alexrichey alexrichey requested review from damonmcc and fvankrieken and removed request for damonmcc and fvankrieken February 19, 2026 16:15
Comment on lines +17 to +24
watch_file .git/HEAD
CURRENT_BRANCH=$(git branch --show-current 2>/dev/null)
if [ -n "$CURRENT_BRANCH" ] && [ "$CURRENT_BRANCH" != "main" ]; then
# Convert to lowercase and replace dashes with underscores
export BUILD_ENGINE_SCHEMA=$(echo "$CURRENT_BRANCH" | tr '[:upper:]' '[:lower:]' | tr '-' '_')
else # On main branch
unset BUILD_ENGINE_SCHEMA
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Incredible

Shouldn't the unset be setting it to 'main' instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you know... I was thinking we'd just never want to build locally against main accidentally. And I suppose you could also just set the BUILD_ENGINE_SCHEMA=main if you wanted to intentionally. But maybe this is a little over-protective

Copy link
Contributor

@fvankrieken fvankrieken left a comment

Choose a reason for hiding this comment

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

The only way I could love this PR more is if I was staying here longer.

Should we add this for other products? Then just do away with a bunch of the env vars in github actions? I think we could also do away with "bash/build_env_setup.sh"

(Oh though then we'd also need direnv in the build images - a little more work)

@alexrichey alexrichey merged commit 9db0156 into main Feb 19, 2026
24 checks passed
@alexrichey alexrichey deleted the ar-envrc branch February 19, 2026 20:26
@alexrichey
Copy link
Contributor Author

The only way I could love this PR more is if I was staying here longer.

Should we add this for other products? Then just do away with a bunch of the env vars in github actions? I think we could also do away with "bash/build_env_setup.sh"

(Oh though then we'd also need direnv in the build images - a little more work)

@fvankrieken Yeah, will add for other products next week (feel free to do this without me on Friday though!)

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