Commit Graph

33122 Commits

Author SHA1 Message Date
Jason Hawk Harris
dd3cf57ece
populate monitors_enabled_unique_users (#57163)
* populate monitors_enabled_unique_users and monitors_enabled_last_run_errored code monitors so they don't return nil
* remove code_monitors_last_run_errored
* adds comment about unpopulated monitors_enabled_last_run_errored
2023-09-28 19:29:19 +00:00
Felix Kling
52a66a93a4
web: Add developer settings dialog (#57135)
This PR adds a "developer settings dialog" that is only available when Sourcegraph is run locally in dev mode, and provides easy access to feature flags and temporary settings. This can also be useful for people testing a PR.

QOL features:

- Filter flags/settings by status and name
- Indicator whether overrides exist and how many there are
- Save/restore dialog state to/from local storage

We can use this dialog to add more development specific settings in the future.

## Changes for feature flags

We already have a way to locally override feature flags and the dialog makes use of the same system. The only change I had to make was converting the type to a runtime value so that I can list all flags.

## Changes for temporary settings

Similar to feature flags I had to add a runtime representation of available temporary settings, but since they have more complex types I had to go about a different way (maybe someone has a better idea though). This requires the setting names to be listed twice, but I think that's OK.

Temporary settings didn't have a system for local overrides. I added one by wrapping an existing backend with a new override backend. Once a feature flag is overridden with setTemporarySettingOverride, the backend will return the overriden value instead. Similarly it will write an overridden setting to local storage and not to the real backend. In order to notify/update all subscribers when a value was overridden I added a global observer which the override backend listens to.
2023-09-28 19:23:23 +02:00
Robert Lin
8b32774e6b
telemetry: improve inline docstrings (#57104) 2023-09-28 09:52:27 -07:00
Camden Cheek
82ba4ffeb9
Qdrant: add endpoint to move all embeddings to qdrant (#57109) 2023-09-28 09:24:01 -06:00
Camden Cheek
3ee3921a15
Qdrant: bump version (#57097) 2023-09-28 09:06:14 -06:00
Chris Warwick
9f54786784
Azure OpenAI: Fix autocomplete streaming (#57148)
Accumulate response from text field instead of delta for streaming completions endpoint in azure.
2023-09-28 10:29:10 -04:00
Noah S-C
8640b85f59
JetBrains: set .editorconfig indent size for java + kotlin (#57146)
My intellij wont default to 2 indent without setting this 🤷 

## Test plan

N/A setting style in .editorconfig
2023-09-28 13:48:15 +00:00
Will Dollman
978c376f0f
Docs: Add wolfi package downgrade instructions (#57144)
Add wolfi package downgrade instructions
2023-09-28 14:47:31 +01:00
Noah S-C
12af6cfa76
JetBrains: migrate from deprecated workspaceRootPath to workspaceRootUri (#57142)
does what it says on the tin

## Test plan

Tested that agent accepts the uri that we send and it does: `2023-09-28 13:22:47,242 [   4056]   WARN - #c.s.c.a.CodyAgent - Cody Agent: handshake with client 'JetBrains' (version '3.4.0-alpha.1') at workspace root path 'file:///home/noah/Sourcegraph/lsif-kotlin'`
2023-09-28 14:15:24 +01:00
Piotr Chabelski
5e30658e52
JetBrains: Cody: Refactor autocomplete logic & move to Kotlin (#57138)
* JetBrains: Cody: Move core autocomplete logic to Kotlin

* JetBrains: Cody: Move CodyAutocompleteManager to Kotlin

* JetBrains: Cody: Convert CodyAutocompleteManager into a light service

* JetBrains: Cody: Move autocomplete-related actions into a dedicated subpackage

* JetBrains: Cody: Move autocomplete rendering logic to Kotlin

* JetBrains: Cody: Migrate app & project services to light services where applicable

* JetBrains: Cody: Fix unit tests

* JetBrains: Cody: Code Review: explicitly annotate JVM static methods for Java compat

* JetBrains: Cody: Code Review: misc fixes

* JetBrains: Cody: Code Review: get rid of nullable params in autocomplete renderers
2023-09-28 12:47:41 +00:00
Erik Seliger
55633e6cab
gitserver: Simplify getRemoteURLFunc (#57107)
This code path was required for cloud v1 because we would have private repos alongside public repos, and cloud default services would usually not be able to pull those.
Since we don't have private repos anymore, we can skip this check.
Worst case, we will have a repo marked as private in the DB and we won't attempt to update it - which would fail anyways. But now with a no sources for X error instead.
2023-09-28 14:35:41 +02:00
Erik Seliger
8ae749f7a1
Move repo updater scheduler into separate subpackage (#57098)
This PR decreases the bloat of the internal/repos package slightly by moving the update scheduler into a separate package.
2023-09-28 14:34:50 +02:00
Vincent
a2ce35cb8d
wolfi: update server / gitserver base images for p4-fusion revert (#57133) 2023-09-28 11:57:31 +00:00
Piotr Chabelski
1758ad8cb3
JetBrains: Cody: Refactor ChatScrollPane and move to Kotlin (#57081) 2023-09-28 13:56:03 +02:00
Stefan Hengl
e967e44891
search-jobs: add AND to query validation (#57130)
We only allow flat queries in the backend, which implies no AND or OR.

Test plan:
- updated test
- checked locally that it is not possible to create a search job from a
query with "AND" operator.
2023-09-28 13:31:33 +02:00
Vincent
318f008f79
Set epoch for p4-fusion 1.12 (#57134)
add epoch to version
2023-09-28 11:19:04 +00:00
Vincent
87e13aaf6e
wolfi: pin p4-fusion 1.12 (#57129) 2023-09-28 11:11:21 +01:00
Jean-Hadrien Chabran
bf14a0f1c2
doc: drop sg deprecated docs (#57125) 2023-09-28 11:52:43 +02:00
Stefan Hengl
b285aa52b5
search jobs: don't upload emtpy blobs (#57074)
We already don't write headers if we don't find matches, so all we have
to do is skip the upload.

We now also return 404 if the job wasn't found and 204 if there were 
no blobs.

Test plan:
- new and updated unit test
- ran a "needle in the haystack" query locally and confirmed that we
upload 1 CSV (for the needle) instead of 1 per revision.
2023-09-28 11:30:11 +02:00
Keegan Carruthers-Smith
5bb9304ab0
search: return status forbidden on download exhaustive logs (#57099)
Previously we would always write a header line before actually checking if we
can view a job. This automatically lead to status 200 and us ignoring the
later error. This adjusts the service call to return before any writes.

Test Plan: a test was added which ensures we don't write anything in case of
auth failure.
2023-09-28 11:09:17 +02:00
Petri-Johan Last
a569bb66e4
Add code host rate limiter details to code host connection page (#56638) 2023-09-28 10:14:40 +02:00
Petri-Johan Last
95dcc466d8
Distributed Rate Limiter updates (#56823) 2023-09-28 10:11:17 +02:00
Peter Guy
899580776c
revert p4-fusion to 1.12 (#57113)
encountered sigsegv errors with 1.13
2023-09-27 18:56:57 -07:00
Robert Lin
1d55335fcc
soap-cleaner: do not pick up soft-deleted external accounts (#57112)
External account deletion soft-deletes accounts. This means that on subsequent SOAP logins, SOAP users with more than 1 external account are more or less instantly demoted, because the cleanup job detects their expired - but deleted - SOAP external accounts.

This change updates the cleaner to ignore deleted external accounts, and also to hard-delete SOAP external accounts using a new option so that we don't have endless cruft building up.

No backport needed as https://github.com/sourcegraph/sourcegraph/pull/56866, which introduced this bug, did not make it into the 5.2 branch cut.
2023-09-28 00:09:01 +00:00
Camden Cheek
8dd94a3b1c
Bug: fix nil panic (#57108) 2023-09-27 23:10:21 +00:00
Geoffrey Gilmore
dc9f3bd074
grpc: searcher: convert well-known errors to proper grpc status codes (#57103) 2023-09-27 16:06:55 -07:00
Camden Cheek
db9507dd5d
Chore: bump cockroachdb/errors (#57102)
bump cockroachdb/errors
2023-09-27 16:06:31 -06:00
Robert Lin
6ae981c240
telemetry/teestore: generate anonymous ID if user and anonymous ID are empty (#57096)
The `event_logs` table requires that either the user or an anonymous user ID is provided, so some events can fail to insert when translated by `telemetry/teestore`. This change makes sure we always have either the user ID or anonymous ID.

## Test plan

I added an integration test to make sure translated events will always insert successfully without being caught by constraints. Existing unit tests + autogold show the new generated anonymous ID.
2023-09-27 21:07:46 +00:00
Maedah Batool
1fa7b90300
[OCT Launch] Cody Client: Docs updates for JetBrains (#56991)
* Cody Client: Docs updates for JetBrains

* Add small tweaks

* Add small tweaks

* Add override codebase context details

* Add small tweaks
2023-09-27 16:52:16 -04:00
Camden Cheek
c4092733e0
Qdrant: expose configuration options (#56260)
This exposes configuration options for Qdrant so we can experiment with different settings for large installations.
2023-09-27 13:05:52 -06:00
Enrique Gonzalez
df3e78f9a8
add premium support doc to docs (#56985)
* add premium support doc to docs

* Apply suggestions from code review

Co-authored-by: Maedah Batool <me@MaedahBatool.com>

---------

Co-authored-by: Maedah Batool <me@MaedahBatool.com>
2023-09-27 12:05:27 -07:00
Keegan Carruthers-Smith
dab12fd530
search: use high default limits for exhaustive (#57085)
Currently we use our default limits which are tuned for interactive and
regular searching. This commit introduces significantly higher limits
for search jobs (exhaustive):

- 1,000,000 file match limit (per repo@rev).
- 1 hour timeout.
- Ignore site config MaxTimeoutSeconds.

This is done by introducing a new Protocol "Exhaustive". All uses of
protocol before were for tuning limits, so this is the perfect place to
use it. Additionally it allows us to remove the hacky Exhaustive boolean
field.

There was a bunch of duplicated logic around how we computed file match
limits. This commit additionally removes those and makes all calls use
MaxResults. This is a tiny noop refactor in this commit.

Test Plan: Added a unit test which helps ensure we have higher limits.
Otherwise normal go test for catching regressions.
2023-09-27 21:05:03 +02:00
Bolaji Olajide
f02905a65f
source: add changelog entry for git debuggability (#57017)
This PR adds a changelog entry for all the features added by the git debuggability job fair project.

## Test plan

Changelog update.
2023-09-27 14:28:14 -04:00
Cesar Jimenez
682fa4c194
[cleanup] Remove Unused Sentinel UI and Associated Deadcode (#56965) 2023-09-27 11:45:30 -06:00
Joe Chen
414ce2cb3c
chore: clean up obsolete tagging of the @sourcegraph/apis (#57091) 2023-09-27 16:31:11 +00:00
Keegan Carruthers-Smith
d13a890781
search: lowercase and snake_case for exhaustive columns (#57080)
I started post processing some of our csv output and wanted this change.
It makes it much more ergonomic to process. For example compare these
two queries using sqlite's csv mode to calculate total match count:

  SELECT SUM("Match count") FROM results;
  SELECT SUM(match_count) from results;

Test Plan: expected diff of go test -update
2023-09-27 18:30:53 +02:00
Robert Lin
3be3044d15
telemetrygateway: add export of instance ID for licensed and unlicensed instances (#57067)
As titled. Licensed instances now emit the site ID we've always tried to track, and unlicensed instances now must emit the site ID
2023-09-27 08:54:53 -07:00
Robert Lin
183c0664ce
license: record CreatedAt in license info (#57059)
This change introduces a license version 3, which now records CreatedAt marking the creation of the license. This will apply to all licenses created when this change rolls out.

Recording this allows us to gate capabilities based on the time a license was created, namely for telemetry export configuration.
2023-09-27 08:54:36 -07:00
Maedah Batool
2d8f4ef3f6
[OCT Launch] Add AWS Bedrock to LLM provider list (#57086)
Add AWS Bedrock to LLM provider list
2023-09-27 07:15:12 -07:00
Quinn Slack
81ec6f6ca0
fix URL placeholder in docs (#57063) 2023-09-27 14:12:17 +00:00
Piotr Chabelski
39bd11ec78
JetBrains: Cody: Fix random tool panel refreshing (#57078)
* JetBrains: Cody: Refactor onboarding panel init

* JetBrains: Cody: Remove `RefreshCodyAppDetection`

* JetBrains: Cody: Refresh tool panel after a successful account login

* JetBrains: Cody: Fix formatting
2023-09-27 13:25:32 +00:00
Noah S-C
10390be71e
JetBrains: migrate ClientInfo, ConfigUtil & ExtensionConfiguration to Kotlin (#57082)
Migration of some length pojos to nicer Kotlin equivalents. Includes some drive-by stylistic improvements, as well as aligning some types that cross the agent boundary with https://sourcegraph.com/github.com/sourcegraph/cody/-/blob/agent/src/protocol.ts

## Test plan

Compilation still works, Cody Agent still accepts all types
2023-09-27 13:08:28 +00:00
Stefan Hengl
fb764abea5
search jobs: compute aggregate state in db (#56957)
This PR moves the logic for computing the aggregate state from the resolver to the store.

Why?

To filter and sort by the aggregate state and make use of the paging helpers, we have to return the aggregate state from db instead of computing it in the resolver. 

Note:

There is a bit of awkwardness because only `ListSearchJobs` computes the aggregate state, but not `GetSearchJob`. I don't want to set `AggState` in `GetSearchJob` because it is fairly expensive to calculate, and we call `GetSearchJob` a lot as part of the security checks, so I wanted to keep it as lean as possible. 

In the future we should have a dedicated call to the db for security checks and use `GetSearchJob` only when we create a search job. Then we can calculate the aggregate state on GetSearchJob, too, and remove the special casing in the code. 

Test plan:
- New unit test
- manual testing: I ran a couple of search jobs locally to confirm whether the aggregate state properly reflect the state of the underlying jobs.
2023-09-27 15:01:15 +02:00
Thorsten Ball
f0731e7b74
site-config: fix invalid default values for repo purge worker (#57079)
This fixes #56980
2023-09-27 15:00:26 +02:00
Szymon Przebierowski
044825465f
JetBrains: fixed logging in multiple times to sourcegraph.com from settings page (#57073)
* logging in to sourcegraph.com now correctly adds accounts to settings list and to persistent storage
2023-09-27 14:40:49 +02:00
Felix Kling
3bbaa218a4
user onboarding: Add onboarding setup flow (#57014)
This PR adds the onboarding setup flow for the onboarding tour.

If a user has less than X (currently 5) queries and hasn't gone through the setup flow they will see the setup dialog when they open a page that would normally show the tour (search homepage, search results, file page). The user can either answer the questions or skip the whole setup. If they skip the setup the tour will still be shown but only show tasks that don't depend on this information.

## Implementation details

I didn't want to completely reinvent the wheel but also didn't have to the time to build a truly reusable autocompletion system for repositories and languages. Therefor I moved some code around to make the caching logic used by the new query input reusable (now CachedAsyncCompletionSource), which is now used by the query input as well as the repository input. The language autocompletion is all synchronous using fzf. (I think it makes sense in the long run to make autocompletion "sources" more reusable)

The user provided values are validated (not empty, repository exists).

Exposing the PopoverContentProps on ComboboxPopover is necessary to for controlling (and fixing) the position of the popover.

Co-authored-by: numbers88s <cesar.r.jimenez@gmail.com>
2023-09-27 13:13:15 +02:00
Szymon Przebierowski
13df4d3a77
JetBrains: remove old onboarding about cody app (#57075)
remove old onboarding about cody app
2023-09-27 10:21:43 +00:00
Cesar Jimenez
b150dedb55
[config]: Reverting External URL Update and Removal of sync.Once (#57057) 2023-09-26 13:51:57 -06:00
Robert Lin
20d156034c
actor: propagate anonymous UID from 'X-Sourcegraph-Actor-Anonymous-UID' (#57056)
Cookie anonymous UID continues to take precedence, but this is helpful for clients that don't use cookies to track anonymous UID (i.e. VSCode), and especially relevant in the context of our new telemetry mutations, which now use real actors to determine the user, instead of asking clients to tell us who the user is.
2023-09-26 12:25:47 -07:00
Joe Chen
046fccf2e3
chore: clean up CODENOTIFY for @sourcegraph/delivery (#57046) 2023-09-26 15:20:42 -04:00