You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[devbox] run: skip re-computing Devbox State if in devbox shell (#2144)
## Summary
This PR implements a change to the semantics of `devbox run`.
BEFORE:
`devbox run` would always ensure that the Devbox State and Environment
is up-to-date.
AFTER:
`devbox run` will only do so when _outside_ a Devbox Environment (i.e.
`devbox shell` or equivalent like direnv-enabled shell).
The motivation is two fold:
1. Speed. Users often want to just run a quick script, this slows them
down.
2. Users often have init-hooks which are more appropriate for one-time
setup, rather than when running a utility script inside a `devbox shell`
that has already been set up appropriately.
This was shared in the Discord channel for feedback:
https://discord.com/channels/903306922852245526/1009933892385517619/1248724103750483978
Notably, the focus there was on skipping the init-hooks, but in this PR,
we are going one-step beyond that to ensure the Devbox State itself is
not re-computed. The reason is that rather than _partially_ updating the
Devbox State and Environment (partially, because init-hooks are part of
setting up the environment) we'd rather eschew the step entirely. This
feels more straightforward for users to reason about.
## How was it tested?
Did a basic sanity test in two scenarios:
1. Running the script in a `devbox shell` or direnv-enabled environment
does NOT recompute the Devbox state.
2. Repeated the sanity test when outside of the Devbox environment, and
confirmed it does recompute the Devbox state.
0 commit comments