Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 2395dd6

Browse files
chore(code-search): disable codemonitoring dotcom (jscontext) (#63465)
[Slack Context](https://sourcegraph.slack.com/archives/C07KZF47K/p1719302853433329) We have code monitoring disabled on Dotcom, however in jscontext, it's not disabled, this PR fixes that.
1 parent a426134 commit 2395dd6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

cmd/frontend/internal/app/jscontext/jscontext.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ func NewJSContextFromRequest(req *http.Request, db database.DB) JSContext {
372372

373373
codyEnabled, _ := cody.IsCodyEnabled(ctx, db)
374374

375+
isDotComMode := dotcom.SourcegraphDotComMode()
376+
375377
// 🚨 SECURITY: This struct is sent to all users regardless of whether or
376378
// not they are logged in, for example on an auth.public=false private
377379
// server. Including secret fields here is OK if it is based on the user's
@@ -401,7 +403,7 @@ func NewJSContextFromRequest(req *http.Request, db database.DB) JSContext {
401403
NeedServerRestart: globals.ConfigurationServerFrontendOnly.NeedServerRestart(),
402404
DeployType: deploy.Type(),
403405

404-
SourcegraphDotComMode: dotcom.SourcegraphDotComMode(),
406+
SourcegraphDotComMode: isDotComMode,
405407

406408
BillingPublishableKey: BillingPublishableKey,
407409

@@ -443,10 +445,11 @@ func NewJSContextFromRequest(req *http.Request, db database.DB) JSContext {
443445

444446
// This used to be hardcoded configuration on the frontend.
445447
// https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph@ec5cc97a11c3f78743388b85b9ae0f1bc5d43932/-/blob/client/web/src/enterprise/EnterpriseWebApp.tsx?L63-71
446-
CodeIntelligenceEnabled: true,
447-
SearchContextsEnabled: true,
448-
NotebooksEnabled: true,
449-
CodeMonitoringEnabled: true,
448+
CodeIntelligenceEnabled: true,
449+
SearchContextsEnabled: true,
450+
NotebooksEnabled: true,
451+
// Code monitoring should be disabled on DotCom.
452+
CodeMonitoringEnabled: !isDotComMode,
450453
SearchAggregationEnabled: true,
451454
OwnEnabled: true,
452455

0 commit comments

Comments
 (0)