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

move legacy codeintel to enterprise#43578

Merged
sqs merged 4 commits into
mainfrom
sqs/codeintel-enterprise
Oct 28, 2022
Merged

move legacy codeintel to enterprise#43578
sqs merged 4 commits into
mainfrom
sqs/codeintel-enterprise

Conversation

@sqs

@sqs sqs commented Oct 28, 2022

Copy link
Copy Markdown
Member

The search-based code intelligence is an enterprise-only feature. This change clarifies it by showing a nicer message instead of an error if it's attempted to be used in the OSS build. It also cleans up how the enabled-or-not flag is determined in code.

Also cleans up other things related to code nav when running in OSS.

Test plan

Confirm the "unavailable" message shows up in OSS:

cina

Confirm the references panel still works in non-OSS:

cienabled

App preview:

Check out the client app preview documentation to learn more.

@cla-bot cla-bot Bot added the cla-signed label Oct 28, 2022
@sourcegraph-bot

sourcegraph-bot commented Oct 28, 2022

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff d817791...521e465.

Notify File(s)
@efritz client/web/src/enterprise/codeintel/searchBased.ts
client/web/src/enterprise/codeintel/sort.ts
client/web/src/enterprise/codeintel/useCodeIntel.ts
client/web/src/enterprise/codeintel/useSearchBasedCodeIntel.ts

sqs added 3 commits October 27, 2022 19:21
Fixes:

```
TypeError: Cannot read properties of undefined (reading 'fields')
    at API.hasStencils (api.ts:579:84)
```

Related to https://github.com/sourcegraph/sourcegraph/pull/43458, but that did not fully fix the issue (seemingly because the GitBlobLSIFData type is not even introspectible on OSS because LSIF is not available in OSS).
@sqs sqs force-pushed the sqs/codeintel-enterprise branch from b672b3d to 506523c Compare October 28, 2022 02:21
@sqs sqs requested a review from a team October 28, 2022 02:22
@sg-e2e-regression-test-bob

sg-e2e-regression-test-bob commented Oct 28, 2022

Copy link
Copy Markdown

Bundle size report 📦

Initial size Total size Async size Modules
1.07% (+31.13 kb) 🔺 0.00% (+0.22 kb) -0.26% (-30.91 kb) 🔽 -0.41% (-3) 🔽

Look at the Statoscope report for a full comparison between the commits 521e465 and 524e11d or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

@sqs sqs force-pushed the sqs/codeintel-enterprise branch from 506523c to 8d89e9a Compare October 28, 2022 03:22
The search-based code intelligence is an enterprise-only feature. This change clarifies it by showing a nicer message instead of an error if it's attempted to be used in the OSS build. It also cleans up how the enabled-or-not flag is determined in code.
@sqs sqs force-pushed the sqs/codeintel-enterprise branch from 8d89e9a to 521e465 Compare October 28, 2022 04:08

@olafurpg olafurpg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM to unblock merge 👍🏻

Is it expected that the popover still shows an error here?

CleanShot 2022-10-28 at 16 33 31@2x

@olafurpg

Copy link
Copy Markdown
Contributor

Ideally, we disable the injection of the legacy extension API around this file here https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/client/shared/src/extensions/createNoopLoadedController.ts?L23

@sqs

sqs commented Oct 28, 2022

Copy link
Copy Markdown
Member Author

@olafurpg Yes, I did not go so far to fix that. It basically swaps out one error for another error.

@sqs sqs merged commit 5348394 into main Oct 28, 2022
@sqs sqs deleted the sqs/codeintel-enterprise branch October 28, 2022 20:31
@olafurpg

Copy link
Copy Markdown
Contributor

What is the best way to detect that we're running OSS? As long as we have a boolean setting we can disable the injection

@sqs

sqs commented Oct 28, 2022

Copy link
Copy Markdown
Member Author

@olafurpg there's a codeIntelligenceEnabled boolean that's passed down

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants