Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/stacks/django/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
.venv/
__pycache__
.devbox.cloud
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ require (
github.com/denisbrodbeck/machineid v1.0.1
github.com/f1bonacc1/process-compose v1.122.0
github.com/fatih/color v1.19.0
github.com/fsnotify/fsnotify v1.10.1
github.com/getsentry/sentry-go v0.50.0
github.com/google/go-cmp v0.7.0
github.com/google/uuid v1.6.0
Expand Down Expand Up @@ -114,6 +113,7 @@ require (
github.com/f1bonacc1/go-health/v2 v2.1.6 // indirect
github.com/fatih/structtag v1.2.0 // indirect
github.com/firefart/nonamedreturns v1.0.8 // indirect
github.com/fsnotify/fsnotify v1.10.1 // indirect
github.com/fzipp/gocyclo v0.6.0 // indirect
github.com/ghostiam/protogetter v1.0.1 // indirect
github.com/go-critic/go-critic v0.15.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions internal/boxcli/midcobra/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func (m *telemetryMiddleware) postRun(cmd *cobra.Command, args []string, runErr

meta := telemetry.Metadata{
FeatureFlags: featureflag.All(),
CloudRegion: os.Getenv(envir.DevboxRegion),
CloudCache: os.Getenv(envir.DevboxCache),
}

Expand All @@ -80,7 +79,6 @@ func (m *telemetryMiddleware) postRun(cmd *cobra.Command, args []string, runErr
meta.Packages, meta.NixpkgsHash = getPackagesAndCommitHash()
meta.InShell = envir.IsDevboxShellEnabled()
meta.InBrowser = envir.IsInBrowser()
meta.InCloud = envir.IsDevboxCloud()

if runErr != nil {
telemetry.Error(runErr, meta)
Expand Down
2 changes: 0 additions & 2 deletions internal/envir/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const (
// DevboxLatestVersion is the latest version available of the devbox CLI binary.
// NOTE: it should NOT start with v (like 0.4.8)
DevboxLatestVersion = "DEVBOX_LATEST_VERSION"
DevboxRegion = "DEVBOX_REGION"
DevboxSearchHost = "DEVBOX_SEARCH_HOST"
DevboxShellEnabled = "DEVBOX_SHELL_ENABLED"
DevboxShellStartTime = "DEVBOX_SHELL_START_TIME"
Expand All @@ -29,7 +28,6 @@ const (
LauncherPath = "LAUNCHER_PATH"

GitHubUsername = "GITHUB_USER_NAME"
SSHTTY = "SSH_TTY"

XDGDataHome = "XDG_DATA_HOME"
XDGConfigHome = "XDG_CONFIG_HOME"
Expand Down
4 changes: 0 additions & 4 deletions internal/envir/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import (
"strings"
)

func IsDevboxCloud() bool {
return os.Getenv(DevboxRegion) != ""
}

func IsDevboxShellEnabled() bool {
inDevboxShell, _ := strconv.ParseBool(os.Getenv(DevboxShellEnabled))
return inDevboxShell
Expand Down
148 changes: 0 additions & 148 deletions internal/services/status.go

This file was deleted.

21 changes: 0 additions & 21 deletions internal/telemetry/segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ func newTrackMessage(name string, meta Metadata) *segment.Track {
"nix_version": nixVersion,
"packages": meta.Packages,
"shell": os.Getenv(envir.Shell),
"shell_access": shellAccess(),
},
}

Expand All @@ -94,23 +93,3 @@ func newTrackMessage(name string, meta Metadata) *segment.Track {
func bufferSegmentMessage(id string, msg segment.Message) {
bufferEvent(filepath.Join(segmentBufferDir, id+".json"), msg)
}

type shellAccessKind string

const (
local shellAccessKind = "local"
ssh shellAccessKind = "ssh"
browser shellAccessKind = "browser"
)

func shellAccess() shellAccessKind {
// Check if running in devbox cloud
if envir.IsDevboxCloud() {
// Check if running via ssh tty (i.e. ssh shell)
if os.Getenv(envir.SSHTTY) != "" {
return ssh
}
return browser
}
return local
}
8 changes: 1 addition & 7 deletions internal/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,12 @@ type Metadata struct {
FeatureFlags map[string]bool

InShell bool
InCloud bool
InBrowser bool

NixpkgsHash string
Packages []string

CloudRegion string
CloudCache string
CloudCache string
}

func (m *Metadata) cmdContext() map[string]any {
Expand All @@ -290,15 +288,11 @@ func (m *Metadata) cmdContext() map[string]any {
func (m *Metadata) envContext() map[string]any {
sentryCtx := map[string]any{
"In Shell": m.InShell,
"In Cloud": m.InCloud,
"In Browser": m.InBrowser,
}
if m.CloudCache != "" {
sentryCtx["Cloud Cache"] = m.CloudCache
}
if m.CloudRegion != "" {
sentryCtx["Cloud Region"] = m.CloudRegion
}
return sentryCtx
}

Expand Down
4 changes: 0 additions & 4 deletions internal/vercheck/vercheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ func CheckVersion(w io.Writer, commandPath string) {
return
}

if envir.IsDevboxCloud() {
return
}

hasSkipPrefix := lo.ContainsBy(
commandSkipList,
func(skipPath string) bool { return strings.HasPrefix(commandPath, skipPath) },
Expand Down
12 changes: 0 additions & 12 deletions internal/vercheck/vercheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@ func TestCheckVersion(t *testing.T) {
isDevBuild = false
t.Setenv(envir.XDGCacheHome, t.TempDir())

t.Run("skip_if_devbox_cloud", func(t *testing.T) {
defer os.Unsetenv(envName)
// if devbox cloud
t.Setenv(envir.DevboxRegion, "true")
buf := new(bytes.Buffer)
CheckVersion(buf, "devbox shell")
if buf.String() != "" {
t.Errorf("expected empty string, got %q", buf.String())
}
t.Setenv(envir.DevboxRegion, "")
})

// no launcher version or latest-version env var
t.Run("skip_if_no_launcher_version_or_latest_version", func(t *testing.T) {
defer os.Unsetenv(envName)
Expand Down
Loading