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

Syntactic indexing policy toggle: UI and supporting APIs (with backcompat)#64075

Merged
keynmol merged 4 commits into
mainfrom
revert-64046-revert-63876-syntactic-indexing-policies-graphql-api
Jul 25, 2024
Merged

Syntactic indexing policy toggle: UI and supporting APIs (with backcompat)#64075
keynmol merged 4 commits into
mainfrom
revert-64046-revert-63876-syntactic-indexing-policies-graphql-api

Conversation

@keynmol

@keynmol keynmol commented Jul 25, 2024

Copy link
Copy Markdown
Contributor

Fixes GRAPH-751
Fixes GRAPH-636

Reverts sourcegraph/sourcegraph#64046 which itself was a revert of https://github.com/sourcegraph/sourcegraph/pull/63876 due to backwards compatibility concerns.

This new PR adds two extra commits which restore the indexingEnabled field, and make syntacticIndexingEnabled field optional.


Fixes GRAPH-636
Fixes GRAPH-751

This PR aims to allow admins to enable syntactic indexing on per-policy basis using the existing UI and APIs with the following amendments:

  • New UI toggle for syntactic indexing – only visible if the experimental feature is enabled (see screenshots below)
  • New field in GraphQL API for syntactic indexing
  • New Go resolvers to handle the new field

To support this on the backend, we also update the policies handling code and SQL queries to ensure we can retrieve and update the syntactic_indexing_enabled field.

Test plan

  • Backend part covered by updated policies tests
  • Manual testing of UI

With experimental feature enabled:

CleanShot 2024-07-22 at 12 56 56

With experimental feature disabled:
CleanShot 2024-07-22 at 12 57 21

Changelog

  • In site-admin APIs for updating code intelligence policies:
    • field indexingEnabled is renamed to preciseIndexingEnabled
    • a required syntacticIndexingEnabled is added (only takes effect if experimental feature is enabled)
    • field forIndexing is renamed to forPreciseIndexing

@cla-bot cla-bot Bot added the cla-signed label Jul 25, 2024
@github-actions github-actions Bot added team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform labels Jul 25, 2024
@keynmol keynmol changed the title Revert "Revert "Syntactic indexing policy toggle: UI and supporting APIs"" Syntactic indexing policy toggle: UI and supporting APIs (with backcompat) Jul 25, 2024
$retentionDurationHours: Int
$retainIntermediateCommits: Boolean!
$indexingEnabled: Boolean!
$syntacticIndexingEnabled: Boolean!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe this particular gql snippet is only used by the frontend, and it delegates to createCodeIntelligenceConfigurationPolicy mutations in the actual spec, where this field is optional.

But in the frontend we treat the field as required.

@keynmol keynmol marked this pull request as ready for review July 25, 2024 09:17
@keynmol keynmol requested a review from michaellzc July 25, 2024 15:17

@michaellzc michaellzc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ty

@keynmol keynmol merged commit 7e5b52e into main Jul 25, 2024
@keynmol keynmol deleted the revert-64046-revert-63876-syntactic-indexing-policies-graphql-api branch July 25, 2024 19:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants