Skip to content

[perf] skip forcing printDevEnv when add/rm/update outside shellenv #1540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 11, 2023

Conversation

savil
Copy link
Collaborator

@savil savil commented Oct 6, 2023

Summary

In this PR, we skip forcing computeNixEnv if a user is adding/removing/updating packages, AND if we are not in a shellenv-enabled environment from that devbox project.

Also:

  • rename ensurePackagesAreInstalled to ensureDevboxEnvIsUpToDate
  • some minor comment cleanups

How was it tested?

did devbox add vim when:

  1. in devbox project's directory, but direnv disabled => did not print "Recomputing Devbox environment."
  2. in devbox project's directory with direnv enabled => did print "Recomputing Devbox environment".
  3. in devbox shell => did print again

Repeated the same exercise with devbox global:

  1. with devbox global shellenv | source run in shellrc => did print "Recomputing Devbox environment".
  2. after commenting out that line in shellrc => did not print
    NOTE: there's no special devbox-global specific code change here.

Copy link
Collaborator Author

savil commented Oct 6, 2023

@savil savil requested a review from mikeland73 October 6, 2023 23:57
@savil savil force-pushed the savil/print-dev-env-less-for-add-rm branch 2 times, most recently from 0d3169c to 6ca1aea Compare October 7, 2023 00:24
@savil savil force-pushed the savil/print-dev-env-less-for-add-rm branch 2 times, most recently from 52c491b to 85a4b9a Compare October 10, 2023 18:04
@savil savil marked this pull request as ready for review October 10, 2023 18:04
@savil
Copy link
Collaborator Author

savil commented Oct 10, 2023

I forgot to mark this as Ready for Review on Friday!

@savil savil force-pushed the savil/print-dev-env-less-for-add-rm branch from 85a4b9a to 609f2bc Compare October 11, 2023 12:54
@savil savil merged commit b6d0b20 into main Oct 11, 2023
@savil savil deleted the savil/print-dev-env-less-for-add-rm branch October 11, 2023 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants