gating: Add individual switches for disabling tools features#63686
Conversation
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This PR adds better gating for disabling the code monitors, notebooks, search jobs and own features. Test plan: Ran locally and verified the features are gone when the env var is set. Ran again without those and they worked.
d75376f to
48b3917
Compare
| const showSearchContext = searchContextsEnabled && !isSourcegraphDotCom | ||
| const showSearchJobs = isSearchJobsEnabled() | ||
| const showSearchJobs = searchJobsEnabled && !isSourcegraphDotCom | ||
| const showSearchNotebook = notebooksEnabled && !isSourcegraphDotCom | ||
| const showCodeMonitoring = codeMonitoringEnabled && !isSourcegraphDotCom |
There was a problem hiding this comment.
I wonder if we can remove all these !isSourcegraphDotCom here
There was a problem hiding this comment.
Notebooks doesn't have dot-com check in the backend. I will add it there and remove the checks in the client.
There was a problem hiding this comment.
we could also make it more explicit by setting all these env vars before the rollout, then we don't need the dotcom checks at all
| if !codemonitors.IsEnabled() { | ||
| return nil | ||
| } |
There was a problem hiding this comment.
I now realize that I overlooked one thing here:
Since this thing also checks if the current license allows the feature, the path from: set up instance -> log in first time -> paste license key -> start using features will now break and require a restart of all the services (basically every time the license terms change).
That's probably not ideal :/
Ideally, we would be able to interactively start and stop the subsystems we initialize here, but that's not a thing today.
Should we initially go with only env vars and follow-up with license key checks?
- adds DISABLE_BATCH_CHANGES, DISABLE_SEARCH_CONTEXTS - removes license checks from code monitors and own
| Branding: conf.Branding(), | ||
|
|
||
| BatchChangesEnabled: enterprise.BatchChangesEnabledForUser(ctx, db) == nil, | ||
| BatchChangesEnabled: batches.IsEnabled() && enterprise.BatchChangesEnabledForUser(ctx, db) == nil, |
There was a problem hiding this comment.
Now batch changes also has an ENV we can check against.
…lingtoolsfeatures
Relates to https://github.com/sourcegraph/sourcegraph/pull/63686 We check the ENVs added in https://github.com/sourcegraph/sourcegraph/pull/63686 and disable the corresponding worker jobs if necessary. Test plan: TBD
Relates to https://github.com/sourcegraph/sourcegraph/pull/63686 We check the ENVs added in https://github.com/sourcegraph/sourcegraph/pull/63686 and disable the corresponding worker jobs if necessary. ## Test plan New unit tests

This PR adds better gating for disabling the code monitors, notebooks, search jobs and own features.
Test plan
Ran locally and verified the features are gone when the env var is set. Ran again without those and they worked.