sourcegraph/cmd/frontend
Ólafur Páll Geirsson 7b1bc10a30
chore/API: speed up edit/test feedback loop for llmapi module (#64437)
Previously, it took ~6 seconds for a single edit/test/debug feedback
loop in the `llmapi` module. After this change, it's now 1-2s.

The reason the feedback loop was slow was that we depended on the
`//cmd/frontend/internal/modelconfig` target, which transitively brings
in `graphqlbackend` and all the migration code, which adds huge overhead
to Go link times. It was relatively easy to untangle this dependency so
I went ahead and removed it to boost my local feedback loop.

<!-- PR description tips:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e
-->

## Test plan
Green CI.

To measure the timing, I ran the tests, made a tiny change and ran the
tests against to measure the total time to build+test.

```
# Before
❯ time go test -timeout 30s github.com/sourcegraph/sourcegraph/cmd/frontend/internal/llmapi
ok  	github.com/sourcegraph/sourcegraph/cmd/frontend/internal/llmapi	2.394s
go test -timeout 30s   4.26s user 4.73s system 166% cpu 5.393 total

# After
❯ time go test -timeout 30s github.com/sourcegraph/sourcegraph/cmd/frontend/internal/llmapi
ok  	github.com/sourcegraph/sourcegraph/cmd/frontend/internal/llmapi	0.862s
go test -timeout 30s   1.20s user 1.21s system 135% cpu 1.774 total
```
<!-- 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-08-13 11:48:15 +00:00
..
auth chore: Move cmd/frontend/backend to internal (#64261) 2024-08-08 11:02:51 +02:00
dotcomproductsubscriptiontest feat/enterprise-portal: ConnectRPC layer for {Get/List}CodyGatewayAccess (#62771) 2024-05-27 13:39:57 -07:00
enterprise chore: Move cmd/frontend/webhooks to cmd/frontend/internal (#64157) 2024-08-05 16:46:38 +02:00
envvar Move dotcom check out of cmd/frontend (#60810) 2024-03-04 16:05:16 +00:00
graphqlbackend graphqlbackend: Move utils to internal/ (#64117) 2024-08-08 14:18:37 +02:00
hubspot chore: remove obsolete tracking code for Cody App downloads (#63364) 2024-06-23 21:48:31 -07:00
internal chore/API: speed up edit/test feedback loop for llmapi module (#64437) 2024-08-13 11:48:15 +00:00
shared frontend: Consolidate remaining registry packages (#64156) 2024-08-05 16:29:50 +02:00
BUILD.bazel Revert "Revert "refactor: upgrade to rules_oci 2.0 (2nd attempt)"" (#64354) 2024-08-08 09:00:08 +00:00
image_test.yaml chore: Frontend does not need disk (#64273) 2024-08-06 13:22:00 +02:00
main.go feat(frontend): do not embed frontend assets anymore (#63946) 2024-07-31 15:17:52 +02:00
README.md

frontend

The frontend serves our web application and hosts our GraphQL API.

Typically there are multiple replicas running in production to scale with load.

Application data is stored in our PostgreSQL database.

Session data is stored in the Redis store, and non-persistent data is stored in the Redis cache.