Commit Graph

32 Commits

Author SHA1 Message Date
Robert Lin
407b0b7201
cody-gateway: rename service from LLM-proxy (#52565)
This change only renames internal references and the LLM-proxy image
itself.

Will follow up with another PR to rename licensing, database tables, and
the GraphQL queries/mutations.

Paired with https://github.com/sourcegraph/infrastructure/pull/5010
Part of #52258 

## Test plan

CI, `sg start dotcom`, `sg run llm-proxy`
2023-05-30 08:44:27 -07:00
Robert Lin
1388d1289f
llm-proxy: add graphql client generator (#51318)
Adds a generated client for talking to Sourcegraph.com's GraphQL API.
This is mostly copy-pasta from [the generated client we set up for
Sourcegraph
Cloud](https://github.com/sourcegraph/controller/tree/main/internal/srcgql),
but simplified for use here. Example usage:

```go
c := dotcom.NewClient(sourcegraphToken)
resp, err := dotcom.CheckAccessToken(ctx, c, licenseToken)
if err != nil {
	log.Fatal(err)
}
println(resp.GetDotcom().ProductSubscriptionByAccessToken.LlmProxyAccess.Enabled)
```

Why a generated client? The API surface between LLM-proxy and dotcom
will hopefully be small, but a generated client is IMO still a far
superior experience than writing the query in a Go string, hand-crafting
the appropriate structs and hoping for the best. This gives us robust
typechecking, boilerplate generation, and [nice pathways to
mocking](https://github.com/sourcegraph/controller/blob/main/internal/srcgql/gqltest/gqltest.go)

Some of the copy-pasta adds tracing instrumentation - will follow up to
add an exporter for it.

Part of https://github.com/sourcegraph/sourcegraph/issues/50726

## Test plan

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

n/a - this setup is pretty tried and tested in Cloud, and this PR
doesn't add any actual usages yet

---------

Co-authored-by: Valery Bugakov <skymk1@gmail.com>
2023-05-02 10:53:31 -07:00
Keegan Carruthers-Smith
eca13930d3
unrevert "all: rename go module google/zoekt to sourcegraph/zoekt" (#40423)
Last time we changed the zoekt module name it broke the wire protocol
for zoekt. This now includes one more commit such that the wire protocol
is unchanged:

- c9182fcd2a rpc: use old module name when registering gob values

Revert chain:
- #40404
- #40353

Test Plan: Ran a local dev server with a hardcoded zoekt-webserver
pinned to the old version (the google/zoekt module). indexed search was
failing. Then upgraded the gomod version and it started working.
2022-08-17 15:30:49 -07:00
Thorsten Ball
85efb7af51
Revert "all: rename go module google/zoekt to sourcegraph/zoekt (#40353)" (#40404)
This reverts commit 6d376d871a.

See #inc-134-search-on-sourcegraphcom-fails-with-errors in Slack.

Current suspicion is that it causes gob-encoding/decoding problems in
production if the code below is not in sync with the zoekt cluster code.
2022-08-16 08:07:12 +00:00
Keegan Carruthers-Smith
6d376d871a
all: rename go module google/zoekt to sourcegraph/zoekt (#40353)
We have updated the module name in the zoekt repo to our own repository name.
This means we can remove the replace directive and just rely on normal go
tooling.

Note: at the same time we rename the default branch for zoekt from master to
main.

Test Plan: master dry run in CI.
2022-08-15 16:49:26 +01:00
Ólafur Páll Geirsson
9dcdfb95d9
Remove unused LSIF Typed code (#35791)
* Add diff for a TypeScript file to trigger CI job

* Rename job

* Delete unnecessary TypeScript file after validating CI job

* Remove unused "LSIF Typed" code

This code got moved to a separate repo github.com/sourcegraph/scip.
2022-05-25 11:23:13 +00:00
Eric Fritz
3d864a5567
chore: Use tools.go over unused functions to keep dependencies in go.sum (#31930) 2022-02-28 14:58:19 +00:00
Eric Fritz
8d1e172d61
lsif-typed: Add reference documentation (#29750) 2022-01-14 09:29:43 -06:00
Eric Fritz
4c33c9d011
Add protobuf generation check to CI (#29605) 2022-01-11 23:25:35 +00:00
Geoffrey Gilmore
c5d0dddc1d
generate/mockgen.sh: use pinned version of goimports (#25082)
Following
https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module

Using an unpinned version can cause an unintended package upgrade whenever
golang.org/x/tools publishes a new version.
2021-09-20 09:47:26 +02:00
Camden Cheek
e102d21ce2
build with go 1.17 (#24566)
Upgrade our tool versions to build with go 1.17. Additionally, fix the new linting errors that come along with that.
2021-09-03 14:46:55 +00:00
Noah S-C
1246e4353a
efritz/go-mockgen -> derision-test/go-mockgen (#21734) 2021-06-04 13:40:44 +01:00
Erik Seliger
b50a1fe27f
Finish work inlining most assets (#19279)
There were a couple more things to be inlined and a few references in docs which aren't up to date anymore.
2021-03-22 23:41:13 +01:00
Keegan Carruthers-Smith
1f80aac6c6
zoekt: build updates to enable multiple branch indexing (#10549)
* gomod: update zoekt

Includes the following commits

- 9d90c1c gitindex: allocate buffer of correct size
- aa0e667 zoekt: verbose flag prints shard metadata
- ddddd93 gitindex: do not resolve HEAD ref
- 8c0aee7 build: handle nil Options in largeFilesFlag
- 36a801c indexserver: use temp directory on same mount as indexes
- 070c191 indexserver: align flag defaults with dockerfile
- 35dabc7 indexserver: optionally shallow clone and use zoekt-git-index
- f89b8e3 indexserver: inline CmdArgs into archiveIndex
- ef52f4b indexserver: consistently use a pointer to indexArgs
- e407d68 indexserver: store root in indexArgs
- 70628e0 indexserver: factor out index logic
- 4961ee9 indexserver: add cli flags to debug indexing and listing
- 4abd60f indexserver: log success
- 605d890 indexserver: metrics track if we skipped indexing
- 1a62bb8 indexserver: rename metric vars to have metric prefix
- a2233e1 indexserver: check incremental in process
- ddccdf9 indexserver: use build.Options to generate flags
- 8463ade Do not ignore large files.

* zoekt: set cpu_fraction flag for indexserver

The default was 0.25, but was bumped to 1.0. This bump was done to align
the flag defaults with how we run indexserver in cluster
environments. We update our dev and single image environments to use the
same value. Those environmemts don't have resource isolation so we need
to continue using 0.25 rather than allowing indexing to use all cores.

* all: build and include zoekt-git-index

If you are indexing multiple branches this command is required. This
adds the command to our dev and single docker image environments. The
docker images for cluster already include the command (see zoekt repo).

* gofmt
2020-05-11 14:08:38 +02:00
Eric Fritz
d49aee8694
Rewrite precise-code-intel-api-server in Go (#9703) 2020-04-24 08:22:14 -05:00
Keegan Carruthers-Smith
63ca96af9f
dev: install dlv and goreman outside of module (#9612)
This prevents us needing to include the dependencies in our go.mod. Additionally
right now dlv has some conflicts in its dependencies with what we use, leading
to build errors. We can install the same version of dlv by just using "go get"
more like how we did it before go modules.
2020-04-07 00:52:36 +02:00
Keegan Carruthers-Smith
4baef5a6e3
dev: remove golanglint-ci deps (#9575)
It depends on GPL code. Lets make it clear we do not pull in GPL code, even if
it is only for our tooling. golanglint-ci is currently disabled on CI, so we
just remove it. When we want to add it back we need to use the same pattern as
we use for some other dev tools (IE download the release rather than compile the
tool)
2020-04-04 15:42:04 +02:00
Keegan Carruthers-Smith
a581e7027a
dev: download caddy binaries (#9303)
This uses the same pattern we use for docsite and jaeger. This avoids including
all the dependencies of caddy as well as avoiding the need to build it.
2020-03-25 10:37:04 +02:00
Keegan Carruthers-Smith
95cb2507a9
dev: remove txeh (#9302)
txeh can be replaced with a grep and an append to /etc/hosts, so is an
unneccessary dependency. Additionally, we install it via sudo which causes
issues with your go cache. You end up writing entries into your go cache as
root, breaking your cache when used as yourself.
2020-03-25 10:10:37 +02:00
Geoffrey Gilmore
5173cbc0a6
use caddy 2 for https local development (#9050) 2020-03-24 10:25:34 -07:00
Keegan Carruthers-Smith
baa025303c
dev: use docsite binaries instead of building (#8518)
docsite brought in a lot of dependencies. It is faster to just fetch prebuilt
binaries. This is some tech debt I have been wanting to do for a long time,
especially since it often caused problem when doing go mod update.
2020-02-20 15:57:17 +00:00
Stephen Gutekanst
c23f977b81
Remove the management console (#7197)
Remove the management console and merge all critical configuration automatically into the site configuration.

Instead of the management console, a file-based site configuration editing escape hatch is now available and is documented.

See [the added 3.11 migration notes](https://docs.sourcegraph.com/admin/migration/3_11) for details on the implications of this change, and ["editing your site configuration if you cannot access teh web UI"](https://docs.sourcegraph.com/admin/config/site_config#editing-your-site-configuration-if-you-cannot-access-the-web-ui) for how to use the new escape-hatch configuration file.

Fully-detailed proposal and motivations behind this change are documented in the PR description here: https://github.com/sourcegraph/sourcegraph/pull/7197

Associated PRs:

- https://github.com/sourcegraph/deploy-sourcegraph/pull/478
- https://github.com/sourcegraph/deploy-sourcegraph-docker/pull/54
2019-12-16 21:30:51 -07:00
Keegan Carruthers-Smith
20079a085c
go.mod: Remove original go1.13 replacement hacks (#5828) 2019-10-01 23:32:40 +02:00
Keegan Carruthers-Smith
73361f1649
dev: Correctly specify delve in go.mod (#3779)
This will prevent the ever changing go.mod whenever someone runs the local dev
environment.
2019-05-02 17:05:50 +02:00
Farhan Attamimi
8910ea6416
fix: rename instances of derekparker/delve to go-delve/delve (#2371) 2019-02-19 16:23:29 -08:00
Keegan Carruthers-Smith
3c0dd652cc
all: Replace godockerize with Dockerfiles (#1976)
We use a branch of godockerize which generates a build.sh and Dockerfile instead
of directly building the docker image.
https://github.com/sourcegraph/godockerize/tree/gen-build

This was run on all main entrypoints (excluding a few which already have a
build.sh / shouldn't be docker images):

  go list -f '{{ if (eq .Name "main") }}{{.ImportPath}}{{ end }}' ./... \
    | grep cmd | grep -v goreman | grep -v 'schemadoc' | grep -v /server \
    | while read pkg; do godockerize build $pkg; done

The build.sh should likely be refactored into using a shared shell script. But
for now this gives us a nice and easy to change replacement.

This commit also removes godockerize from CI and our go.mod.
2019-01-22 13:27:36 +02:00
Quinn Slack
ededdfc5ae
check for broken links, etc., in documentation in CI (#1591)
* go get github.com/sourcegraph/docsite@master

* check for broken links, etc., in documentation in CI

Running `docsite check` at the top level also runs the checker.
2018-12-31 23:42:48 -06:00
Stephen Gutekanst
f6eb23799c
Configuration refactoring + management console (#966)
* use .Critical accessors; use conf.Unified type

* pkg/conf: add unified configuration types

* {pkg/conf,cmd/...}: rewrite conf package to be database-backed

* pkg/legacyconf: import from sourcegraph@v2.13.6 pkg/conf/ (and reduce)

* legacyschema: import from sourcegraph@v2.13.6 schema/ (and reduce)

* add dev config override support

* cmd/management-console/assets: add assets package for packing web app code

* cmd/management-console/web: initial webapp implementation

* schema: split site.schema.json into site and critical configuration portions

* schema: critical: add gitlab as valid auth.providers key (broken in master)

* web: update to reflect site config changes

* cmd/management-console: initial backend implementation

* cmd/management-console: add Go backend

* cmd/management-console: add TS frontend

* web: site-admin: add management console password alert

* cmd/management-console/internal/tlscertgen: package for TLS certificate generation

* schema: update docs

* upgrade deasync

* pkg/conf: add proper config defaults for each deployment type

* vfsgendev installation fix

* mgmt console web package-lock.json change

* assets doc.go + gitignore change

* gofmt assets

* dev/check: use dev build tag

Some things such as assets are only defined behind a dev build tag OR
after generating something via `go generate`. Since go generate has not
run yet, I am opting to use the `dev` build tag here.

* cmd/management-console/auth_test.go: simplify test

* fix go assets

* pkg/conf/confdefaults

* pkg/conf: validation test fix

* web: update to reflect site configuration changes

* expose management console port in docker run commands

* management-console: go: return concrete type to /update requests, not type that can arbitrarily change in future

* management-console: web: fix saving ID bug + properly display errors

* pkg/db/confdb: return an error if the creator is not up to date

* web mgmt console error handling

* mgmt console go backend ErrNewerEdit

* pkg/conf: fix zero configuration check (marshaled JSON is "{}")

* add linter for accidental transitive imports of pkg/conf in mgmt console

* enterprise/dev/ci: fix building of non-enterprise docker-images branches

* NOCHANGELOG
2018-12-12 14:59:15 -08:00
Nick Snyder
500c9b292a
Make delve work (#1297) 2018-12-09 13:58:09 -08:00
Nick Snyder
d1bfb9e60f
Use golanglint-ci (#1094) 2018-12-05 09:44:08 -08:00
Keegan Carruthers-Smith
60afebac64
Remove vendor (#379)
* git rm -r vendor

* ci: Remove go mod vendor check

* all: remove direct uses of vendor

* all: Specify GO111MODULE=on and GOBIN for generate

* ci: Enable go modules when generating pipeline

* ci: Enable go modules for every pipeline step

* ci: Use count flag to force test run instead of disabling GOCACHE

* ci: Use next branch of honnef.co/go/tools

master currently does not support go modules, but next should.

* all: Update to pass next branch of staticcheck
2018-10-15 11:27:49 +02:00
Sourcegraph
02a03f54c1 Publish Sourcegraph as open source 🚀
Internal revision: sourcegraph/sourcegraph-intermediate-2018@d0cebbadc7
Executor: @slimsag
2018-09-30 23:13:36 -07:00