Commit Graph

53 Commits

Author SHA1 Message Date
Warren Gifford
15036143bc
bug/release: update version consts in updatecheck handler (#64052)
update version consts in updatecheck handler, temp solutions

see:
https://linear.app/sourcegraph/issue/REL-145/release-tie-release-consts-to-release-registry

## Test plan
No test

<!-- REQUIRED; info at
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->

## Changelog

<!-- OPTIONAL; info at
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c
-->
2024-07-24 20:32:10 -07:00
Quinn Slack
b4e03f45b0
Prompt Library (#63872)
The Prompt Library lets you create, share, and browse chat prompts for
use with Cody. Prompts are owned by users or organizations, and site
admins can make prompts public so that all users on the instance can see
and use them.

A prompt is just plain text for now, and you can see a list of prompts
in your Prompt Library from within Cody chat
(https://github.com/sourcegraph/cody/pull/4903).

See https://www.loom.com/share/f3124269300c481ebfcbd0a1e300be1b.

Depends on https://github.com/sourcegraph/cody/pull/4903.


![image](https://github.com/user-attachments/assets/d1098809-f7ff-4233-8ecb-9bc53ad4dbb2)


## Test plan

Add a prompt on the web. Ensure you can access it from Cody.

## Changelog

- The Prompt Library lets you create, share, and browse chat prompts for
use with Cody. Prompts are owned by users or organizations, and site
admins can make prompts public so that all users on the instance can see
and use them. To use a prompt from your Prompt Library in Cody, select
it in the **Prompts** dropdown in the Cody chat message field.
2024-07-18 16:04:55 -07:00
Warren Gifford
d5aebe2040
bug(release): update hard coded consts (#63133)
This updates the consts that control upgradeReadiness i.e. banners and
latest version indicators

<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


## Test plan
no test 
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog
- tmp process: update release consts to 5.4.5099
<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-06 13:16:36 -07:00
Warren Gifford
9d0131f936
bug(release): update version strings in upgradeReadiness (#62990)
update version strings in upgradeReadiness
2024-05-31 12:19:31 -07:00
Warren Gifford
d15288e5e1
chore(release): quick fix latest version after release (#62938)
quick fix latest version after release
2024-05-28 08:10:47 +02:00
Warren Gifford
15307bc8d1
Pings: Update hardcoded latest release strings (#62890)
update hardcoded latest release strings
2024-05-24 11:55:07 -07:00
Warren Gifford
0839f093aa
Fix OOB migrations progress updates (#61770)
* Anish's post pairing suggestions modified

* Check first version in migrations, propegate first version through upgradeReadinessCheck

* get the version from the db instead of the frontend version string from build

* display only migrations which are not deprecated before the insances initialization

* sg bazel configure

* fix isRequired test

* fix graphql imports

* fix SiteAdminMigrationsPage.story.tsx

* capitulate to eslints biases

* address review feedback

* resolve branch conflict in import

* add clarifying comment

* fix resolver variables
2024-04-30 17:23:17 -07:00
Varun Gandhi
17a0a6461c
chore: Remove redundant loop captures (#62264)
Go 1.22 changes loop variables to have more sensible
semantics where the variable is not reused across iterations
by the codegen, so we can simplify a bunch of code
working around that counterintuitive behavior.
2024-04-30 07:57:21 -06:00
Taras Yemets
cfe13d0beb
Pings: track if "cody.contextFilters" field is configured in site config (#62080) 2024-04-25 16:11:02 +00:00
Ara
62e4c40d8a
Adding logging for getLLMUsageData data failed (#62069) 2024-04-21 15:08:58 +02:00
Robert Lin
36d36553b5
telemetry: unexport internal type, add SafeMetadataKey (#61934)
I noticed the `telemetry.constString` type was wrongly exported in a previous PR (https://github.com/sourcegraph/sourcegraph/pull/61134). This type is intentionally unexported to prevent the exact use case the PR used the exported type for - this scenario (list keys and include it in metadata) is exactly the scenario where something bad might unexpectedly show up in our telemetry (an unexpected Redis key is matched, an unexpected value is provided to be stored, etc - the cause of multiple data leakage incidents in the past)

However, given the format I was unable to quickly come up with a better alternative. Moving it to private metadata is also not possible, as because judging from the description of #61134 we need this to be exported from on-prem as a business need.

For now:

1. Add loud warnings on the various intentionally-internal types to not export them
2. Add a constructor `telemetry.SafeMetadataKey(...)` to support the current use case, with warnings - callers more or less "sign off" on owning problems here if there are any. In the future if we have any regex strategy we want to apply we can add them to these constructors as well.
3. Add CODEOWNERS to make sure changes to telemetry do not go without adequate review

## Test plan

CI
2024-04-16 10:41:47 -07:00
Ara
2e2dc2bc42
Adding Token counting support for bring your own key customers using Redis cache (#61134)
* Adding Token counting support for bring your own key customers using Redis cache

* Adding Completions stuff

* Adding Completions stuff

* Adding Completions stuff

* Adding Completions stuff

* Fixing tokenizer

* remvoing redundant comment

* Adding Constants

* Adding Constants

* Fixing naming

* Fixing naming

* Fixing naming and exposure of tokenizer methods

* Fixing naming and exposure of tokenizer methods

* Fixing naming and exposure of tokenizer methods

* Fixing naming and exposure of tokenizer methods

* Adding StoreTokenUsage method right before resetting redis

* Adding StoreTokenUsage method right before resetting redis

* Adding StoreTokenUsage method right before resetting redis

* Update internal/rcache/rcache.go

Co-authored-by: Stephen Gutekanst <stephen@sourcegraph.com>

* Update internal/rcache/rcache.go

Co-authored-by: Stephen Gutekanst <stephen@sourcegraph.com>

* Update cmd/frontend/internal/bg/store_token_usage_in_postgres.go

Co-authored-by: Stephen Gutekanst <stephen@sourcegraph.com>

* Adding StoreTokenUsage method right before resetting redis

---------

Co-authored-by: Stephen Gutekanst <stephen@sourcegraph.com>
2024-04-04 15:49:05 +00:00
Anish Lakhwara
647b99f281
release: sourcegraph@5.3.3 (#61333) 2024-03-22 06:32:49 +01:00
Camden Cheek
30d4d1dd45
release: sourcegraph@5.3.2 (#60979) 2024-03-08 17:25:04 -07:00
Erik Seliger
2c1d7bd626
Move dotcom check out of cmd/frontend (#60810)
Simple refactor, moved the methods into internal/dotcom so that we don't import across package boundaries.

Simply moved code, existing test suites will find issues.
2024-03-04 16:05:16 +00:00
Dan Adler
33b92afbc9
Update cody ping payload (#60737) 2024-03-01 09:25:15 -08:00
Bolaji Olajide
e89be5127d
release: sourcegraph@5.3.1 (#60727) 2024-02-23 10:45:03 -06:00
Keegan Carruthers-Smith
0576a5f7fd
release: sourcegraph@5.3.0 (#60488)
draft sourcegraph@5.3.0 release
2024-02-13 22:11:10 +02:00
Dan Adler
79dc3af3a0
Add external URL to pings (#60347)
* Add external URL to pings

* docs
2024-02-09 00:15:32 +00:00
Bolaji Olajide
da185c05f1
release: sourcegraph@5.2.7 (#59876) 2024-01-25 14:21:32 -08:00
Joe Chen
ec5cc97a11
updatecheck: remove error logging for client side errors (#59845) 2024-01-25 01:55:24 +00:00
Warren Gifford
09063fe99d
release: sourcegraph@5.2.6 (#59504)
* release: sourcegraph@5.2.6

* manually remove all changes in doc folder to pass CI

* weird extra doc change added by vsCode md editor
2024-01-10 19:51:58 -08:00
Erik Seliger
f9ac351dc3
Remove App from codebase (#59115)
Cody no longer needs it and it is obsolete now!

Since App added a non-insignificant amount of new concepts and alternative code paths, I decided to take some time and remove it from out codebase.
This PR removes ~21k lines of code. If we ever want parts of single binary (app), the redis kv alternatives, or the release pipeline for a native mac app back, we can look back at this PR and revert parts of it, but maintaining 21k lines of code and many code paths for which I had to delete a surprisingly small amount of tests justifies this move for me very well.

Technically, to some extent SG App and Cody App both still existed in the codebase, but we don't distribute either of them anymore, so IMO we shouldn't keep this weight in our code.

So.. here we go.

This should not affect any of the existing deployments, we only remove functionality that was special-cased for app.
2023-12-21 01:07:05 +01:00
Robert Lin
f8ca00dd11
pubsub: add narrower TopicPublisher interface, ensure Stop in telemetry-gateway (#58974)
We currently don't call `Stop` on the pub/sub client, which is pretty important because I think it actually does buffering by default: https://sourcegraph.com/github.com/googleapis/google-cloud-go@6eb769621618a965abeabf11e6315bdb8be9b050/-/blob/pubsub/topic.go?L122-137

This change adds a `TopicPublisher` interface with write-only methods so that we don't accidentally Stop the client at callsites, and adds a Stop to telemetry-gateway. I'll follow up with another change to update Pings to the MSP runtime and apply a Stop there as well
2023-12-14 12:32:48 -08:00
Jacob Pleiness
e96c1785f9
release: sourcegraph@5.2.5 (#58976) 2023-12-13 17:28:29 -05:00
Taras Yemets
2ffd9d6685
Add Cody providers to pings (#58848) 2023-12-12 19:46:49 +02:00
Robert Lin
9af0245a13
eventlogs: use real deprecation warnings in backend (#58751)
This change adds standard godoc deprecation warnings (`// Deprecated: ...`) on the _many_ legacy event-logging entry points in the backend. These are rendered prominently in VSCode (and presumably other IDEs) and will also trigger a CI failure if a deprecated function is used without a `//lint:ignore SA1019` directive ([`SA1019` is the error code for deprecated function usage](https://staticcheck.dev/docs/checks/#SA1019)). The goal is primarily to discourage new usages, and mark existing usages that will need to be migrated, so this PR adds `//lint:ignore SA1019` docstrings at all existing callsites.

I've also added a deprecation warning on the `logEvent` and `logEvents` mutations in the GraphQL schema.

Closes https://github.com/sourcegraph/sourcegraph/issues/56973 - in the web app and Cody repo, we already use JSDoc deprecation notices.
2023-12-05 17:05:41 +00:00
Bolaji Olajide
a194738d61
release: sourcegraph@5.2.4 (#58745)
* release: sourcegraph@5.2.4

* bazel configure
2023-12-04 19:37:15 +01:00
Mohammad Alam
6fcbbdf914
release: sourcegraph@5.2.3 (#58362)
* release: sourcegraph@5.2.3

* configure

* fix migrator genrule

* update schemas

---------

Co-authored-by: Robert Lin <robert@bobheadxi.dev>
Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2023-11-16 16:35:19 -05:00
Dan Adler
8fb2424fd2
Don't do expensive ping queries for dotcom; these are causing timeouts (#58291) 2023-11-13 15:49:02 -08:00
Camden Cheek
74410f84b5
release: sourcegraph@5.2.2 (#58063) 2023-11-02 10:53:56 -06:00
Keegan Carruthers-Smith
75cbd196f3
release: sourcegraph@5.2.1 (#57703) 2023-10-18 19:12:21 +00:00
William Bezuidenhout
1ae6cc6bfd
logger: update log lib and remove use of description (#57690)
* log: remove use of description paramter in Scoped

* temporarily point to sglog branch

* bazel configure + gazelle

* remove additional use of description param

* use latest versions of zoekt,log,mountinfo

* go.mod
2023-10-18 17:29:08 +02:00
Joe Chen
47248aff8e
release: sourcegraph@5.2.0 (#57315) 2023-10-03 19:47:11 +00:00
Vova Kulikov
1e25781b99
[Search jobs]: Add logs to the search jobs UI (#56745)
* Add telemetry events for the search jobs UI

* Add search job usage pings aggregation

* Connect search jobs usage handler

* Fix telemetry service props drilling

* usagestats: correctly unmarshal errors in GetWeeklySearchFormViews

* Fix client mocks and stories

* Fix updatecheck tests
2023-09-22 13:58:00 -03:00
Joe Chen
0ed79bca35
release: sourcegraph@5.1.9 (#56900) 2023-09-21 12:36:37 -04:00
Joe Chen
9d0e310ee2
pings: expose OpenTelemetry metrics (#56875) 2023-09-21 00:17:37 +00:00
Quinn Slack
8caa9ad9a7
update code references to "Sourcegraph App" -> "Cody App" (#56747)
This updates variable names, property names, env var names, etc., to call it "Cody App".

The entire diff was created by running the following commands:

```
fastmod -e go SourcegraphAppMode CodyAppMode
fastmod -e go,ts,tsx sourcegraphAppMode codyAppMode
fastmod -e ts,tsx isSourcegraphApp isCodyApp
fastmod -e ts,tsx,go,yaml,sh,js SOURCEGRAPH_APP CODY_APP
fastmod -e ts,tsx,go,json,mod,graphql,md,js 'Sourcegraph App\b' 'Cody App'
fastmod -e ts,tsx,go,json,mod,graphql,md,js 'Sourcegraph app\b' 'Cody app' # with a few changes skipped
```
2023-09-19 12:31:12 -10:00
Joe Chen
3d2b79101b
updatecheck: call conf.Get only in running on dotcom (#56791) 2023-09-19 14:08:46 -07:00
Joe Chen
a123827d3e
updatecheck: forward ping requests to pings.sourcegraph.com (#56702) 2023-09-15 19:21:13 -04:00
Joe Chen
150ffb2ad5
updatecheck: use new pings endpoint (#56694) 2023-09-15 12:48:17 -07:00
Joe Chen
ce6022c4e7
chore: update CODENOTIFY for Joe (#56647) 2023-09-14 16:09:33 +00:00
Warren Gifford
62d8e14e77
release: sourcegraph@5.1.8 (#56405)
* release: sourcegraph@5.1.8

* Update consts.go

* bazel configure for CI
2023-09-06 14:33:43 -07:00
Jacob Pleiness
e4d58dabab
release: sourcegraph@5.1.7 (#56223)
* release: sourcegraph@5.1.7

* Update BUILD.bazel
2023-08-24 21:11:58 -04:00
Erik Seliger
3e50ff1a90
gitserver: Remove repos-stats.json file (#55845)
The content of this file is the size of all repos combined per shard. We update it in the janitor after all repos are processed, but at the same time we collect the same sizes per repo and write them to gitserver_repos.repo_size_bytes. This didn't exist back when the file was introduced, but nowadays, they are pretty much equal. An additional benefit is that other processes that update the repo size in the DB will also reflect faster in the value read here. This removes a bunch of complexity around managing that file, maintaining endpoints to retrieve that data, and around talking to every gitserver to get the cumulated value.

Proof: On dotcom, where 1 gitserver holds roughly 15.5TB of repo data, the calculated value in the file and the value from the DB only differ by 175MB (0.001076729067%).

Please let me know if I am missing some nuance here and those numbers are not actually the same!

With quarterly releases, we can only remove some of the remaining endpoints code in 5.3, to keep compatibility.

There are exactly two things that use this endpoint:

A GraphQL resolver that returns the total git size
If the frontend comes up first, it just uses the DB, which is already populated correctly long ago
If the new gitserver comes up first, it will still have the endpoints but read from the DB, so no problem here
The usagestats code, that collects pings data regularly
If the frontend comes up first, this is not a problem as the DB is already populated correctly and it's read from there
If the gitserver comes up first, it will still have the endpoints but read from the DB, so no problem here
2023-08-24 16:09:32 +02:00
Erik Seliger
6a8f5907de
Revert artifacts from git deduplication work (#56185)
After recent changes, I don't think we will have the capacity to move this over the finish line and it doesn't seem to be a high priority. Let's close this out for now and revisit later if needed.
We'll have all the writeups we made and this diff for future inspiration.
2023-08-24 15:14:30 +02:00
Joe Chen
6c8227ebbd
pings: bootstrap initial code logic (#55467) 2023-08-15 16:27:29 -04:00
Sander Ginn
036ed7f8e1
release: sourcegraph@5.1.6 (#55737)
* release: sourcegraph@5.1.6

* fix BUILD.bazel formatting

* format bazel -_-
2023-08-10 20:34:05 +02:00
Joe Chen
c4cef7a49d
updatecheck: make Pub/Sub client an argument instead of global var (#55536)
This PR refactors the `internal/updatecheck` package a bit so that the
global state to store the Pub/Sub client is removed (the result of the
preceding PR https://github.com/sourcegraph/sourcegraph/pull/55524), and
can be pass down to lower-level helper function as an argument.

This is necessary for
https://github.com/sourcegraph/sourcegraph/pull/55467 to hold a Pub/Sub
client on the call site in order to use `pubsub.TopicClient`'s helper
functions (i.e. `Ping`) while still being able to reuse most of the code
logic from the `internal/updatecheck` package.

## Test plan

CI
2023-08-03 13:30:29 -04:00
Erik Seliger
d7af688bba
Remove properties from requireRestart that don't actually do (#55499)
This removes a bunch of properties from the list of ones that will show
the site-admin a banner that they need to restart their server, because
they don't actually do (anymore).
This hopefully reduces the number of times an admin has to interrupt
their workflow to go into the infra and restart. This will also benefit
cloud ops where the customer cannot do it themselves.

Reasoning for removal: **Please help me vet that I am not wrong here!!**

- `gitHubApp`: This property is deprecated and not used anymore.
- `codeIntelAutoIndexing.enabled`: This one does not require a server
restart, all the background jobs will be running, but return early. The
next run they will just work as expected. It does require a page
refresh, but that's handled in the SiteAdminConfigurationPage.
- `extensions`: Property no longer exists.
- `auth.sessionExpiry`: This value is used in conf.ContributeValidator
and on the request path for SetActor, it's reading the value dynamically
so this should not require a restart.
- `auth.accessTokens`: Always read dynamically in resolvers/http
handlers. Requires a page refresh, but not a server restart.
- `auth.userOrgMap`: Just used on the user create request path, read
dynamically.
- `update.channel`: Fixed by reading the value on each iteration vs not
starting the ticker.
- `git.cloneURLToRepositoryName`: Uses conf.Cached, should not require a
server restart. None of the accessors of the value seem to cache it
anyhow.
- `searchScopes`: Changelog says this was removed, and it doesn't exist
anymore in the site.schema.json file.

Maybe next time we can get rid of the remaining ones and entirely
eliminate this mechanism for our admins!

## Test plan

Read code carefully to verify that these properties actually don't
require a server restart.
2023-08-02 21:49:52 +02:00