Commit Graph

34497 Commits

Author SHA1 Message Date
Noah S-C
bc97fdbe34
add shellcheck & shfmt to pre-commit's pre-push hook (#59485)
Closes https://github.com/sourcegraph/sourcegraph/issues/54829

Next steps: 
- what safeguards will we have in place for when we remove this from `sg lint`
- should we remove it from `sg lint`, its likely not contributing much overhead even in the uncommon case of shell files being touched

_How did some of these violations get in when theres shell lints :clueless:_

## Test plan

`pre-commit run --hook-stage=pre-push shellcheck shfmt`
2024-01-11 14:16:22 +00:00
Stefan Hengl
0eaa40528e
search jobs: refactor SearchQuery interface (#59468)
Relates to #59329 

This is mostly a refactor to prepare for a JSON writer that replaces our CSV writer.

The high-level plan is to switch the internal (object storage) AND the external (download) format from CSV to JSON.

Test plan:
- CI
- Note: I had to update `SearcherFake`, hence some of the test data changed. It only affects a few tests and the character of the tests remains the same.
2024-01-11 14:46:23 +01:00
Christoph Hegemann
f666295b6f
Enables tree-sitter based locals references for Go (#59517)
enables tree-sitter based locals references for Go
2024-01-11 13:26:25 +00:00
Christoph Hegemann
a7b456f208
Improves locals queries for Perl (#59465)
* excludes `our` bindings from Perl locals
2024-01-11 12:37:55 +00:00
Christoph Hegemann
481c867c95
Improves locals queries for MATLAB (#59415)
Better handling for non-local definitions

Co-authored-by: Varun Gandhi <varun.gandhi@sourcegraph.com>
2024-01-11 09:47:37 +01:00
Warren Gifford
09063fe99d
release: sourcegraph@5.2.6 (#59504)
* release: sourcegraph@5.2.6

* manually remove all changes in doc folder to pass CI

* weird extra doc change added by vsCode md editor
2024-01-10 19:51:58 -08:00
Erik Seliger
24fc9f5923
otel: Log at most 128 characters for generic pq Arrays (#59501)
We sometimes pass huge data here, and this can cause a very large attribute to be rendered. This PR limits it to at most 128 characters, which was chosen arbitrarily.
2024-01-11 02:32:02 +01:00
Robert Lin
fc37f74865
monitoring: relax mean_blocked_seconds_per_conn_request alerts (#59507)
https://github.com/sourcegraph/sourcegraph/pull/59284 dramatically reduced the `mean_blocked_seconds_per_conn_request` issues we've been seeing, but overall delays are still higher, even with generally healthy Cloud SQL resource utilization.

<img width="1630" alt="image" src="https://github.com/sourcegraph/sourcegraph/assets/23356519/91615471-5187-4d15-83e7-5cc94595303c">

Spot-checking the spikes in load in Cloud SQL, it seems that there is a variety of causes for each spike (analytics workloads, Cody Gateway syncs, code intel workloads, gitserver things, `ListSourcegraphDotComIndexableRepos` etc) so I'm chalking this up to "expected". Since this alert is seen firing on a Cloud instance, let's just relax it for now so that it only fires a critical alert on very significant delays.
2024-01-11 01:14:28 +00:00
James McNamara
ec24769023
Removed pr-auditor and left redirect notice (#59497)
removed pr-auditor and left redirect notice
2024-01-10 15:15:24 -08:00
Bolaji Olajide
39eb9f3636
handle deleted users when listing team members (#59471) 2024-01-10 23:12:30 +00:00
Warren Gifford
f77f6cc50b
add a few changes for v5.2.6 release (#59495) 2024-01-10 21:45:16 +00:00
Geoffrey Gilmore
88c6c59257
grpc: retry: add test that exectures parallel requests (#59490) 2024-01-10 16:44:53 -05:00
Erik Seliger
0844070330
go: Remove override for go-tiktoken (#59489)
Has been merged, no longer needed.

## Test plan

CI, the new exposed constructor will cause a build failure if we didn't get the right version.
2024-01-10 20:31:36 +00:00
Gabe Torres
11b66cfbfd
Close existing access requests when user is created (#59113)
* close open access requests when user is created

* update test

* fix test

* remove empty lines

* remove verified email check

* update test

* Minor PR feedback (#59416)

---------

Co-authored-by: Petri-Johan Last <petri.last@sourcegraph.com>
2024-01-10 12:27:13 -08:00
Erik Seliger
adb95ea5bc
Fix data access race condition in gRPC retry logic (#59487) 2024-01-10 19:54:04 +00:00
Julie Tibshirani
ca489c612a
Search: add missing changelog entries for 5.2 (#59486)
This PR adds entries for several changes related to the search backend.
2024-01-10 11:42:24 -08:00
Noah S-C
53a48d9b23
nixos: add zig-cc platform sha for nixos (#59482)
## Test plan

Not relevant outside of nixos users, zig-cc only used for darwin cross-compile or nixos users
2024-01-10 17:51:52 +00:00
Robert Lin
1ee4b0393b
sg msp: expand destroy protection to more features (#59462) 2024-01-10 09:32:13 -08:00
Jason Hawk Harris
a39347c507
New Filters Panel: replace 'show all' logic with 'show more/less' logic (#59454)
* adjust logic and replace 'show all' with the show 'more/less' button
* ensure logic works when searching for filters
* remove state for allFiltersDisplayed to a static value
2024-01-10 10:13:29 -06:00
Noah S-C
cf2e4bbb32
chore: fix universal-ctags darwin GHA workflow (#59477)
Fixed bad copy-paste job 🤡 

## Test plan

Manually invoked workflow https://github.com/sourcegraph/sourcegraph/actions/runs/7476990901/job/20348648403
2024-01-10 15:42:36 +00:00
Jason Hawk Harris
66d12a2174
New Filters Panel: change background on hover (#59474)
add hover behavior change on filters panel in dark mode
2024-01-10 09:18:54 -06:00
Noah S-C
1cc6243434
chore: update universal-ctags GHA workflow (#59476)
Bringing in-line with versions from https://github.com/sourcegraph/p4-fusion/blob/master/.github/workflows/nix-build-and-upload.yaml

## Test plan

With `act` locally
2024-01-10 14:24:31 +00:00
Naman Kumar
4218a14611
Reset Cody Gateway usage cache automatically during limits sync on interval & TTL mismatch (#59330)
* Reset usage cache automatically on interval change

* address feedback

* Comments, Cleanups, Tests for `naman/reset-cody-usage-cache` (#59453)

* Add limiter.RecordingRedisStoreFake for tests

* Comments and Cleanups

* Add unit test for usage cache expiration

* Add new Bazel build dependency

* Run 'bazel run //:configure'

* Update cmd/cody-gateway/internal/actor/actor.go

Co-authored-by: Robert Lin <robert@bobheadxi.dev>

* Update cmd/cody-gateway/internal/actor/actor.go

Co-authored-by: Robert Lin <robert@bobheadxi.dev>

---------

Co-authored-by: Robert Lin <robert@bobheadxi.dev>

* Address TTL > interval logic placement feedback

---------

Co-authored-by: Chris Smith <chrsmith@users.noreply.github.com>
Co-authored-by: Robert Lin <robert@bobheadxi.dev>
2024-01-10 19:10:23 +05:30
Cezary Bartoszuk
d96eac03b3
Copying dotcom attribution client to gateway (#59285)
* Dotcom graphQL snippet search

* Draft issuing graphql request

* BUILD

* Test includes codegen

* BAZEL

* Add limit upper bound

* Update cmd/cody-gateway/internal/httpapi/attribution/handler.go

Co-authored-by: Rafał Gajdulewicz <rafax@users.noreply.github.com>

---------

Co-authored-by: Rafał Gajdulewicz <rafax@users.noreply.github.com>
2024-01-10 11:03:04 +00:00
Shivasurya
5fbab269a3
Add non-blocking error handling for semgrep findings (#59469)
* config change for semgrep scan

* Added comments for silencing exit behaviour
2024-01-10 10:55:55 +00:00
Keegan Carruthers-Smith
1e1d1db664
gomod: update zoekt to include chunkmatch perf fix (#59466)
This bump only includes one commit from zoekt which is a performance
fix. See the commit in the zoekt repo for details.

- 7487a0d531 chunkmatches: reuse last calculated column when filling

Test Plan: tested in zoekt repo and this CI
2024-01-10 12:33:50 +02:00
Noah S-C
d22ba3fe50
chore: remove unused bundle diff reporter (#59438)
Referenced an npm package thats no longer in the package.json closure, so this isnt runnable in its current state. 

From Valery: 
> This dependency [was used](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@aa6f683b6f86577a8ddf5287372fa26c22dfa81e/-/blob/client/web/scripts/report-bundle-diff.ts?L24) to generate detailed bundlesize diff reports for pull requests. It [does not](https://github.com/statoscope/statoscope/issues/148) support esbuild or vite yet, so we cannot use it with the new build infra. I'm not aware of any migration plans.

## Test plan

Checked for any references (none)
2024-01-09 18:07:23 -08:00
Jason Hawk Harris
1f947402c1
New Filters Panel: encase before/after values in double quotes where necessary (#59459)
encase before/after values in double quotes where necessary
2024-01-10 02:01:56 +00:00
Camden Cheek
3e8efc6048
Filters: fix icon for nonstandard codehosts (#59457) 2024-01-09 23:33:10 +00:00
Mohammad Alam
09b46b44a2
Logging previous values during setting changes (#59340)
* logging configs during siteconfig changes

* logging previous quota values

* changing logging

* adding more information to logging

* logging previous and new codehost config

* adding email to verification log

* Update internal/auth/userpasswd/reset_password.go

Co-authored-by: Vincent <evict@users.noreply.github.com>

* feedback changes

* variable fix

* removing prev quota logging due to extra db call

* spacing

---------

Co-authored-by: Vincent <evict@users.noreply.github.com>
2024-01-09 23:11:46 +00:00
James McNamara
d89baa3d3b
Allow repo wide pr-auditor opt-out of test plans and reviews (#59406)
* WIP

* flipped polarity so zero value was default
2024-01-09 14:53:22 -08:00
Julie Tibshirani
bcca3ccf4c
Searcher: Implement 'and' and 'or' match trees (#59363)
This change implements the searcher logic for 'and' and 'or' queries:
* Renames `matcher` to `matchTree` to be more consistent with Zoekt and
gitserver
* Adds `andMatchTree` and `orMatchTree`, plus a bunch of tests

This code is not yet hooked in end-to-end. In a final follow-up PR, we'll
update the jobs code to pass entire basic queries to searcher, and translate
them to these new match trees.
2024-01-09 14:27:10 -08:00
Camden Cheek
eeb2342492
Filters: update repo rendering (#59445)
This updates the filters panel to show only the org/name from the repo, removing the code host from the text by default and replacing it with a representative icon if it is a known codehost. Additionally, it adds a hover tooltip that shows the full repo name (including code host) so that a user can still see what repo it is even if it's a long repo name.
2024-01-09 12:30:16 -07:00
Camden Cheek
809461b1ee
Filters panel: title-case symbol kind (#59441) 2024-01-09 12:28:33 -07:00
Bolaji Olajide
3025a6bade
token: disable Authorize button on mobile device (#59424)
* don't allow redirect url when the request is from a mobile device

* add comment

* add comment

* BAZELLLLL

* disable authorize button on mobile devices

* add link to security issue

* update regex
2024-01-09 20:05:09 +01:00
Jean-Hadrien Chabran
1059406b23
chore: drop unused go pkg (#59433)
* chore: drop unused go pkg

* go mod tidy + bazel run :gazelle-update-repos

---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2024-01-09 20:02:28 +01:00
James McNamara
dab9f31e97
Added ts_projects for storybook files in client/* (#59400)
* added ts_projects for storybook files in client/*

* re-ran configure

* moved custom_js group up to top level
2024-01-09 10:37:53 -08:00
Stefan Hengl
a834619212
search: json encode repo metadata for csv export (#59334)
We received the feedback that it is not always obvious that metadata is line-separated in the CSV export of search results. Depending on the tool used to display the CSV, only the first metadata value might be visible. Additionally the current format can be hard to parse. 

Here we add a new column "Repository metadata JSON" to the CSV export of search results, which encodes metadata into a single line JSON. We deprecate "Repository metadata" but keep it around for backward compatibility for short period of time. 

## Test plan
- updated unit test
- manual testing: 
  - validated the JSON encoding with a python script that reads the CSV and parses the JSON field.
2024-01-09 19:31:25 +01:00
Jean-Hadrien Chabran
b697ec03e4
ci: avoid dropping ALL executors binary if BUILDKITE_TAG is empty (#59439) 2024-01-09 19:08:49 +01:00
William Bezuidenhout
7c84b91896
pre-commit: add pre-commit directives to token tests (#59423)
add pre-commit directives to token tests
2024-01-09 19:05:39 +01:00
Camden Cheek
b1c61f93e8
Filters panel: skip unknown symbol kinds (#59442) 2024-01-09 18:00:45 +00:00
Camden Cheek
341998d874
Chore: clean up RepositoryResolver, part II (#59405)
This does a few things to further clean up RepositoryResolver:

- It splits NewMinimalRepositoryResolver out of NewRepositoryResolver to make it more obvious when we're creating a fully-resolved RepositoryResolver and a lazy RepositoryResolver. It's pretty error prone to pass in a *types.Repo with only the Name and ID fields set.
- It moves the always-available fields ID and Name directly onto the struct to make it more clear that those are safe to use directly
- It refactors the lazy hydration to the more standard sync.Once pattern
- It changes a bunch of call sites to use api.RepoName instead of *types.Repo when a fully-resolved repo is not actually needed (removing a few DB calls in the process)
2024-01-09 17:17:06 +00:00
Camden Cheek
b4e59e55b0
Filters panel: fix label for commit dates (#59437) 2024-01-09 10:08:20 -07:00
Jean-Hadrien Chabran
2118cc4a39
chore: unexport version.MockTimestamp as it's only used in tests (#59434) 2024-01-09 16:19:58 +00:00
Camden Cheek
ef2a8650c4
Chore: clean up RepositoryResolver (#59402)
For reasons I don't fully understand even though it's probably my doing, RepositoryResolver depends on the search result type RepoMatch. There was some really convoluted logic about how only the name and id fields of RepoMatch were set, which is particularly confusing because a RepoMatch isn't even required to construct the RepositoryResolver. The only information being provided by RepoMatch was rev, which it really shouldn't be since a repository domain object should not even have a rev (that should be relegated to the GitCommitResolver or GitRefResolver, which contain a RepositoryResolver).

Anyways, this removes the dependency on the search result type.
2024-01-09 09:03:05 -07:00
Chris Warwick
89923a753b
Remove embeddings indicators from cody web chat (#59392) 2024-01-09 10:16:29 -05:00
Jean-Hadrien Chabran
32287e7365
sg: lint, prevent pnpm deadlocks (#59429) 2024-01-09 14:58:33 +00:00
Jean-Hadrien Chabran
dc0d555bf1
sg: bump git version requirement (#59428)
On older versions like 2.39.2, the no-locahost-guard script would
incorrectly report false positives.

Test plan: locally tested
2024-01-09 14:41:57 +00:00
Noah S-C
965efc3af1
nix: unset TMP and TMPDIR for bazel (#59388)
Due to a newly enabled (in bazel 7) `--incompatible_sandbox_hermetic_tmp`, and nix setting TMP/TMPDIR to something below /tmp, we encounter https://github.com/bazelbuild/bazel/issues/5900

## Test plan

`nix develop --command bazel build //dev/sg` is successfull
2024-01-09 15:38:14 +02:00
Keegan Carruthers-Smith
faf0210830
search: revert glob filter values from new keyword pattern type (#59381)
This reverts the changes made to support glob filters in the new keyword
search patternType. We have had mixed feedback on the change, so would rather
focus on the core improvement which is interpretting via AND.

This commit was generated by reverting all commits specific to globbing:

- 14e382e568 search: respect patternType when navigating to search results (#59164)
- 4f6cdb658c search: don't convert rev to regex for kw search (#59165)
- c6f0aa4b5d search: mention glob syntax in search mode picker (#59168)
- a0e660e1a8 search: use literal suggestions for keyword search (#59120)
- 92cfe03c10 search: support glob syntax for repo and file filters (#59080)

Test Plan: CI and spun up in local dev. Browsed around with new keyword search
mode turned on checking we still used regex. Then did a few searches using
regex syntax and confirmed it worked.
2024-01-09 13:59:06 +02:00