Commit Graph

102 Commits

Author SHA1 Message Date
Noah S-C
7a9d2b02e4
chore(ci): emit compact executon log in CI (#63420)
Second attempt at https://github.com/sourcegraph/sourcegraph/pull/61760,
we can start using these to dig into action cache misses etc

## Test plan

CI passes green


## Changelog
2024-06-21 19:50:35 +01:00
Varun Gandhi
1284536eed
chore(codenav): Resolve repo and commit in common code (#63072)
Adds logic to validate as much of the args to usagesForSymbols as possible.
Also adds some infrastructure for property-based testing.
2024-06-07 21:58:36 +08:00
Noah S-C
8d5290f827
ci: emit Bazel BEP file (#62010)
Needed for ci-obs metrics pipeline

## Test plan

See buildkite build for this PR
2024-04-23 16:27:35 +01:00
Camden Cheek
d445842674
Chore: clean up .gitignore (#61182) 2024-03-15 13:15:37 +00:00
Jean-Hadrien Chabran
6a67b76877
ci: fix incorrect usage of target determinator (#59171) 2023-12-21 15:50:29 +00:00
Quinn Slack
63a1eca856
generate .css.d.ts for non-SCSS (plain .css) files as well (#58546) 2023-11-26 15:11:34 -08:00
Quinn Slack
de613e92b6
use esbuild for client/web builds (#57365)
Use [esbuild](https://esbuild.github.io/) instead of Webpack for builds of `client/web`, for faster builds (dev and prod) and greater dev-prod parity. This PR completely removes all use of Webpack in this repository.

`client/web` is the last build target that still uses Webpack; all others have been recently migrated to esbuild. Most devs here have been using esbuild for local dev of `client/web` for the last 6-12 months anyway. The change here is that now our production builds will be built by esbuild.

All sg commands, integration/e2e tests, etc., continue to work as-is. The bundlesize report will take a while to stabilize because the new build products use different filenames.

## Benchmarks

Running `pnpm run generate && time pnpm -C client/web run task:gulp webBuild` and taking the `time` output from the last command:

- Webpack: 62.5s
- esbuild: 6.7s

Note: This understates esbuild's victory for 2 reasons: (1) because esbuild is building both the main and embed entrypoints, whereas Webpack only builds the main entrypoint in this benchmark) and (2) because a lot of it is in the fixed startup time of `gulp`; esbuild incremental rebuilds during local dev only take ~1s.

## Notes

We no longer use Babel to produce web builds (we use esbuild), so we don't need any Babel plugins that optimize the output or improve browser compatibility. Right now, Babel is only used by Jest (for tests) and by Bazel as an intermediate step.
2023-10-23 10:59:06 -07:00
Quinn Slack
7984c4abde
rename {webpack => web}.manifest.json (#57449)
This file is produced by both Webpack and esbuild. It is not Webpack-specific.

```
fastmod -e yaml,ts,js,md,tsx WEBPACK_MANIFEST WEB_BUILD_MANIFEST
fastmod -e yaml,ts,js,md,tsx,go webpack.manifest.json web.manifest.json
fastmod -e yaml,ts,js,md,tsx,go webpackManifestPath webBuildManifestPath
fastmod -e yaml,ts,js,md,tsx,go 'webpack manifest' 'web build manifest'
fastmod -e go,ts,tsx webpackManifest webBuildManifest
fastmod -e go,ts,tsx WebpackManifest WebBuildManifest # not all accepted
```
2023-10-07 14:02:41 -10:00
Erik Seliger
58fe87f6b5
enterprise: Move last directory out (#57392)
This is the end of the PR train to remove the enterprise directory from out repo since we have consolidated to use a single license.

Bye rough code split :)
2023-10-05 20:15:40 +00:00
Camden Cheek
a146b80495
Chore: remove committed junit.xml (#57358) 2023-10-04 22:00:43 +00:00
Erik Seliger
8afcf3c53d
Remove accidentally committed playwright file (#57285) 2023-10-03 04:09:30 +02:00
Jean-Hadrien Chabran
610af550e1
chore: narrow gitignore glob for 'bazel-' (#56962) 2023-09-22 17:48:06 +02:00
Kelli Rockwell
f8ead8534b
cody web: provide suggestions in context selector (#56039)
* Add note to gitignore about cody directory inclusion

* Update docstring about user-history usage

* Re-index user history entries by user ID

* Pass authenticated user ID to useUserHistory hook

* Pass `authenticatedUser` through Cody chat UI component props

* Refactor scope selector queries to use fragments

* Hook up repo selector popover to query 10 most recently visited repos

* Change visibility of `UserHistory.loadEntries()`

* Pass authenticated user through a couple more components

* Refactor suggested repos query to grab 10 by name and first 10 embedded

* Construct suggested repos list from user history, transcript history, and defaults

* Display suggestions, cleanup popover height/display

* Initialize new transcript with previous scope

* Type fixups

* Some language cleanup

* Add docstring for user history hook

* Refactor repo suggestions out to a custom hook

* Re-index Cody transcript history entries by user ID

* Don't show suggestions section at all if there are none

* Update for autoload case

* Update cody-shared dependency

* Fix placeholder spacing

* DRY up suggestions rendering, improve spacing

* Use abbreviated repo name in header

* Bazel configure

* Update editor implementations for cody-shared package

* Add extra top padding to section headers

* Vertically align radio buttons in rows

* Update unindexed warning copy, link color

* Hide context explanation when repos are selected

* Remove "Great"
2023-09-11 04:25:47 +05:30
Erik Seliger
e0a8ff3d89
app: Move out of enterprise and merge with cmd/sourcegraph-oss (#56447)
Another item on the checklist to get rid of the enterprise directory.
2023-09-08 16:23:46 +02:00
Naman Kumar
ec7a6345e0
Update polling interval for embeddings status indicator (#55254)
Reduce polling interval to 2s from 5s for embedding status indicator.


## Test plan

- sg start dotcom
- visit /cody
- add repos to context
- check network tab for repos embeddings status gql request every 2
seconds.
2023-07-26 22:57:09 +05:30
Jean-Hadrien Chabran
32a7fbfdd6
bzl: avoid ui/assets/* dep on CHANGELOG.md (#54486)
Because we at least need one file to be present or the embed won't work,
this replaces CHANGELOG.md by CONTRIBUTING.md as a placeholder. This
will prevent PRs updating the changelog from invalidating the cache for
nothing for these slow targets.

## Test plan

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

CI
2023-06-30 09:11:27 -05:00
Nelson Araujo
6ec8df1e18
Start PostgreSQL on Windows via TCP on dedicated port. (#54103)
## Test plan

Windows testing is currently manually executing the application and
confirms it starts.
2023-06-26 15:43:26 -07:00
Noah S-C
35a8f87c7e
nix: reorganizing (#52273)
Re-organizing a couple of things to make the individual files nicer,
consolidated some things in ctags.nix, extracted forEachSystem stuff to
flake.nix instead of the individual files, overlay for our specific
nodejs requirements, some more comments to stuff

## Test plan

N/A, nix stuff
2023-05-31 16:20:32 +01:00
Valery Bugakov
3f96298eb4
bazel: test volatile variables with Percy (#51693)
Use volatile status variables provided by stamping to inject relevant
Git information into the Percy execution process. Percy needs Git commit
and branch to create an accurate report and auto-accept changes on main.
See extensive comments in the code for implementation details.

On the high level, instead of running the Percy CLI directly from Bazel,
we wrap it into the JS script that:

1. Reads volatile status variables with Git info.
2. Creates a Percy CLI command with these variables injected.
3. Exectes the command using args received from the Bazel target.

## Test plan

1. CI
2. Locally: `bazel test //client/web/src/integration:integration-tests
--define=E2E_HEADLESS=true
--define=E2E_SOURCEGRAPH_BASE_URL="http://localhost:7080"
--define=GH_TOKEN=fake --define=XXX` — replace `XXX` with the
`PERCY_TOKEN` from our shared 1Password vault.
2023-05-11 09:20:42 +00:00
Noah S-C
884dcbe833
bazel: make work on nixos ❇️ (#51154)
Some sprinkling of special sauce for the NixOS (and nix shell) users in
the house. Much care has been taken so that there should be no
interference with anyone running bazel on a non-nixos machine, and that
it also works as (mostly) expected for nix shell users on macos.

## Test plan

Ran main dry-run, all green, so it shouldnt interfere with anyone on a
non-nixos machine
2023-04-28 20:06:33 +00:00
Jean-Hadrien Chabran
1e4479947f
Port back compat tests to Bazel (#50932)
Clones and patches Sourcegraph git repository under
@sourcegraph_back_compat so we can run tests targets from that
particular release against the new database schema.

Flakes can be defined to skip known problematic tests which are either
flaky or simply cannot run against the new schema in case of a breaking
change. See //dev/backcompat:flakes.bzl for more details about how to
define them.

The final result is the definition of a @sourcegraph_back_compat target,
whose test targets are exactly the same as back then, but with instead a
new schema.

Example: `bazel test
@sourcegraph_back_compat//enterprise/internal/batches/...`.

See
https://github.com/sourcegraph/sourcegraph/pull/50932/files#diff-2f07315ec320aa4080768fec54f32ebb2cbf4e3e6df7c51a314beda827c48c41R104
for the command generating the mandatory patch file in CI for these
tests to run.
If the patch file were to be missing, a placeholder diff is in place to
make it explicit (in the eventuality of someone running those locally).

A new CI job has been added because this one is fully independent from
the other targets to build, and will be cached most of the time.
Depending how it goes, I might bring that one over the main bazel job to
avoid getting an agent just for that.

Because it's cached, we can run this within PRs and have it take 10s max
for 99% of the PRs and main builds.

TODO: The flakefiles are still there, they're just defined in different
place. I need to port the annotation as well, that has proven to be
really useful.

Also right now it's a bit manual as the 5.0.0 target is a bit peculiar,
but that'll get much simpler as we progress, as the next old release
will be requiring less and less patching.

This turns about a dozen of 10m individual jobs into a single one
ranging from 30s if there's not database changes to 10m if there's some
of them and cold cache.

## Test plan

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

QA: fails on old code when a new migration breaks something: 
-
https://buildkite.com/sourcegraph/sourcegraph/builds/214283#01879f2d-67be-4caf-b5d5-93f045e19348/118-126
2023-04-21 14:39:36 +02:00
Stephen Gutekanst
be4f4409a3
Sourcegraph App (single-binary branch) (#46547)
* internal: add service and singleprogram packages
* sg.config.yaml: add single-binary build targets
* internal/env: add a function for clearing environ cache
* internal/{workerutil,metrics}: add a hack to allow running 2 executors in the same process
* internal/conf: add single-program deploy type
* internal/singleprogram: clarify security
* cmd/sourcegraph-oss: add initial single-binary main (will not build yet)
* enterprise/cmd/sourcegraph: initial enterprise single-binary
* Add multi-platform builds for single-program
* single-binary: correctly build JS artifacts into binary
* license_finder licenses add github.com/xi2/xz "Public domain"
* internal/service/svcmain: correctly initialize logger for DeprecatedSingleServiceMain
* worker: refactor to new service pattern
* cmd/github-proxy: refactor to use new service pattern
* symbols: refactor to use new service pattern
* gitserver: refactor to user new service pattern
* searcher: refactor to use new service pattern
* gitserver: refactor to use new service pattern
* repo-updater: refactor to use new service pattern
* frontend: refactor to use new service pattern
* executor: refactor to use new service pattern
* internal/symbols: use new LoadConfig pattern
* precise-code-intel-worker: refactor to use new service pattern
* internal/symbols: load config for tests
* cmd/repo-updater: remove LoadConfig approach
* cmd/symbols: workaround env var conflict with searcher
* executor: internal: add workaround to allow running 2 instances in same process
* executors: add EXECUTOR_QUEUE_DISABLE_ACCESS_TOKEN for single-binary and dev deployments only
* single-binary: use EXECUTOR_QUEUE_DISABLE_ACCESS_TOKEN
* extsvc/github: fix default value for single-program deploy type
* single-binary: stop relying on a local ctags image
* single-binary: use unix sockets for postgres
* release App snapshots in CI when pushed to app/release-snapshot branch
* internal/service/svcmain: update TODO comment
* executor: correct DEPLOY_TYPE check
* dev/check: allow single-binary to import dbconn
* executor: remove accidental reliance on dbconn package
* executor: improve error logging when running commands (#46546)
* executor: improve error logging when running commands
* executor: do not attempt std config validation running e.g. install cmd
* executor: do not pull in the conf package / frontend reliance
* ci: executors: correct site config for passwordless auth
* server: fix bug where github-proxy would try to be a conf server
* CI: executors: fix integration test passwordless auth
* executors: allow passwordless auth in sourcegraph/server for testing
* repo-updater: fix enterprise init (caused regression in repository syncing)

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
Co-authored-by: Peter Guy <peter.guy@sourcegraph.com>
Co-authored-by: Quinn Slack <quinn@slack.org>
2023-01-19 17:35:39 -07:00
Valery Bugakov
304acdb5da
web: migrate from yarn to pnpm (#46143)
Bazel's rules_js rely on the pnpm package manager. To simplify the integration, we're migrating to pnpm from our current package manager — yarn. Another reason to migrate is that pnpm is cool and fast. 😉
2023-01-11 19:50:09 -08:00
Jean-Hadrien Chabran
6ee33f77f8
ci: cache golangci-lint cache across builds (#46043) 2023-01-06 13:31:15 +00:00
Valery Bugakov
79917a7e98
web: drop legacy GraphQL schema generator (#45945) 2022-12-25 18:10:20 -08:00
Juliana Peña
28e8c7679b
notebooks: remove elm compute component (#45360)
* notebooks: remove elm compute component

* fix update

* fix go build

* fix go tests

* update changelog

* remove elm-stuff
2022-12-07 12:59:05 -08:00
Jean-Hadrien Chabran
b1a56385e5
Initial Bazel Setup (#45052)
* bazel: initial bazel workspace and rules_js setup

* bazel: generate types for schema files

* bazel: generate graphql schema file

* Fix typo

Co-authored-by: Derek Cormier <derek@aspect.dev>
2022-12-02 12:57:14 +01:00
Eric Fritz
189d4f8e03
chore: Add index.scip to gitignore (#44944) 2022-11-30 09:02:16 -07:00
Valery Bugakov
51b5550de3
web: add Analyzing the Bundlesize check failure docs (#41164) 2022-09-01 04:47:57 -07:00
GitStart-SourceGraph
b283d24198
[SG-39284] Upgrade yarn to the latest version (#39728) 2022-08-31 20:39:53 -07:00
Jean-Hadrien Chabran
f851841026
ci: annotate Honeycomb events with buildkite metadata (#38641) 2022-07-12 15:38:14 +02:00
Camden Cheek
937a270762
Ignore go.work.sum in addition to go.work (#36049)
ignore go.work.sum in addition to go.work

This adds go.work.sum to the .gitignore in addition to go.work so that
it is not accidentally committed. The generated file is only relevant to
a local dev env.
2022-05-25 14:05:32 -06:00
Juliana Peña
ec4e74fcaa
Move compute Elm component to more generic location (#35908)
Move compute block to more generic location
2022-05-25 10:08:46 -07:00
Robert Lin
49668a24b5
dev/sg: remove globalConf, extract Config into sgconf (#33882) 2022-04-14 09:01:54 -07:00
Keegan Carruthers-Smith
738affd42f
ignore go workspace files (#33827)
This is a new feature in go1.18 to simplify working on multiple modules.
For example I can easily test sourcegraph with local changes to zoekt by
running the command:

  go work init . ../../google/zoekt/

These files shouldn't be committed, as they are files that are specific
to someones task.

Test Plan: my go.work file doesn't show up in git status
2022-04-13 08:20:57 +00:00
Rijnard van Tonder
6d4ebc96af
compute: additions to run standalone notebook component (#32701) 2022-03-24 09:57:07 -07:00
Rijnard van Tonder
f0ca58171f
compute: add notebook block component (#32290) 2022-03-09 17:38:35 -08:00
Robert Lin
a4ea4b3004
dev/ci: integrate test reports with AnnotatedCmd (#31969)
Integrates test reports scraping into AnnotatedCmd, removing a bunch of duplication and complexity from our test scripts and packaging test uploads into a neat pull-based API that allows local inspection of artefacts similarly to the annotations API.
2022-03-01 07:50:14 -08:00
Robert Lin
fadc40dd1f
dev/buildchecker: add ability to export history to honeycomb (#31360) 2022-02-24 14:50:35 -08:00
Tom Ross
e1440c4cef
Revert Mocha JUnit reporter usage (#31626) 2022-02-22 15:46:58 +00:00
Tom Ross
c2033ce1cd
ci: submit FE (some) test results to BK analytics (#28262)
Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>
2022-02-15 10:59:32 +01:00
Robert Lin
921a6fb761
dev/ci: introduce and migrate to bk.AnnotatedCmd (#30951)
bk.AnnotatedCmd is the generator-based pull-oriented annotations API to replace sporadic calls to annotate.sh and buildkite-agent annotate, splitting out annotation creation concerns out of check scripts and into the pipeline generator.
2022-02-11 12:32:26 -08:00
coury-clark
ae3d3a333b
chore: add .graphqlconfig to .gitignore (#30191) 2022-01-25 17:56:21 +00:00
TJ Kandala
29ef1da2a9
Create search and search-ui packages (#29773)
Co-authored-by: Juliana Peña <juliana@sourcegraph.com>
2022-01-20 12:56:23 -05:00
GitStart-SourceGraph
e7e705c808
[SG-28893] refactor: extract graphql folder into a new http-client package. (#29346)
Co-authored-by: gitstart-sourcegraph <gitstart@users.noreply.github.com>
2022-01-13 18:40:35 +01:00
davejrt
39ed379696
cleanup old vagrant tests (#29391)
* cleanup old vagrant tests

* add instructions to run e2e/qa locally
2022-01-04 11:19:37 -05:00
Jean-Hadrien Chabran
7703374cc1
ci: do not run annotate outside buildkite (#28068) 2021-11-23 10:32:51 +02:00
Tom Ross
105cf03e70
Performance: Pre-compress and serve Brotli assets (#25952) 2021-10-15 11:55:12 +01:00
Geoffrey Gilmore
88ef1f64fe
ci: add trivy security scanning step (#25756) 2021-10-13 16:28:07 -07:00
Tomás Senart
77864fa87f
all: remove files that were accidentally checked in (#25882)
Introduced in this PR: https://github.com/sourcegraph/sourcegraph/pull/25379

cc @courier-new
2021-10-11 11:08:38 +00:00