Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Merged
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
8 changes: 8 additions & 0 deletions enterprise/internal/insights/insights.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"strconv"

"github.com/sourcegraph/sourcegraph/cmd/frontend/enterprise"
"github.com/sourcegraph/sourcegraph/cmd/frontend/envvar"
"github.com/sourcegraph/sourcegraph/enterprise/internal/insights/resolvers"
"github.com/sourcegraph/sourcegraph/internal/conf"
"github.com/sourcegraph/sourcegraph/internal/database/dbconn"
Expand All @@ -17,6 +18,13 @@ import (

// IsEnabled tells if code insights are enabled or not.
func IsEnabled() bool {
if envvar.SourcegraphDotComMode() {
// Explicitly enabled for Sourcegraph.com currently, but not customer/user deployments.
if v, _ := strconv.ParseBool(os.Getenv("DISABLE_CODE_INSIGHTS")); v {
// Unless it's disabled / we need an escape hatch.
return false
}
}
if !conf.IsDev(conf.DeployType()) {
// Code Insights is not yet deployed to non-dev/testing instances. We don't yet have
// TimescaleDB in those deployments. https://github.com/sourcegraph/sourcegraph/issues/17218
Expand Down