Code Insights: [BE] [FE] Create env feature flag for gql insight API
Created by: vovakulikov
Context
We have to introduce an environment non-overridable feature flag to be able to switch our setting-based with gql API. At the moment we use setting cascade to store features flat but they all could be easily overridden which doesn't fit in our tech constraints of data migration.
How to create env feature flag with jsContext
object.
- Extend FE
jsContext
type https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/client/web/src/jscontext.ts - Extend GO struct with feature flag here https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/cmd/frontend/internal/app/jscontext/jscontext.go?subtree=true
- After that it should be possible to use
window.context.<our feature flag>
in any place within the app. - Replace this line with
window.context.<feature flag>
statement https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/client/web/src/enterprise/insights/InsightsRouter.tsx?L57&subtree=true