Commit Graph

26394 Commits

Author SHA1 Message Date
Keegan Carruthers-Smith
010e3ed41d
sg: use same PG envvar copy for code insights (#45204)
Directly constructing a DSN is incorrect, since the user may have just
specified a DSN. Instead we need to copy over from the same format that
the user specified for connecting to frontend. This is the same approach
use by codeintel.

Test Plan: sg start enterprise-codeinsights works on my machine (did not
before).
2022-12-06 05:41:14 +02:00
Eric Fritz
52fefe5292
codeintel: Add layer to translate raw/processed LSIF to SCIP (#45126) 2022-12-05 18:32:30 -06:00
Juliana Peña
3ea9be32fc
site settings: restore 'search.index.enabled' as a removed option (#45231) 2022-12-05 15:37:59 -08:00
Erik Seliger
3240589065
Remove repos.Source traces from fakeChangesetSource (#45153)
This is not required for batch changes anymore since we switched to our own Source type, so removing it to keep it lean 🧹
2022-12-05 23:54:13 +01:00
Noah S-C
07a0a59b6a
observability: build+propagate hierarchical observation contexts for telemetry provenance (#42765) 2022-12-05 21:52:30 +00:00
Aditya Kalia
c0a0f71dee
adding originalReferrer, sessionReferrer, sessionFirstUrl to our events (#44749)
* adding originalReferrer to our events

adding original referrer which is cookie name "_mkto_referrer" as our original referrer

* updated to remove omitEmpty clause

* new name reference fix

* refactored code

* fix to maintain string type (flagged by buildkite)

* fixed undefined value issue for originalReferrer

* refactoring to make sg lint happy

* Creating cookie `originalReferrer` and updated getOriginalReferrer func

* Update client/web/src/tracking/eventLogger.ts

Co-authored-by: Brett Hayes <bretthayes@users.noreply.github.com>

* run sg-prettier :D

* adding SessionReferrer as a field we collect

* Satisfied Sg Lint 🚀

* Update client/web/src/tracking/eventLogger.ts

Co-authored-by: Brett Hayes <bretthayes@users.noreply.github.com>

* Update client/web/src/tracking/eventLogger.ts

Co-authored-by: Brett Hayes <bretthayes@users.noreply.github.com>

* adding `sessionFirstUrl` to our events

* code cleanup

* logic fixes to make sure cookies are being set and values returned properly

* sg lint

* fix `sessionFirstUrl` to `sessionFirstURL`

* bug fix

Co-authored-by: Brett Hayes <bretthayes@users.noreply.github.com>
2022-12-05 16:46:42 -05:00
Juliana Peña
52a00af4da
search contexts: fix backend integration test (#45221)
* search contexts: fix backend integration test

* more fix
2022-12-05 13:25:25 -08:00
Stephen Gutekanst
e8f2e6dc78
blobstore: fix /data file permissions (#45226)
As Quinn noted in an earlier PR, if `/data` is not writable by the container
then we encounter these errors:

- `failed to create bucket: operation error S3: CreateBucket, https response error StatusCode: 403` from the precise-code-intel-worker service
- `sendSimpleErrorResponse: 403 AccessDenied Forbidden` in the blobstore Docker container logs

Docker inherits the permissions of the folder if it is created in the Dockerfile
and I forgot to include the creation of the `/data` folder previously. Fixing
this means we don't e.g. have to manually correct permissions in Docker Compose
or pure-docker deployment types.

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
2022-12-05 14:20:39 -07:00
chwarwick
fef5eabc76
insights: OOB migration for backfill v2 (#44907) 2022-12-05 14:48:47 -05:00
leo
e5d3e3ee8b
insights: make a single status query per series on the old backfill table (#45201) 2022-12-05 19:38:35 +00:00
Juliana Peña
ff6f03a5f7
search contexts: backend for setting as default and starring (#44624)
* db schema and graphql schema updates

* default contexts backend

* query for stars

* backend for settings stars and defaults

* sg generate

* fixes?

* add foreign keys

* idempotent constraints

* again

* search contexts: remove autodefined contexts from frontend, add to normal query (#44875)

* search contexts: remove autodefined contexts from frontend, add to normal query

* generate

* remove real global context, use union with dummy row instead

* fix some tests

* fix CountSearchContexts

* add test for CountSearchContexts

* search contexts: order contexts list by default first, then starred, then others (#44876)

* search contexts: order contexts list by default first, then starred, then others

* generate mocks

* Add test for new order

* explicit select and remove unused scan var

* simplify getting authenticated user

* fix go lint

* unit test for default contexts

* tests for starred contexts

* change graphql api to take user as param, add tests for this

* update db schema to make contraints prettier

* clean up db keys

* search contexts: update header in list page (#44966)

* search contexts: update header

* add back tab

* fix spacing

* fix action button width

* search contexts: table view in management page (#45001)

* search contexts: update header

* search contexts: table view in management page

* add menu

* fix build failure

* add back tab

* fix spacing

* fix action button width

* address minor issues from figma

* search contexts: card view for mobile (#45040)

* search contexts: card view for mobile

* fix build failure

* give up on sr-only mixin
2022-12-05 11:22:35 -08:00
Alex Ostrikov
d04f2f605a
web: use CopyableText in WebhookInformation. (#45177)
Test plan:
Storybook.
2022-12-05 18:44:45 +00:00
Eric Fritz
61342b3c52
codeintel: Tag content type on precise code intel uploads (#45187) 2022-12-05 12:10:39 -06:00
Keegan Carruthers-Smith
80c073613e
sg: remove ENABLE_STREAMING_REPOS_SYNCER from config (#45203)
This variable was removed in 3.31.

Test Plan: sg start
2022-12-05 18:09:26 +00:00
Brett Hayes
ca7e93dc3f
Fix spacing on search results page (#45182)
rm mb
2022-12-05 10:01:51 -08:00
Eric Fritz
83a87448e7
codeintel: Add additional canonicalization transformations (#45175) 2022-12-05 10:58:02 -07:00
Erik Seliger
bfba204ffd
Implement noCache flag on execute endpoint (#44838)
This PR implements (finally) the no cache flag on the execute endpoint. This means that we can finally allow not refreshing the workspace preview when the checkbox is toggled. For long-running workspace resolutions (like our scaletesting) this is a gamechanger to me (maybe just me who almost always runs without cache because I test execution a lot, but hopefully also someone else 😬).

This also changes a bit how we handle this flag as well:
We don't skip cache checking when no_cache is set anymore, so that the UI always reflects the cache status and you can simply say "don't use it" - this feels more expected to me than some checkbox that lives outside the spec that would modify the workspaces list.
So now the only thing that the workspace resolution does is setting the no_cache flag on the batch spec.
When the batch spec is executed, we check that field, or optionally overwrite it, if set in the mutation arguments.
The field on the createFromRaw,replaceInput mutations is now mostly there to forward that flag to the execute step once we have implemented autoApply and is not used from the UI for now.
2022-12-05 18:42:13 +01:00
Quinn Slack
1b52d29114
silently (without panics) enforce WatchPermissionsUserMapping called once (#45141)
The panic was unnecessary (and prevents us from running multiple services in the same process, which is an experimental goal of mine as part of creating a single Go static binary distribution of Sourcegraph).
2022-12-05 09:16:42 -08:00
Cezary Bartoszuk
2b04b4fa0e
Zoekt indexed or not as graphql filtering option with count support. (#44870)
* Zoekt indexed or not as graphql filtering option with count support.

* Update cmd/frontend/graphqlbackend/repositories_test.go

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>

* Update cmd/frontend/graphqlbackend/repositories_test.go

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>

* Update cmd/frontend/graphqlbackend/repositories_test.go

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>

* Add indexed: false, notIndexed: false test case

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2022-12-05 11:05:14 -06:00
leo
9c041c8193
insights: saving a new view of a scoped insight does not trigger recalculation (#44679)
Co-authored-by: vovakulikov <vovakulikov@icloud.com>
2022-12-05 11:40:22 -05:00
adeola
e747e78d2b
batches: follow up from #44458 (#45003)
clean up gitlab forks
2022-12-05 11:30:44 -05:00
leo
72ef1785f3
insights: chore: remove deprecated insights settings from dev config (#45194) 2022-12-05 11:23:39 -05:00
coury-clark
77a6b86793
insights: terminally fail series backfills that exceed an error threshold (#44912) 2022-12-05 10:55:33 -05:00
Petri-Johan Last
661cd4d0ee
Check link header to see if paginated results have a next page (#44955) 2022-12-05 17:17:26 +02:00
Petri-Johan Last
90037106e9
Add note about GitLab admin access on Sourcegraph (#45180) 2022-12-05 15:09:10 +00:00
Dave Try
e6c7dc8894
logging: migrate to sglog (#45108)
migrate to sglog
2022-12-05 10:08:40 -05:00
Petri-Johan Last
8578d6d510
Add an UpdateWebhook mutation to the GraphQL resolver (#44994) 2022-12-05 17:06:04 +02:00
Keegan Carruthers-Smith
ea12468c80
insights: factor out common OnProgress handler (#45132)
We can reduce code duplication here since we have the same handler copy
pasted 4 times. Motivated by an open PR which wanted to add a new
condition to the handler.

Test Plan: go test
2022-12-05 16:30:59 +02:00
William Bezuidenhout
4107fc850f
upgrade percy/cli to 1.16 (#45171) 2022-12-05 14:28:12 +00:00
Philipp Spiess
a89e206939
Add loading indicators to page switcher compoment (#45071) 2022-12-05 15:12:29 +01:00
David Veszelovszki
4037bc6251
Docs: Fix docs page link in main CONTRIBUTING.md (#45160) 2022-12-05 14:57:45 +01:00
Derek Cormier
fb1daf63d0
bazel: move generateGraphQlSchema.js to client/shared/dev and share c… (#45090)
* bazel: move generateGraphQlSchema.js to client/shared/dev and share code with legacy gulp build

* bazel: move generateSchema.js to client/shared/dev and share code with legacy gulp build
2022-12-05 14:57:02 +01:00
Petri-Johan Last
623cd1da89
Use external http client for OIDC token exchange (#45162) 2022-12-05 15:14:49 +02:00
Indradhanush Gupta
767ea733c2
graphqlbackend: Simplify pointer to value code (#45163)
Add a helper and clean up the repetitive code.

No functional change.
2022-12-05 13:09:51 +00:00
Indradhanush Gupta
7fb0a478a3
sg.config.yaml: Skip docker pull syntax-highligher if OFFLINE=true (#45161)
Why:

The docs currently suggest to comment out the docker pull command for
the syntax-highlighter image if OFFLINE=true. Instead of making devs go
through this process, skip the docker pull command if OFFLINE=true is
already set.

Better DevX. Win win.

[1]: https://docs.sourcegraph.com/dev/background-information/sg#offline-development
2022-12-05 18:36:34 +05:30
sourcegraph-buildkite
e70be369ca
zoekt: update to sourcegraph/zoekt@fa9e62197e (#45133)
Co-authored-by: keegancsmith <keegancsmith@users.noreply.github.com>
2022-12-05 12:27:39 +00:00
Rok Novosel
ca27002034
search results: remove n keybinding for selecting first result (#45155) 2022-12-05 14:25:19 +02:00
Keegan Carruthers-Smith
b14f7f0fcf
lib: generic iterator based on stripes iterator (#45017)
In a few places we have different patterns around pagination:
- Passing a closure in
- Returning a cursor for the client to use
- Just collect everything into a big slice

Other go libraries often will setup pagination patterns / use
interfaces. The API I quite like is the stripe-go one which is minimal
and reminds me a lot of Scanner from the stdlib. You just do something
like

  for it.Next() {
    doSomething(it.Current())
  }
  if it.Err() != nil {
    handle
  }

I imagine if we had this interface a few useful methods like

  Map[A,B](func(A() B, Iterator[A]) Iterator[B]
  Collect(Iterator[T]) ([]T, error)

etc. Basically could implement the same functions as present in
https://pkg.go.dev/golang.org/x/exp/slices
2022-12-05 11:55:11 +00:00
Ryan Slade
3102f000d0
debt: Remove NamespaceUserID and NamespaceOrgID from external services (#44992)
This concept no longer exists as it was part of Cloud V1. Database
tables were left intact.
2022-12-05 12:36:02 +01:00
David Veszelovszki
33007c438f
Outbound request log: Add complete call stack (#45151)
* Add complete call stack generation on the back end
* Add complete call stack display on the front end
* Sort headers alphabetically on the front end
* Add changelog item
2022-12-05 12:32:28 +01:00
Ólafur Páll Geirsson
7e0c77ae7f
Token selection: don't warmup non-interactive tokens (#45154)
Reduces the number of network requests when moving the mouse.
Context https://sourcegraph.slack.com/archives/C03CSAER9LK/p1670235444143509
2022-12-05 03:29:23 -08:00
William Bezuidenhout
a20edcb2aa
Revert "don't special-case dev mode for SRC_HTTP_ADDR default (#45139)" (#45152)
This reverts commit c312aa04a3.
2022-12-05 11:01:26 +00:00
Keegan Carruthers-Smith
ba91cccc31
search: add streaming skipped reason BackendsMissing (#45068)
This introduces a new progress message for when a zoekt backend goes
down. Previously we silently ignored this event, but now we atleast
communicate it. The first target for this is to let code insights retry
when this occurs.

Test Plan: updated unit tests
2022-12-05 12:04:25 +02:00
Keegan Carruthers-Smith
f95cd6ae60
doc: include documention on SRC_LOG_SCOPE_LEVEL (#45135)
This updates our go.mod to include this feature as well as document it.

Test Plan: CI
2022-12-05 12:00:50 +02:00
Quinn Slack
c312aa04a3
don't special-case dev mode for SRC_HTTP_ADDR default (#45139)
sg.config.yaml sets this to :3082 anyway, which means it listens on all ports.
2022-12-05 01:53:05 -08:00
Quinn Slack
a754901bd7
remove unnecessary import (#45149)
I accidentally added this in my juggling of some rebased commits.
2022-12-05 09:48:41 +00:00
Quinn Slack
21c0a97a0d
extract symbols service setup and config to shared package (#45140)
This makes it possible to invoke the symbols service (both the OSS and non-OSS variants) from another main function.
2022-12-05 10:25:41 +01:00
Quinn Slack
619e26ffd6
extract enterprise repo-updater to shared package for external invocation (#45142)
This is a copy-and-paste of the enterprise/cmd/repo-updater enterprise service constructors to a shared package so that the enterprise repo-updater can be invoked from a different entrypoint. There are no logic changes.
2022-12-05 01:16:48 -08:00
Quinn Slack
298b646b0d
remove old, rarely used, and broken search.index.enabled:false site config (#45138)
The `search.index.enabled` site config setting defaults to true for all deployment types (and has for ~2 years). It was possible to set `"search.index.enabled": false` in site config.

But this was broken; searches with `index:no` would show no results, and normal searches would show an error about index search being disabled. This setting made the instance completely unusable, so it is highly unlikely any instances were actually using it.

The need for this setting has also gone down dramatically with many more years of experience running indexed search at scale on many instances. If we need to bring back the ability to disable indexed search, we should reimplement it (because many code paths did not properly respect this setting).
2022-12-05 01:16:19 -08:00
Stefan Hengl
94abf9c015
api: remove type api.Repo (#45146)
type Repo is not used anywhere. Probably a leftover from a refactor.
2022-12-05 10:13:53 +01:00