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

chore(cody): allow setting "cody.contextFilters" in site config without feature flag#63881

Merged
taras-yemets merged 5 commits into
mainfrom
ty/remove-cody-context-filters-enabled-ff
Jul 18, 2024
Merged

chore(cody): allow setting "cody.contextFilters" in site config without feature flag#63881
taras-yemets merged 5 commits into
mainfrom
ty/remove-cody-context-filters-enabled-ff

Conversation

@taras-yemets

@taras-yemets taras-yemets commented Jul 17, 2024

Copy link
Copy Markdown
Contributor

Cody context filters support is now supported by default by all Cody clients (see also this thread). Thus we no longer need to gate instance admins from setting `"cody.contextFilters" in the site config as we know there's suffient feature support on the client side.
This PR is technically a revert of https://github.com/sourcegraph/sourcegraph/pull/62231.

Remove feature flag from s2 config:

Screenshot 2024-07-17 at 18 42 09 Screenshot 2024-07-17 at 18 42 40

Test plan

  • CI
  • Tested manually: "cody.contextFilters" can be st in the site config without having cody-context-filters-enabled feature flag enabled

Changelog

olafurpg and others added 3 commits July 16, 2024 16:28
Previously, Sourcegraph Enterprise instances with context filters
enabled rejected requests from all unknown clients out of concern that
they might not respect context filters. This behavior makes it
incredibly impractical to release now agent-based clients (CLI, Eclipse,
Visual Studio, Neovim, ..) that do respect context filters out of
the box thanks to the reused logic in the Cody agent.

This logic suffers from both false positives and false negatives:

- False negatives: upcoming Cody clients (CLI, Eclipse, Visual Studio)
  already support context filters out of the box thanks to using the
  Cody agent but they can't send requests unless we add a special case
  to them.
- False positive: a malicious client can always fake that it's
  "jetbrains" with a valid version number even if the client doesn't
  respect context filters. This gives a false sense of security because
  it doesn't prevent malicious traffic from bypassing context filters.

Now, with this change, Sourcegraph Enterprise instances only reject
requests from old versions of Cody clients that are known to not support
context filters. This ensures we never have false positives or false
negatives.
…nterprise-instances' of github.com:sourcegraph/sourcegraph
@cla-bot cla-bot Bot added the cla-signed label Jul 17, 2024
@taras-yemets taras-yemets requested review from a team and aramaraju July 17, 2024 15:31

@aramaraju aramaraju left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good, thanks @taras-yemets !

@taras-yemets taras-yemets merged commit 2776488 into main Jul 18, 2024
@taras-yemets taras-yemets deleted the ty/remove-cody-context-filters-enabled-ff branch July 18, 2024 11:27
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.

3 participants