Gate external ingest on policy on token#316142
Draft
mjbvz wants to merge 1 commit into
Draft
Conversation
This allows enterprises to opt out of external ingest
f9cf0af to
95c4bd8
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an enterprise policy gate (driven by a Copilot token flag) to control whether “external ingest” for workspace chunk search is allowed, and wires that policy into a VS Code context key for command enablement.
Changes:
- Gate
CodeSearchChunkSearch.isExternalIngestEnabled()on a new token flag (blackbird_external_indexing). - Add
CopilotToken.isBlackbirdExternalIndexingEnabled()with accompanying unit tests. - Introduce a new context key (
github.copilot.blackbirdExternalIndexingDisabled) and use it to enable/disable thedeleteExternalIngestWorkspaceIndexdeveloper command.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/platform/workspaceChunkSearch/node/codeSearch/codeSearchChunkSearch.ts | Adds token-based gating before reading the external ingest experiment config. |
| extensions/copilot/src/platform/authentication/test/node/copilotToken.spec.ts | Adds unit tests for the new token flag helper. |
| extensions/copilot/src/platform/authentication/common/copilotToken.ts | Introduces isBlackbirdExternalIndexingEnabled() for reading token policy. |
| extensions/copilot/src/extension/contextKeys/vscode-node/contextKeys.contribution.ts | Adds/updates a context key reflecting whether external indexing is disabled by token policy. |
| extensions/copilot/package.json | Uses the new context key to conditionally enable the delete-external-ingest command. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 2
| const copilotToken = await this._authenticationService.getCopilotToken(); | ||
| commands.executeCommand('setContext', blackbirdExternalIndexingDisabledContextKey, !copilotToken.isBlackbirdExternalIndexingEnabled()); | ||
| } catch (e) { | ||
| commands.executeCommand('setContext', blackbirdExternalIndexingDisabledContextKey, undefined); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows enterprises to opt out of external ingest