Commit Graph

37552 Commits

Author SHA1 Message Date
Petri-Johan Last
1cac35b246
Update wolfi hashes (#64289)
Ran `sg wolfi update-hashes`

## Test plan

Hashes updated.

<!-- 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
-->

---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2024-08-06 15:54:02 +02:00
Felix Kling
0959fbda1a
fix(svelte): Make /cody/dashboard work with the new web app (#64295)
Fixes srch-765

When navigating to `/cody/dashboard` and the new web app is enabled, the
user gets a "Not found" error. This doesn't happen in the React app.

The page doesn't exist in the new web app, hence the server should fall
back to the old web app but that doesn't happen.

Why? Because the server doesn't know about `/cody/dashboard` either. It
only exists in the React app.
Instead the server interprets this path as a (non-existing) repository
page. When the new web app is enabled, repository pages are handled by
the new web app, but since neither the repo nor the page exist in the
new web app, the aforementioned error is thrown.

Configuring this route on the server makes it so that the React app is
served instead.

## Test plan

Manual testing. Going to https://sourcegraph.test:3443/cody/dashboard
loads the React app.
2024-08-06 15:33:24 +02:00
Julie Tibshirani
958afb0936
Search: boost matches on quoted terms (#64298)
Follow up to #64207. In our old search semantics, quotes were
interpreted literally. So a query like `"sourcegraph"` would match only
strings like `fmt.Println("sourcegraph")`. Now, both single and double
quotes are used for escaping, and mean that the contents should be
searched exactly.

This PR makes sure to boost matches on quoted terms in result ranking.
This way, users familiar with the old syntax are more likely to find
what they're after.

## Test plan

Adapted unit tests. Re-tested all queries from #64207 manually, plus
these ones:
* `'sourcegraph'`
* `"sourcegraph"`
2024-08-06 15:55:24 +03:00
Erik Seliger
ff52b14dd1
chore: Remove unnecessary _ imports (#64158)
These imports don't seem to have side-effects so dropping them to keep the dependency graph simple.

Test plan: E2E CI still passes.
2024-08-06 13:28:29 +02:00
Erik Seliger
6b98c253ab
chore: Frontend does not need disk (#64273)
A long time ago, we dropped the requirement for frontend to have any
disk for caching. Our helm deployments use read-only rootFSes, so this
wouldn't even work.

This PR aims to make that clearer by removing some last remnants of
those times.

Test plan: Frontend starts locally and integration tests pass in CI.
2024-08-06 13:22:00 +02:00
Julie Tibshirani
f19af57fe4
Search: re-add support for 'lucky' patterntype (#64293)
In #64215, we removed support for smart search. We continued to allow
the `smart` search mode, but just execute with `precise` behavior.
However, we started to throw an error for `patterntype:lucky` (which is
the old way of specifying smart search). It turns out that `lucky` made
its way into some search links and settings, causing those searches to
fail.

This PR restores support for `lucky`, and remaps it to `standard`. This
preserves the semantics as much as possible (since smart search attempts
a 'standard' search as its first rule).

Closes SRCH-840
2024-08-06 14:04:09 +03:00
Varun Gandhi
8f058838ce
chore: Consolidate mocks for dbworker/store.Store type (#64294)
Let's not regenerate it 4 extra times -- it's already generated
once in a central dbworker/store/mocks package which we can reuse.
2024-08-06 18:40:25 +08:00
Felix Kling
e4a8ce52da
fix(svelte): Update top-level route list (#64272)
tl;dr: Everything is derived from `window.context.svelteKit.knownRoutes`

*buckle up*

### Context

After the new web app was enabled by default on dotcom I looked at
dotcom data in Sentry to see if there was anything out of the ordinary.
I noticed a high number of errors related to resolving repository
information. The most common non-existing repository that was reported
was `-/sign-out`.

Of course this shouldn't happen. `/-/sign-out` is the sign out URL and
shouldn't be interpreted as a repository.

Currently we prevent SvelteKit from interpreting specific paths as
repositories by using the `reporev` parameter validator:

```ts
// src/params/reporev.ts
const topLevelPaths = [
    'insights',
    'search-jobs',
    'saved-searches',
    // ... many more here
]

const topLevelPathRegex = new RegExp(`^(${topLevelPaths.join('|')})($|/)`)

// This ensures that we never consider paths containing /-/ and pointing
// to non-existing pages as repo name
export const match: ParamMatcher = param => {
    // Note: param doesn't have a leading slash
    return !topLevelPathRegex.test(param) && !param.includes('/-/')
}
```

`-/sign-out` was not in that list, including others which have been
added since this file was originally created.

Adding it would have been the simple solution but having to maintain
this list manually has always irked me. Now we have a better way...

### Production changes

#### Client side

It turns out we are already sending a list of known routes to the client
in `window.context.svelteKit.knownRoutes` to basically do the same
thing: test whether a given path is a page or a repository.

```ts
// src/lib/navigation.ts
let knownRoutesRegex: RegExp | undefined

function getKnownRoutesRegex(): RegExp {
    if (!knownRoutesRegex) {
        knownRoutesRegex = new RegExp(`(${window.context?.svelteKit?.knownRoutes?.join(')|(')})`)
    }
    return knownRoutesRegex
}

// ...

export function isRouteEnabled(pathname: string): boolean {
    let foundRoute: SvelteKitRoute | undefined
 
    // [...]

    if (foundRoute) {
        if (foundRoute.isRepoRoot) {
            // Check known routes to see if there is a more specific route than the repo root.
            // If yes then we should load the React app (if the more specific route was enabled
            // it would have been found above).
            return !getKnownRoutesRegex().test(pathname)
        }
        return true
    }

    return false
}
```

Why do we have the `reporev` validator and `isRouteEnabled`? They
basically do the same thing (check whether a path is a known page or a
repository) the first (`reporev`) is used by SvelteKit to determine
which route a path corresponds to (i.e. to navigate to the repository
page or whether the page doesn't exist) and the second one
(`isRouteEnabled`) is used after the route resolution but before route
loading. It's used to trigger a full page refresh to fetch the React
version if necessary.

Anyways, since we already have a list of known pages from the server,
the parameter validator should just use it too. Except it didn't work,
which made the following server side changes necessary.

#### Server

We register routes in multiple places. Right now `knownRoutes` is
populated from the router created in
`cmd/frontend/internal/app/ui/router.go`, but this does not include
`/-/sign-out`. This route (and others) are defined in
`cmd/frontend/internal/app/router/router.go` (I don't know what the
difference is). I extended the sveltekit route registration code so
that's possible to register routes from multiple routers.

I couldn't test it yet however because I currently can't get Sourcegraph
to run locally (Camden tested it; it works).

### Development mode changes

After the above changes, navigating to a React only page in development,
e.g. `/insights` would show a 'repo not found error' because
`window.context.svelteKit.knownRoutes` was empty in development. So
every non-existing page would be interpreted as missing repository.

Hardcoding a list of known pages *again* just for development seemed to
be a step backwards. So I spent quite a bit of time to find a way to
extract the JS context object from the HTML page returned by the origin
server and inject it into the HTML page generated by SvelteKit, similar
to how we do it for the React app.

Additionally the value of `window.context.svelteKit.knownRoutes` is now
used to setup the proxy to non-supported pages from the server, so we
don't have to maintain this regex anymore either:

```ts
 // Proxy requests to specific endpoints to a real Sourcegraph
 // instance.
 '^(/sign-(in|out)|/.assets|/-|/.api|/.auth|/search/stream|/users|/notebooks|/insights|/batch-changes|/contexts)|/-/(raw|own|code-graph|batch-changes|settings)(/|$)': { ... }
```

This means that requesting non-svelte pages will also return the
corresponding React version in development.


## Test plan

Manual testing.
2024-08-06 09:53:50 +00:00
Christoph Hegemann
4ebb805bd3
fix: uses the same base64 for decoding we use for encoding the UsageCursor (#64290)
At the moment we decode via the "Std" encoding, which expects padding
but we encode with "Raw" which doesn't add any.

## Test plan

Manual testing
2024-08-06 17:38:00 +08:00
Keegan Carruthers-Smith
c09552ed15
searcher: fix benchmarks (#64292)
Column helper now returns 0 based indexes. FilterTar became a required
function on diskcache.

Test Plan: go test -run '^$' -bench . ./cmd/searcher/internal/search

Fixes
https://linear.app/sourcegraph/issue/SPLF-183/benchmarks-in-searcher-broken
2024-08-06 11:33:52 +02:00
Stefan Hengl
155975259a
fix(search_jobs): progress reporting (#64287)
Relates to #64186

With this PR we only show `83 out of 120 tasks` if the search job is
currently processing. In all other states, we don't show this stat. This
is a consequence of the janitor job I recently added, because after
aggregation, this data is not available anymore. User's can still
inspect the logs and download results to get a detailed view of which
revisions were searched.

I also remove an unnecessary dependency of the download links on the job
state.

## Test plan:

I ran a search job locally and confirmed that the progress message is
only visible while the job is processing and that logs and downloads are
always available.

## Changelog
- Show detailed progress only while job is in status "processing"
- Remove dependency of download links on job state
2024-08-06 11:16:04 +02:00
Varun Gandhi
38633daef0
chore: Consolidate mocks for uploads's Store type (#64286)
Instead of re-generating and re-compiling the mocks 3 times,
consolidate them into a single storemocks package.

This should also provide better code navigation in the editor.
2024-08-06 10:15:17 +01:00
Varun Gandhi
224e23697d
chore: Reduce frequency of COUNT(*) on lsif_indexes (#64288)
Previously, for metrics reporting, we were querying the number of
queued+errored records every 5 seconds. For large queues +
heavy contention, this scan itself takes a few seconds, despite using
an index. Reduce the frequency of this scan as we
don't need updates to the queue size every 5 seconds.

## Test plan

Check that frequency of `COUNT(*)` is reduced on Sourcegraph.com once
this patch makes its way to Sourcegraph.com
2024-08-06 10:39:20 +02:00
Christoph Hegemann
e48368df53
Enable SCIP based APIs by default (#64285)
Closes
https://linear.app/sourcegraph/issue/GRAPH-784/default-scip-api-ff-to-on

Enable SCIP based APIs by default, as they're required for the web app
refresh.

## Test plan
Things have been going fine on Dotcom and S2
2024-08-06 06:12:30 +00:00
Stefan Hengl
737e460a64
chore(search): update logging of search durations (#64269)
The current logging is outdated. This PR is not a complete rewrite. It
tries to keep semantics mostly as-is but it is more generous when it
comes to what we log. (For example we didn't log `(AND foo bar)` before)

IMO this is a good compromise we can ship quickly and then take some
time to figure out how to distinguish suggestions, searches, code-intel
and whether it is a good idea to mix search types and result types.

Updates:
- Prefer to log result types, fall back to pattern type. (This is
largely the same logic as before but we don't bail for complex queries)
- Don't guess repo and file results types if not explicitly specified.
We loose a bit of information here but it keeps the code much cleaner.
- Allow "AND" and "OR" operators.

The updated test case gives a good overview of how we would log things
in the future.

Kept as-is:
- I left "new" and "legacy" logging in place. I am not sure how we use
the target stores right now so I wanted to keep this as-is for now.
However we should see if we can retire the legacy logging.
- The previous and current logic translates `type:file` queries to
pattern types. I guess this makes sense from the perspective of how
things are implemented in the backend.
- "type:path" is logged as "file".

## Test plan:
Updated unit test
2024-08-06 07:26:01 +02:00
Chris Smith
a310035006
Return 'sourcegraph' as the CodyLLMConfigurationResolver.Provider (#64276)
This PR fixes Cody autocomplete in some situations, fixing
[PRIME-426](https://linear.app/sourcegraph/issue/PRIME-426/autocomplete-completely-broken-in-main-with-and-sometimes-without-the).

Our story begins with this PR:
https://github.com/sourcegraph/sourcegraph/pull/63886. The PR updated
the `CodyLLMConfigurationResolver.Provider` GraphQL endpoint to no
longer return the "provider" that was put into the site configuration,
but to instead return the _display name_ of the provider, or if multiple
were configured the string "various".

```diff
- func (c *codyLLMConfigurationResolver) Provider() string {
- 	return string(c.config.Provider)
- }
+ func (c *codyLLMConfigurationResolver) Provider() string {
+	if len(r.modelconfig.Providers) != 1 {
+		return "various"
+	}
+	return r.modelconfig.Providers[0].DisplayName
+}
```

This change was wrong on several levels, and unfortunately stemmed from
the original author (me) not tracking down and understanding how the
GraphQL endpoint was actually used.

Once we discovered the problem, we quickly rectified this by changing
the behavior to the more correct version of returning the Provider ID of
the code completion model with
https://github.com/sourcegraph/sourcegraph/pull/64165:

```go
func (r *codyLLMConfigurationResolver) Provider() string {
	return string(r.modelconfig.DefaultModels.CodeCompletion.ProviderID())
}
```

However, after some more testing we discovered yet another edge case. We
didn't realize that the provider "sourcegraph" (which is how you
configure Sourcegraph to use Cody Gateway, using the older site config
method) was required in some scenarios on the Cody client.

So the new logic, of returning the Provider ID was incorrect. (Because
we report the _model_ provider, e.g. "anthropic". Not the _API_
provider, e.g. "sourcegraph"/"Cody Gateway".)

With this change, we should just have the behavior we had initially:
returning whatever the admin had configured in the
"completions.provider" section of the site config. If only the newer
modelconfig settings were used, we return "sourcegraph" if using Cody
Gatway. And if not, just return the Provider ID. (Though in some
situations even that will lead to incorrect results, because ultimately
we need to update the client here.)

## Test plan

I wasn't able to test this super-well manually, and am relying on
Stephen and Taras' knowledge of how the client uses this today.

## Changelog

NA
2024-08-05 19:15:11 -07:00
Ara
e0991a68ea
Improving Azure errors for customer containers (#64278)
Fixing the logging description for Containers

## Test plan
Tested locally with containers

<!-- 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-06 01:19:09 +00:00
Jacob Pleiness
44869b9a5c
appliance(chore): Remove legacy maintenance API (#64282)
Appliance now uses the API defined in internal/appliance. Deleted files
were no longer uses and an artifact from porting code from the POC.

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

## Test plan

Unit tests covering API are already in place.

<!-- 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-05 20:49:55 -04:00
Camden Cheek
b9823cc90b
Svelte: remove site admin gate on code intel preview (#64277)
When I added this, for some reason I thought it was site admin only. As
it turns out, it shouldn't be gated to site admins only, and it makes it
particularly annoying on dotcom.
2024-08-05 23:59:15 +00:00
Jason Hawk Harris
e5178a6bc0
Revert "[Svelte]: UI Updates for Perforce Depots and Git Repos" (#64275)
Reverts sourcegraph/sourcegraph#64014

We decided that including this in the August 7th release would be rushed
after diving deeper into the project. Reverting this in order to
re-write the functionality, especially the data loading components.

## Test Plan
- this is a revert PR. Everything will work as before.
2024-08-05 16:30:41 +00:00
Felix Kling
4e5ea2a082
refactor(svelte): Reduce logo complexity (#64274)
There is no need to have a separate image file for dark mode. The SVG
file can handle color switching itself.


## Test plan

Switched theme in the user menu and in the browser dev tools.
2024-08-05 18:19:32 +02:00
Camden Cheek
44d8512779
Svelte: make closing the welcome overlay more obvious (#64256)
In response to [this
request](https://sourcegraph.slack.com/archives/C05MW2TMYAV/p1722633022111559),
I modified the welcome banner to:
- Add a close button in the top right
- Close on click outside the banner
- Make the button primary rather than secondary
2024-08-05 08:51:40 -06:00
Erik Seliger
765a8cdaf1
chore: Move cmd/frontend/webhooks to cmd/frontend/internal (#64157)
Nothing outside frontend needs to import this package, to properly signify that we move it to internal where 90% of the other packages reside, and avoid ambiguity on "what service is running what code exactly".

Test plan: Just moved a package, Go compiler doesn't complain.
2024-08-05 16:46:38 +02:00
Erik Seliger
d8fb5aeb21
frontend: Consolidate remaining registry packages (#64156)
This PR simplifies and consolidates the remaining parts of the various registry packages, and moves everything under cmd/frontend/internal for better encapusation.
This also removes the need to _ import packages which feels very brittle.

Test plan: Go compiler doesn't complain about moved code.
2024-08-05 16:29:50 +02:00
Erik Seliger
3fd5abc292
frontend: Remove global conf server variable (#64155)
To make things more explicit and remove the global variable, this is now passed down to where it's needed.
It is a bit messy right now, since it's used deep in the serve-handler but that just highlights better where
it's actually used IMO. As a next step, I want to get rid of the requirement to indicate server-restart
required, so we should be able to drop a bunch of the prop drilling here.

Test plan: Still compiles, E2E test works.
2024-08-05 16:28:39 +02:00
Petri-Johan Last
f4116695a6
Update p4-fusion-sg wolfi-package (#64266) 2024-08-05 15:00:09 +02:00
Varun Gandhi
e5fdb5c3fc
fix: Fixes incorrect highlighting for comments at the start of a file (#64235)
The problem was that we were incorrectly not doing
a "stack push" operation when encountering a comment,
but we were doing a pop which triggered a change in the
source range for the next source range (this is done to
avoid overlap between the current occurrence and the
subsequent occurrence that will be emitted).

This is fixed by not ignoring comment markers. As a consequence, we will
emit a few more occurrences than earlier, but I don't think it should be a
big problem in practice. We can also fuse these if needed.
2024-08-05 20:58:56 +08:00
Taras Yemets
d19aa106f9
feat(cody): add circuit breaker to handle timed-out requests and rate limit hits (#64133)
<!-- PR description tips:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e
-->
Closes
https://linear.app/sourcegraph/issue/CODY-2758/[autocomplete-latency]-add-circuit-breaker-in-cody-gateway-to-handle

This PR introduces an in-memory model availability tracker to ensure we
do not send consequent requests to the currently unavailable LLM
providers.

The tracker maintains a history of error records for each model. It
evaluates these records to determine whether the model is available for
new requests. The evaluation follows these steps:
1. For every request to an upstream provider, the tracker records any
errors that occur. Specifically, it logs timeout errors (when a request
exceeds its deadline) and responses with a 429 status code (Too Many
Requests).
2. These error records are stored in a circular buffer for each model.
This buffer holds a fixed number of records, ensuring efficient memory
usage.
3. The tracker calculates the failure ratio by analyzing the stored
records. It checks the percentage of errors within a specified
evaluation window and compares this against the total number of recent
requests.
4. Based on the calculated failure ratio, the tracker decides whether
the model is available:
- Model Unavailable: If the ratio of failures (timeouts or 429 status
codes) exceeds a predefined threshold (X%), the model is marked as
unavailable. In this state, the system does not send new requests to the
upstream provider.
When a model is unavailable, the system immediately returns an error
status code, typically a 503 Service Unavailable, to the client. This
informs the client that the service is temporarily unavailable due to
upstream issues.
- Model Available: If the failure ratio is within acceptable limits, the
system proceeds with sending the request to the upstream provider.

This PR suggests considering a model unavailable if **95% of the last
100 requests within the past minute** either time out or return a 429
status code. I am not sure about these exact values and suggest them as
a starting point for discussion

## Test plan
- Added unit tests
- CI
<!-- 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-05 11:38:58 +00:00
Keegan Carruthers-Smith
199cab4a1b
gomod: update zoekt for shard scanning improvement (#64264)
This only contains one commit which reduces how often we call scan in
indexserver on dotcom.

- acacc5eda1 shards: only trigger rescan on .zoekt files changing

Test Plan: tested in zoekt CI
2024-08-05 12:36:27 +02:00
Varun Gandhi
a0b2a1dd45
chore: Remove incorrectly logged warning (#64267)
The cursor state can be "" when the data is exhausted.
2024-08-05 09:43:43 +00:00
Varun Gandhi
c8c8f32aff
fix: Handle potential nil reference properly (#64265) 2024-08-05 17:41:09 +08:00
Keegan Carruthers-Smith
e332124698
servicecatalog: remove searcher dep on database (#64247)
Searcher doesn't speak to the database nor has it for a long time. See
https://github.com/sourcegraph/sourcegraph/pull/61463

Test Plan: The following command is empty

  go run ./dev/depgraph/ summary internal/database | grep 'cmd/searcher'
2024-08-05 09:55:49 +02:00
Varun Gandhi
7595615f07
fix: Don't propagate un-translated source ranges (#64263)
The `getSourceRange` function can have a range translation failure,
in which case it would be wrong to propagate the range directly
without the commit information. So skip the ranges in that case.
2024-08-05 15:03:55 +08:00
Varun Gandhi
ef77a1e0e1
fix: Handle sub-repo permissions in CodeGraphData API (#64241) 2024-08-05 12:31:07 +08:00
Jason Hawk Harris
b0702f3c3c
[Svelte]: UI Updates for Perforce Depots and Git Repos (#64014)
Introduces basic (and incomplete) UI support for perforce, including displaying changelist ids,
listing changelists, and removing references to commits and branches.
2024-08-02 20:47:20 -06:00
Vova Kulikov
4caad25380
Cody Web: Update Cody Web to 0.3.6 [React version] (#64254)
Closes
https://linear.app/sourcegraph/issue/SRCH-720/new-chat-button-in-side-panel-view
Closes
https://linear.app/sourcegraph/issue/SRCH-808/chat-history-in-side-panel-view

This PR does a few things 
- Updates Cody Web to 0.3.6 (this includes improvements around mentions
UI, web url mention support, etc)
- Adds "create new chat" button to the sidebar cody chat UI
- Adds history chats UI to the sidebar cody chat UI (note that in GA we
will rely on the new Tabs UI, this history UI is just a temporal
solution for the Sourcegraph Aug release, in sep GA release it will be
improved)

## Test plan
- General manual checks on Cody Web.
- Check that you can create a new chat from the sidebar chat UI
- Check that you can select chats from the history panel from the
sidebar chat UI

<!-- 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-02 18:04:52 -03:00
Camden Cheek
c643c224ab
Chore: remove non-null assertions (#64249)
Followup from #64236
2024-08-02 15:01:48 -06:00
Camden Cheek
a148d8a670
Web: fix git blame for files that have /stream/ in their path (#64230)
The URL path for streaming blame is ambiguous when the file path
contains `/stream/`. The pattern looks like
`/blame/<repo_name>@<revision>/stream/file/path.txt`. However, if the
file contains `/stream/`, the revision is matched greedily up until the
last stream, so we end up with a revision that looks like
`81af3g/stream/my/path`, which is in invalid revision that results in a
404.

This makes the URL pattern unambiguous by adding a `/-/` element after
the revision, which is not allowed in a revision name and acts as a path
separator. So now, the pattern looks like
`/blame/<repo_name>@<revision>/-/stream/file/path.txt`.

Note, this is a public-facing breaking change, but I don't think it
really matters since I don't expect any customers use our streaming
blame API
2024-08-02 14:11:32 -06:00
Camden Cheek
b4566aae8a
Svelte: fix welcome banner flashing on reload (#64251)
Fixes SRCH-831
2024-08-02 17:16:57 +00:00
sourcegraph-buildkite
8f89c279f7
security: Auto-update package lockfiles for Sourcegraph base images (#64204)
Automatically generated PR to update package lockfiles for Sourcegraph
base images.

Built from Buildkite run
[#285676](https://buildkite.com/sourcegraph/sourcegraph/builds/285676).
## Test Plan
- CI build verifies image functionality

Co-authored-by: Buildkite <buildkite@sourcegraph.com>
2024-08-02 17:54:55 +02:00
Taiyab Raja
e652c7e59e
Styling updates throughout (#64221)
Resurrection of https://github.com/sourcegraph/sourcegraph/pull/64080 --
full details are there
2024-08-02 15:15:06 +00:00
Vincent
1a834fdc4f
fix: block URLs without a hostname (#64248)
In Go it's possible to have URLs without a valid host portion 🤷 .
This has unintended side-effects when filtering hostnames.

## Test plan
Tested that URLs that have no hostname are now blocked.

<!-- 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-02 15:53:33 +01:00
Christoph Hegemann
7fc92a5538
codeintel: make usage-range non-optional (#64236)
Closes
https://linear.app/sourcegraph/issue/GRAPH-727/make-range-for-usagerange-non-optional

## Test plan

Tests continue to pass
2024-08-02 14:51:57 +00:00
Michael Bahr
4a565a8819
fix(batches): show warning instead of error when the changeset status is not FAILED (#64243)
With SRCH-802 we saw error messages when batch changes may still retry
and resolve the problem. To give a better distinction between resolvable
and non-resolvable errors, I'm changing the colour variation from error
to warning if the changeset has not been marked as `FAILED` yet.

Before:

<img width="913" alt="Screenshot 2024-08-02 at 12 44 27"
src="https://github.com/user-attachments/assets/b192c5e9-d23b-460c-82a7-a039edbca3f5">

After:

<img width="1355" alt="Screenshot 2024-08-02 at 12 36 23"
src="https://github.com/user-attachments/assets/02e231a7-168a-4fe9-bd3b-014d810fd236">

## Test plan

Manual testing

## Changelog

- Batch changes that are still retrying now show a warning instead of an
error.
2024-08-02 16:22:30 +02:00
Keegan Carruthers-Smith
f7d62a3076
gitserver: RawDiff checks if commits exist (#64245)
ResolveRevision additionally adds a "^0" to the spec to make sure we
actually check if it exists. This is important, since most uses of the
ChangedFiles API pass in commit shas which do not get resolved by git
unless the "^0" is present.

I noticed this since hybrid search in searcher started to fail if the
commit was missing. In particular Zoekt for empty repositories uses a
fake SHA of 404aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa so when a repo
started getting cloned hybrid search would fail until it was indexed.
Hybrid search explicitly checks for the NotFound error, so hybrid search
failing was a a regression from moving away from the SymbolDiff API.
2024-08-02 13:10:04 +00:00
Erik Seliger
ad4d7177ab
Reapply "soap: Fix auto-redirect to IdP when SOAP is enabled" (#64234) (#64244)
This reverts commit
81585cb7ca.

## Test plan

Tested in dotcom mode locally after clearing cookies and no redirect
happens now.
2024-08-02 12:30:11 +00:00
Stefan Hengl
60c7e9b42f
gomod: update Zoekt (#64238)
ebb3ca2424...764fe4f9de

- https://github.com/sourcegraph/zoekt/commit/c01b6c7778 remove
SRC_EXPERIMENT_ITERATE_NGRAM_LOOKUP_LIMIT
- https://github.com/sourcegraph/zoekt/commit/bbd1fedfcd feat(Search):
Add support for all Apex language extensions
- https://github.com/sourcegraph/zoekt/commit/764fe4f9de index: enable
shard merging by default

Relates to SPLF-175

Test plan:
CI
2024-08-02 13:15:47 +02:00
Varun Gandhi
26c309916e
chore: Use binary search over symbols array (#64240)
Right now, perf is dominated by slowness of gitserver, but let's
avoid the pessimization in the old code with multiple linear lookups.
2024-08-02 10:29:17 +00:00
Petri-Johan Last
44e848d4ba
Enable p4-fusion by default for Perforce code host connections (#64101) 2024-08-02 11:15:16 +02:00
Filip Haftek
e4ebecf205
ephemerals: fix feature flag name (#64237)
Make ephemeral feature flag consistent across sg cli and CloudAPI:
-
[get](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/dev/sg/internal/cloud/instance.go?L193)
is ok
-
[set](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/dev/sg/internal/cloud/instance.go?L206)
was different
- CloudAPI uses now
[this](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/controller/-/blob/cmd/apiserver/api/v1/instance.go?L20)

## Test plan

[e2e against CloudAPI](https://github.com/sourcegraph/cloud/pull/12747)
2024-08-02 10:54:44 +02:00