Commit Graph

33 Commits

Author SHA1 Message Date
Noah S-C
9b6ba7741e
bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
Erik Seliger
24e8505019
chore: Completely sunset qdrant (#62018)
This removes qdrant from this codebase entirely.
All the docker images, dependencies, (dead) usage in code.

My understanding is that we don't use this feature and never properly rolled it out.

Test plan:

CI passes and code review from owners.
2024-04-22 18:00:57 +02:00
Erik Seliger
a050df2a07
Cleanup internalapi after gRPC migration (#60572)
We no longer need this endpoint. Also found a few other things related to internalapi on the way that could use a cleanup.

## Test plan

Integration tests should verify that conf works just as before.
2024-02-19 14:13:26 +01:00
Erik Seliger
bb09a4ac1f
Remove HTTP for inter-service RPC (#59093)
In the upcoming release, we will only support gRPC going forward. This PR removes the old HTTP client and server implementations and a few leftovers from the transition.
2024-01-11 19:46:32 +01:00
Geoffrey Gilmore
d43909f630
grpc: frontend: configuration: support automatic retries (GetConfig is idempotent) (#59136)
This PR adds support for automatic retries in the frontend configuration grpc client. 

I have gone through the frontend protobuf file and marked all the methods I thought were idempotent (we can't inspect this using the go protobuf packages, but I thought this was nice for documentation). 

I then wrapped the basic frontend grpc client with an "automaticRetryClient" that uses the default retry policy that was defined in https://github.com/sourcegraph/sourcegraph/pull/59095. See that PR for more details.  All the methods are idempotent, so they all get the new retry logic. 

## Test plan

CI
2023-12-22 15:15:33 -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
Camden Cheek
b9a7e3b809
Cleanup: use new go 1.21 features (#58617)
Now that we're running go 1.21, we can take advantage of its new features. This cleans up a few utilites that have since been included in the standard library.
2023-11-28 13:49:38 -07:00
Greg Magolan
afc8577b6f
build: add buildifier check to Aspect Workflows (#58566)
* build: add buildifier check to Aspect Workflows

* exclude squirrel/test_repos/starlark

* buildifier

---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2023-11-27 14:58:01 +02:00
Robert Lin
726a5aff95
client/web: add telemetry v2 client (#57939)
Brings something like https://github.com/sourcegraph/cody/pull/1192 to Sourcegraph's web client, injected as a new `telemetryRecorder` in `PlatformContext`. Because we want to use the only non-deprecated way to make GraphQL requests, Apollo clients, a global events recorder is not provided ([thread](https://sourcegraph.slack.com/archives/C01C3NCGD40/p1698376463350449)) - the shared one can only retrieved from `PlatformContext`.

In non-`web` platforms (`client/browser`) the recorder is currently set to a no-op recorder that errors upon use, as for this PR intended for backport, we only want to add some usages to `web` for Cody events.

To start off, this change adds some new usage of this on a rather out-of-the-way section `permissions-center`, tested manually below.

Closes https://github.com/sourcegraph/sourcegraph/issues/56920
2023-11-02 08:57:03 -07: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
Quinn Slack
a07c67ad67
support single-program execution for local dev (#56750)
support single-program execution

Now, `sg start single-program` starts a single-binary local dev server. This is similar to Cody app, but instead of using a Tauri desktop app UI and limiting to only Cody-related functionality, it runs a full Sourcegraph instance and lets you access it through your web browser. It is useful for local dev because it's less resource-intensive and has faster recompile/relink times than `sg start` (which runs many processes).
2023-09-30 03:55:26 +00:00
Geoffrey Gilmore
bd7b8b2fa8
grpc: conf: add more robust URL parsing for SRC_FRONTEND_INTERNAL (#55943) 2023-08-16 18:45:59 -07:00
Camden Cheek
1dd8601839
gRPC: migrate conf endpoint (#55648) 2023-08-10 11:34:08 -06:00
Camden Cheek
418cdaf029
Backend: remove unused LogEvent (#55464)
This removes the LogEvent internal API, which was never used.
2023-08-02 19:30:44 +00:00
Camden Cheek
c7ab5860fe
Backend: remove internalClient.ExternalURL (#55463)
This removes the `internalClient.ExternalURL` method, which can be
replaced with a simple call to `conf.Get()`
2023-08-02 18:52:26 +00:00
Camden Cheek
f9d67feecb
Backend: remove internalClient.SendEmail (#55459)
Now that config can be fetched from all services, there is no need for
this internalClient method. One fewer to implement for gRPC
2023-08-02 11:30:20 -07:00
Camden Cheek
7265e0428e
Backend: remove unnecessary internal API for external services (#55450)
This removes an unnecessary internal endpoint. Basically,
`schema.ClientConfiguration` is the only consumer of `conf.*Configs()`,
which are the only consumers of `internalClient.ExternalServiceConfigs`,
which just hits the database and pulls the URL off the config.

So, rather than calling an internal API from `frontend`, which is just
served by `frontend`, this PR updates `schema.ClientConfiguration` to
just hit the database directly for this information, allowing us to get
rid of one of the few remaining internal APIs.

This is an API that was slated to be converted to gRPC, so I'd rather
not convert things we can just delete.
2023-07-31 16:26:16 -06:00
Stephen Gutekanst
4286ccc609
all: add deploy.IsApp and deploy.IsSingleBinary helpers (#49065)
Context: I am working towards us having two definitions in our codebase:

1. "App" -> the _deployment type_ of Sourcegraph you use on your local
machine.
2. "Single binary" -> App is always single-binary, but not all
single-binaries are App. In the future, all Sourcegraph services will be
"single binary" and so this term will exist in our codebase to refer to
code that is used when ran in a "single binary" setting.

---

Stacked on top of #49064

This change introduces `deploy.IsApp()` and `deploy.IsSingleBinary()`
helpers that do not need to be fed the deployment type.

## Test plan

Existing tests

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
2023-03-10 13:33:40 -07:00
Jean-Hadrien Chabran
13614402a4
bazel: build //internal/... (#47109) 2023-01-31 19:02:34 +01:00
Stephen Gutekanst
a4eaada3ed
all: better default env vars for App (#47142)
Previously one needed to specify all of these env vars in order to run the `sourcegraph` App:

```
SRC_FRONTEND_INTERNAL=localhost:3090
EXECUTOR_FRONTEND_PASSWORD=asdf
```

After this, just running `sourcegraph` is enough.

* `EXECUTOR_FRONTEND_PASSWORD`, although it is ignored in the App deployment type,
  must be set to _something_ otherwise a validation error will occur.

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
2023-01-31 12:18:25 +00:00
Jean-Hadrien Chabran
bc5490c4bb
bazel: introduce build files for Go (#46770) 2023-01-23 14:00:01 +01:00
Robert Lin
7ec296a9da
email: do not send certain emails to unverified emails (#46184)
We should seek to avoid damaging email reputations by validating if emails are verified before sending certain types of potentially high-frequency, non-essential emails to user primary emails, in this change:

- Account update notifications
- Code monitors

In practice, at the moment only builtin auth signups will create accounts that have unverified primary emails. External service accounts are created with primary emails already verified, and so are those created with the createUser mutation (which I am hoping to change in #46187).

Today, a user could create a user with an invalid email, and then proceed to set up a code monitor that accidentally sends large numbers of emails that all bounce, which has implications for Cloud's managed SMTP services.

Co-authored-by: Joe Chen <joe@sourcegraph.com>
2023-01-10 19:08:53 +00:00
Robert Lin
1ed2470e07
internalapi: fix SendEmail arguments (#43713) 2022-10-31 20:05:40 +00:00
Robert Lin
99b6fd2409
txemail: add 'source' to src_email_send (#43280)
Allows more granular monitoring of email delivery usage, most notably what product features are using emails.
2022-10-31 16:47:56 +01:00
Ryan Slade
e134dc9aa2
api: Use internal actor in internal api client (#43223)
We now ensure that all outgoing requests to our internal api via our internal client
include an internal actor if no actor was already provided.
2022-10-20 13:59:49 +02:00
Ryan Slade
29a26f8d59
phabricator: Simplify repo create (#39487)
phabricator: Simply repo create

We no longer need to perform a remote call from repo-updater in order to
create a Phabricator repo, we can simply call the DB directly. This
removes the need for an internal handler in frontend to talk to the DB
as well as the client code to call this handler.
2022-07-27 15:10:10 +02:00
Erik Seliger
ac88f10e35
Finish some deprecations and remove more unused routes (#39304) 2022-07-25 11:30:38 +00:00
Keegan Carruthers-Smith
e4b5d54e67
httpapi: remove unused internal CanSendEmail (#36358)
Hasn't been used in production for 30 days. No references to the
internal client. Outside of that no matches for the URL path in
Sourcegraph.

Test Plan: go test
2022-06-02 13:55:36 +02:00
Keegan Carruthers-Smith
17880e0587
httpapi: remove unused internal UsersGetByUsername (#36357)
Hasn't been used in production for 30 days. No references to the
internal client. Outside of that no matches for the URL path in
Sourcegraph.

Test Plan: go test
2022-06-02 12:44:52 +02:00
Keegan Carruthers-Smith
18f487ccaa
all: use any instead of interface{} (#35102)
Now that we require go1.18, we can use a builtin type alias for
"interface{}": "any". I've updated all code except lib, which can be
imported by external modules. That is currently pinned at go1.16.
Additionally I had to rerun generate since rewriting generated go code
will fail CI.

  find -name '*.go' | xargs gofmt -s -r 'interface{} -> any' -w
  git checkout lib
  go generate ./...

Test Plan: CI will exercise that the code still compiles. Otherwise this
is a noop.
2022-05-09 10:59:39 +02:00
Eric Fritz
7148009913
errors: Introduce internal package (#30558) 2022-02-07 15:03:45 +00:00
Camden Cheek
de8ae5ee28
Remove query runner (#28333)
This removes the query runner service. Followup work will remove all code around saved search notifications and update the graphql API.
2021-11-30 10:13:20 -07:00
Robert Lin
202bb5fa44
api: seperate internal client into internalapi (#28151)
Users of just the API types no longer need to import httpcli and a whole bunch of other things.
2021-11-25 11:02:57 -08:00