Commit Graph

600 Commits

Author SHA1 Message Date
Robert Lin
1f7e8d1fcf
log: add log sampling (#38451)
Enables log sampling by default for Sourcegraph components that use the new internal logging library - the first 100 identical log entries per second will always be output, but thereafter only every 100th identical message will be output. It can be configured for each service using the environment variables SRC_LOG_SAMPLING_INITIAL and SRC_LOG_SAMPLING_THEREAFTER, and if SRC_LOG_SAMPLING_INITIAL is set to 0 or -1 the sampling will be disabled entirely.
2022-07-08 08:27:09 -07:00
Camden Cheek
0aa0b0d8b0
Search backend: bump zoekt and use chunk matches (#38246)
This updates the pinned version of Zoekt and updates our calls to the Zoekt search API to request ChunkMatches.
2022-07-06 20:32:40 -06:00
Robert Lin
daa4e0e24c
internal/tracer: add OpenTelemetry tracer (#37984)
We extend internal/tracer to support a new tracer type, "opentelemetry", that sends everything in OpenTelemetry format using the OpenTracing bridge. See https://github.com/sourcegraph/sourcegraph/pull/37984 for more details.
2022-07-05 11:28:15 -07:00
Keegan Carruthers-Smith
0d28f99ff7
gomod: bump zoekt (#38219)
- 3a69966 indexserver: only log if someone else is running
- a6988a1 Export regexp optimisations
- ec21826 indexserver: allow specifying branches to index for sourcegraphFake
- b3aa3e8 go mod tidy
- 9208d95 merging: lock index dir during merge
2022-07-05 15:22:19 +00:00
Robert Lin
e873ba23b3
mod: update github.com/sourcegraph/log (#38186)
The main change included here is https://github.com/sourcegraph/log/pull/17
2022-07-04 18:51:54 +00:00
Jean-Hadrien Chabran
7f5437fe03
Bump sourcegraph/log (#38178) 2022-07-04 20:09:46 +02:00
Keegan Carruthers-Smith
e1ad83f556
gomod: bump zoekt (#37943)
includes

- 629b7ab indexserver: remove feature flag for explode
- dbb88ea indexserver: add IndexConcurrency for concurrent index jobs
- f331ab3 indexserver: introduce indexMutex
- b5426a7 read: inline delta-varint decoding in unmarshalDocumentSections
2022-06-29 18:58:59 +02:00
Robert Lin
9861a3a2c3
trace, profiler, router: remove datadog (#37654) 2022-06-27 14:05:11 -07:00
Eric Fritz
fc52955b07
mocks: Reorganize mock definitions into multiple files (#36967) 2022-06-27 20:59:16 +00:00
Keegan Carruthers-Smith
0871060dc5
searcher: handle empty diff output (#37536)
Empty output from git diff lead to the error message uneven pairs. This
is since bytes.Split on empty output returns "[][]byte{{}}".
Additionally added debug logging which would include the raw output. We
expect this error to not trigger, so this raw output would help
debugging.

Test Plan: Adjusting unit tests are a bit difficult at the moment, so I
relied on manual testing. I did a search on the default branch, but by
directly naming it so that searcher was used. After this commit it
works. For example

  repo:^github\.com/sourcegraph/scip$@main UnspecifiedSymbolRole
2022-06-24 18:06:30 +00:00
sourcegraph-buildkite
2354745048
zoekt: update to sourcegraph/zoekt@52951bd082 (#37605)
Co-authored-by: mpimenov <mpimenov@users.noreply.github.com>
2022-06-23 13:05:12 +02:00
sourcegraph-buildkite
5a34c8ac9e
zoekt: update to sourcegraph/zoekt@5078899473 (#37418)
Co-authored-by: eseliger <eseliger@users.noreply.github.com>
2022-06-23 11:55:42 +02:00
Erik Seliger
a9e2810c52
Use latest version of log library (#37538) 2022-06-22 12:05:31 +02:00
Asdine El Hrychy
7311145dd1
bitbucket project permissions: use the right logger for tests (#37316) 2022-06-20 12:18:11 +04:00
Robert Lin
c0a5f3eb3a
doc/dev: raise prominence of logtest.Scoped, make more tweaks (#37282) 2022-06-17 10:44:06 -07:00
sourcegraph-buildkite
d28c0550cd
zoekt: update to sourcegraph/zoekt@d20ed38dd9 (#37319)
Co-authored-by: stefanhengl <stefanhengl@users.noreply.github.com>
2022-06-16 13:20:11 +03:00
Erik Seliger
b4262d7442
Fixup out of date go.mod file (#37297) 2022-06-16 00:34:05 +02:00
Jean-Hadrien Chabran
03346d3ab9
Drop all explicit sentry refs (#37231) 2022-06-15 20:41:50 +02:00
Keegan Carruthers-Smith
33a6308126
gomod: update zoekt (#37230)
Take two since including regexp optimization for some reason broke integration tests.
I may have done it in a bad way. The commit still exists for zoekt, we just won't apply
it for the regexes we create from sourcegraph just yet. So this is an unrevert but just
skips the unit test that was failing.

- 145fe82 Upgrade pcre2 package
- b61c934 indexData: experimental ngram map via binary search
- aacaf0c gomod: downgrade datadog
- 2eec411 gomod: bump ctags to avoid zombie procs
- b744e52 Convert regexp capture groups to non-capture groups
- a174ad6 fix inaccurate comment
- 7a91c48 Split `lineBounds` out into its own method
- f846f01 Create `newlines` type
- 5c5f94b improve descriptions of entries on /debug endpoint
- 25fa2fa builder.go: have incremental builds update latest commit date information
- 15dc905 indexserver: remove debug commands
- 6c563dc tests: fix alignment for number hints like "--0123"
- 0cafd7b all: stop using the deprecated package io/ioutil
- c16eb04 tests: replace ioutil.TempDir with testing.T.TempDir
- 6ca5909 go.mod: fix a cve in a transitive dependency to make Dependabot happy
- f2bb82f debug: add debug score for line matches
- a3e0a5f indexserver: support SG_PRIORITY file for FS fake
- fce3356 indexserver: always cleanup if index fails
- 794ad6c debug: new pages for List and listIndexed
- c85ca2f ranking: boost base filename matches

Test Plan: CI
2022-06-14 20:05:52 +02:00
Robert Lin
a3133a9390
Revert "gomod: update zoekt" (#37226)
Revert "gomod: update zoekt (#37213)"

This reverts commit 119a1ae677.
2022-06-14 22:34:34 +05:30
Robert Lin
0d0932c7c3
deps: upgrade github.com/sourcegraph/log (#37138)
This includes:

- https://github.com/sourcegraph/log/pull/2
- https://github.com/sourcegraph/log/pull/4
- https://github.com/sourcegraph/log/pull/3
2022-06-14 09:00:29 -07:00
Keegan Carruthers-Smith
119a1ae677
gomod: update zoekt (#37213)
- 145fe82 Upgrade pcre2 package
- b61c934 indexData: experimental ngram map via binary search
- aacaf0c gomod: downgrade datadog
- 2eec411 gomod: bump ctags to avoid zombie procs
- b744e52 Convert regexp capture groups to non-capture groups
- a174ad6 fix inaccurate comment
- 7a91c48 Split `lineBounds` out into its own method
- f846f01 Create `newlines` type
- 5c5f94b improve descriptions of entries on /debug endpoint
- 25fa2fa builder.go: have incremental builds update latest commit date information
- 15dc905 indexserver: remove debug commands
- 6c563dc tests: fix alignment for number hints like "--0123"
- 0cafd7b all: stop using the deprecated package io/ioutil
- c16eb04 tests: replace ioutil.TempDir with testing.T.TempDir
- 6ca5909 go.mod: fix a cve in a transitive dependency to make Dependabot happy
- f2bb82f debug: add debug score for line matches
- a3e0a5f indexserver: support SG_PRIORITY file for FS fake
- fce3356 indexserver: always cleanup if index fails
- 794ad6c debug: new pages for List and listIndexed
- c85ca2f ranking: boost base filename matches

Test Plan: CI
2022-06-14 15:26:05 +00:00
Camden Cheek
02eacb067d
Remove sqlx dependency (#36924)
We removed all the uses of sqlx features during a refactor, and now its
existence is making other refactors difficult. This removes the sqlx
dependency and migrates its uses to `database/sql`.
2022-06-10 09:58:24 -06:00
Robert Lin
a3ae76403f
dev/sg/check.Runner: check-and-fix framework and experimental 'sg setupv2' (#36556)
A lot of copy-paste for now of the existing sg setup code, the goal is to eventually consoldiate and remove the existing sg setup implementation
2022-06-10 15:09:21 +00:00
Eric Fritz
1c0afc0c5b
mocks: Reorganize generated mocks (#36803) 2022-06-09 15:19:32 -05:00
Noah S-C
bbf07bed05
codeintel: surface upload audit logs in graphql and UI for non-deleted uploads (#36306) 2022-06-09 00:17:49 +00:00
Robert Lin
95c6946b9d
lib/log: migrate to github.com/sourcegraph/log (#36834)
This change migrates lib/log to https://github.com/sourcegraph/log in the hopes of easing adoption for other services.
2022-06-08 15:02:38 -07:00
Naman Kumar
1458b0cd20
Add lazy feature flag evaluation (#35359)
* Add logic to store evaluated feature flags (when flagSet.GetBool|GetBoolOr called) in Redis to use when logging event logs
* Add new GraphQL API endpoints
* Add frontend feature flag utility defaultValue support
* Add tests

Co-authored-by: Erzhan Torokulov <erzhan.torokulov@gmail.com>
Co-authored-by: Camden Cheek <camden@ccheek.com>
2022-06-07 23:04:23 +06:00
Idan Varsano
b99999b6ec
Revert gologin version change (#36685) 2022-06-07 10:10:02 -04:00
Eric Fritz
95245da370
mocks: Speed up generation of mock interfaces (#36681) 2022-06-07 00:21:50 +00:00
Chris Wendt
eb15fa61e5
rockskip: Grab existing symbols from Postgres instead of ctags (#36612) 2022-06-06 12:07:30 -06:00
Noah S-C
285241fe86
gomod: bump pgtype version for hstore fixes (#36550) 2022-06-03 15:48:01 +01:00
Chris Wendt
e1bf278d02
Improve the error message in the symbols sidebar (#36441) 2022-06-02 21:33:43 +00:00
Robert Lin
f46cc8dce9
dev/ci: fix go generate lint (#36342)
Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>
2022-06-01 15:29:21 +02:00
Robert Lin
fb0c2accb3
dev/sg: fix diff output in Buildkite without using Buildkite condition (#36193)
The root cause of the go generate failures seems to be termenv.IsDarkBackground() hanging indefinitely in Buildkite. To work around this:

- Add ForceDarkBackground output option, set to true in Buildkite
- Refactor output capabilities detection to be lazy (if an override is set, do not do any detection at all)
- Change most usages of output.NewOutput to std.NewOutput for consistency and to avoid the problematic dark background detection

Reverts "ci: fix sg lint go hanging on generate failures (#36043)" (commit 8703224738)
2022-05-30 11:48:15 -07:00
Andre Eleuterio
709793f1fb
Upgrading dependencies (#36185)
* upgrade golang dependencies

* go mod tidy

* go mod tidy

* bump eventsource

* bump goland tools

Co-authored-by: Dave Try <davetry@gmail.com>
2022-05-30 10:43:58 -03: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
Robert Lin
98a825b851
dev/sg: migrate schema decode to sourcegraph/run (#35836) 2022-05-23 22:28:52 -07:00
coury-clark
81532ef38b
Insights: remove unused fields (#35673) 2022-05-20 11:45:25 -07:00
Andre Eleuterio
1f6d0c955a
Upgrade base prometheus image (#35824)
* Update base prometheus image

* Update prometheus client
2022-05-20 15:44:56 -03:00
Robert Lin
f96ffaaaad
lib/output: migrate WriteMarkdown to shared Output implementation (#35719)
This enables other tooling to take advantage of nice formatting, and also means we can integrate with some internal features, such as color toggling and terminal width detection.
2022-05-19 16:40:44 +00:00
Robert Lin
9db9cfba75
dev/sg: migrate sg generate to use sg/run, render nice diff, do not lint generate in dirty dir (#35682)
With uncommitted changes, sg lint go is inaccurate because it reports all your code changes as generated changes. Maybe we can do some kind of stashing first, but that will affect other lints, so let's just do this for now.
2022-05-19 09:10:10 -07:00
Keegan Carruthers-Smith
5a9900e236
gomod: bump zoekt to prevent multi-writers on index dir (#35714)
Includes commits:

- 3bb00e7 indexserver: assert and check for ownership on index directory
- ec4be9d tests: make the code pass the go vet checks
- cdb5037 all: minor refactoring

Test Plan: CI
2022-05-19 15:36:37 +00:00
sourcegraph-buildkite
02ab38399b
zoekt: update to sourcegraph/zoekt@92148cf913 (#35388)
Co-authored-by: ggilmore <ggilmore@users.noreply.github.com>
2022-05-18 20:15:09 +00:00
Keegan Carruthers-Smith
26ec516649
gomod: update zoekt (#35621)
Includes the following changes:

- fe739e1 indexserver: debug list support -exclude_indexed
- 204b687 indexeserver: better logging for sourcegraphClient
- 3e8cba3 dockerfile: include curl
- 8a49c63 indexserver: seperate tmpfriend for debug vs main command
- a118209 indexserver: minor refactors around fetch
- 8efa934 ci: add shfmt

Test Plan: CI
2022-05-18 09:05:15 +00:00
Robert Lin
865d0efe71
mod: fix github.com/dghubble/gologin to github.com/dghubble/gologin/v2 (#35599)
github.com/dghubble/gologin/v2 is the correct import path for the version of this module that we should be using, since are at v2+ already: https://github.com/dghubble/gologin/blob/v2.3.0/go.mod#L1
2022-05-17 16:48:44 -07:00
Dax McDonald
99efb11ca6
Update crypto lib for CVE (#35573) 2022-05-17 17:06:26 +00:00
Keegan Carruthers-Smith
d66f204245
gomod: Replace deprecated src-d/go-git (#35466)
Both gopkg.in/src-d/go-git.v4 and github.com/go-git/go-git/v5 are
imported in our project, and src-d/go-git is already deprecated. Let's
switch to go-git/go-git.

Signed-off-by: blanet <moweng.xx@alibaba-inc.com>

Co-authored-by: blanet <moweng.xx@alibaba-inc.com>
2022-05-16 11:19:05 +00:00
Keegan Carruthers-Smith
792c3d580c
search: support doublestar for largeFiles (#35411)
We have supported this in zoekt for many months, but the change was
never documented nor implemented in searcher. This PR finishes the task.

Test Plan: go test ./cmd/searcher/internal/search
2022-05-16 08:49:23 +02:00
Robert Lin
e58c5dd1e9
dev/sg: re-enable SVG lint in CI, migrate svgo.sh to go script (#35399) 2022-05-13 15:58:25 +00:00