Repository navigation
ref(devenv): Remove scripts/do.sh and scripts/lib.sh, slim .envrc - #129411
Open
sentry-junior[bot] wants to merge 3 commits into
Open
sentry-junior[bot] wants to merge 3 commits into
sentry-junior[bot] wants to merge 3 commits into
Conversation
.envrc mixed activation with diagnosis and repair: it sourced scripts/lib.sh, launched xcode-select, deleted shadowing executables, hard-failed on a node mismatch, and teed its own output to a tempfile. It now only sets environment variables and PATH, with one cheap `devenv sync` hint. - PATH order is explicit: global devenv, .venv/bin, .devenv/bin, node_modules/.bin, gcloud, homebrew. The venv outranks every other checkout directory, so the executable-deletion loop is gone; the package.json postinstall still drops node_modules/.bin/sentry for pnpm. - dotenv_if_exists watches .env while it's absent. - The node, node_modules, prek, and agent-skill checks move to devenv/checks/synced.py for `devenv doctor`. - The Make targets that dispatched through do.sh keep their names. The database ones go through tools/dev_db.py, which treats an existing database as success but surfaces every other createdb failure (the shell version ignored all of them). reset-db is one ordered invocation, so `make -j` can't interleave it. - devenv sync calls tools.dev_db directly instead of `make apply-migrations`. - CI: the dev env workflow now watches devenv/** and checks direnv activation; migrations-drift runs when tools/dev_db.py or the Makefile change. Co-Authored-By: Joshua Li <14209781+joshuarli@users.noreply.github.com>
1.31.0 includes getsentry/devenv#251, so repo-defined doctor checks, including the one added in this PR, now load. Co-Authored-By: opencode (DeepSeek V4.1 Flash) <opencode@local>
joshuarli
marked this pull request as ready for review
October 31, 2026 13:35
joshuarli
approved these changes
Oct 31, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
.envrchad grown into activation, diagnosis, and repair all at once: it sourcedscripts/lib.sh, could launchxcode-select --install, deleted shadowingsentryexecutables in a loop, hard-failed on a node version mismatch, and teed its own output to a tempfile. This cuts it from 238 lines to about 45, so it only sets environment variables and PATH, plus one cheapdevenv synchint.scripts/do.shandscripts/lib.share deleted.Activation
.venv/bin,.devenv/bin,node_modules/.bin, gcloud, homebrew. The venv outranks every other checkout directory, so the deletion loop isn't needed. Thepackage.jsonpostinstall still removesnode_modules/.bin/sentryfor pnpm script runs.devenvstill resolves to the global install, as it did before. gcloud moves from first place to just above homebrew.dotenv_if_existsreplaces the[ -f .env ]guard, so creating.envnow triggers a reload too.SENTRY_DEVSERVICES_DSNand theSENTRY_DEVENV_NO_REPORTopt-out are unchanged. TheXDG_*exports fromlib.share gone; onlySENTRY_DEVENV_HOMEneeded one.node_modules, prek, and agent-skill checks move todevenv/checks/synced.pyfordevenv doctor. Its fix runsdevenv sync.Make targets. All eight keep their names, since migrations-drift CI,
quick_drift_compare.py,test-cli, and people's fingers use them. The trivial ones are plain recipes. The database ones go throughtools/dev_db.py:createtreats "already exists" as success but surfaces every othercreatedbfailure. The shell version swallowed all of them with|| true, including a stopped Postgres container.reset-dbis one ordered invocation, somake -jcan't interleave drop, upgrade, and createuser.sentry upgrade --noinputand the existing CI vs. local superuser behavior.devenv synccalls.venv/bin/python -m tools.dev_db migratedirectly instead of going through Make →do.sh→lib.sh.CI. The dev env workflow now runs on
devenv/**changes and checks that.envrcloads under direnv withsentryresolving to the venv. migrations-drift now also runs ontools/dev_db.pyandMakefilechanges.Merge order
.envrcsources this one and calls theinfo/warn/require/show_commands_infohelpers being deleted here. That PR switches to direnv's stdlib and works with both the old and new sentry.envrc.sentry-devenvpin here is now>=1.31.0.via @joshuarli.
--
View Session [Sentry]