Commit Graph

37522 Commits

Author SHA1 Message Date
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
Varun Gandhi
4f21a5a4b9
chore: De-duplicate CTE for visible uploads (#64232)
The visible uploads detection was copied in yet another place,
so de-duplicate that.
2024-08-02 13:58:33 +08:00
Varun Gandhi
07beaf6bc1
chore: Bump version of sourcegraph/log library (#64233)
I noticed we were using a much older version, so code nav
is a bit janky on S2 as the old version had index data from
lsif-go and not scip-go, causing cross-repo nav from
sg/sg to sg/log to not work.
2024-08-02 13:37:10 +08:00
Varun Gandhi
f9bc3cf1df
fix: Prefer SCIP uploads over LSIF uploads (#64217)
When determining the set of visible uploads at a given commit,
we group uploads from scip-K and lsif-K for ranking purposes
to allow them to shadow each other. Generally, scip-K will end
up shadowing lsif-K, avoiding sending the client a mix of data
from a much older lsif-K index when newer data from a scip-K
index is available.

Fixes https://linear.app/sourcegraph/issue/GRAPH-787

The logic requires some final tie-breaking to avoid non-determinism
in case when there is a scip-K and lsif-K index at the same distance,
which I've done based on the upload_id in descending order
(upload IDs are monotonically increasing). Earlier, some code was
doing tie-breaking based on upload_id in _ascending_ order,
so I've changed that for consistency. This caused some test failures,
so I've updated the corresponding struct literals.

I've left some PR review comments to describe each modification
to the existing test cases.

## Test plan

Added a new dedicated test checking for shadowing behavior.

## Changelog

Fixes a bug where old LSIF uploads would also be used for code
navigation even when newer SCIP uploads were available for the
same language, potentially leading to duplicate results in the reference
panel. With this change, scip-go uploads shadow the uploads
for lsif-go, and similarly for other indexers following the
scip-X/lsif-X naming
convention.
2024-08-02 13:36:50 +08:00
Vova Kulikov
81585cb7ca
Revert "soap: Fix auto-redirect to IdP when SOAP is enabled" (#64234)
Reverts sourcegraph/sourcegraph#64184

The sourcegraph/sourcegraph#64184 is probably caused auth redirect on
dot com. Revert it while we're fixing the original problem

## Test plan

CI
2024-08-02 04:48:21 +00:00
Camden Cheek
ee3a710b7c
Chore: remove enablePreciseOccurrences feature flag (#64229)
Just removes a redundant feature flag.
2024-08-02 00:02:53 +00:00
YK
e6ae7d44b2
fix(docs): update quickstart guide links (#64202)
- Update the "getting started" link in the quickstart guide to point to
the correct URL
- Remove the outdated developer help links as they are no longer
relevant

## Test plan

Test the links manually
2024-08-01 16:18:55 -07:00
YK
83f553e1ec
Update the legacy link to sg doc (#64017)
## Test plan

Check each new link manually

---------

Co-authored-by: Bolaji Olajide <25608335+BolajiOlajide@users.noreply.github.com>
2024-08-01 16:18:30 -07:00
Chris Smith
655375de08
Don't block frontend initialization with invalid modelconfig (#64200)
When the `modelconfig` system was introduced, the code was written in a
way to go out of its way to ensure that the configuration data was
correct. Unfortunately, this doesn't interact well with the reality of
the Sourcegraph instance and how site configuration is set.

- Failing to initialize the `modelconfig` component if the site config
is invalid prevents the `frontend` binary from starting up. Leading to
it crash looping / an outage. Not good.
- The site config can be forced-in, regardless of any validators that
are registered. So it's definitely possible for the model configuration
to be invalid.
- Some of our validation checks were a bit too onerous anyways.

This PR refactors the `modelconfig/init.go` file to try really hard to
not fail on application start up. And instead just do its best to
initialize the `modelconfig` service.

- If the site configuration data is invalid, it will just be ignored.
And therefor default to the Sourcegraph instance using Cody Gateway /
Sourcegraph-supplied models.
- If _rendering_ the LLM model configuration fails (e.g. merging the
static configuration and admin-supplied site config), then we just
initialize the modelconfig service with 0 providers, and models. (But
still let things start up.)

These changes should fix
[PRIME-449](https://linear.app/sourcegraph/issue/PRIME-449), but this
still isn't enough for a good user experience. (Since we are now just
swallowing/ignoring modelconfig errors.)

So my next PR will be to add the site configuration validation logic, so
that we surface any of the configuration errors to site admins.

## Test plan

Tested this manually, and could no longer get my `frontend` job to fail
on startup.

## Changelog

NA
2024-08-01 15:56:23 -07:00
Anish Lakhwara
856e41eff3
fix(appliance): Make Appliance URL envvars strings (#64227)
<!-- PR description tips:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e
-->
Changes `APPLIANCE_MANAGED` -> `APPLIANCE_UPDATE_TARGET`, and creates
`APPLIANCE_MENU_TARGET`. Both are stringly typed env vars, that when set
will create / redirect the update buttons / menu links in the site admin
and nav item pages.

Paired with @nelsonjr and @DaedalusG on this 

## Test plan

<!-- REQUIRED; info at
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->
Manually Tested

## Changelog

<!-- OPTIONAL; info at
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c
-->
- **fix(appliance): make environment variables strings to be passed
around**
2024-08-01 15:45:25 -07:00
Camden Cheek
aaa464e332
Cody web: add server-side fetching for URL mentions (#64223)
Due to CORS rules, cody web cannot make requests to arbitrary URLs.
Because of this, mentions for URLs do not currently work in Cody Web.

This adds a GraphQL endpoint to the cody context resolvers that resolves
the contents of a mentioned URL.
2024-08-01 16:01:37 -06:00
Camden Cheek
eb1a76ee7a
Svelte: welcome banner followups (#64222) 2024-08-01 15:12:06 -06:00
Vova Kulikov
e073ae59cf
Bump @sourcegraph/cody-web to 0.3.4 (#64224)
Closes
https://linear.app/sourcegraph/issue/SRCH-561/add-support-for-file-ranges-in-cody-web

## Test plan
- Check that you can mention files with ranges
- Check that as you open Cody chat on the blob UI page and you have
selected lines in blob UI then chat should have an initial context
mention with line range
- Check that as you change line selection it updates mention file chip
range (only if you don't have any other text)
2024-08-01 17:30:13 -03:00
Craig Furman
156aa5a0ad
fix(appliance): cache authorization status (#64213)
In order to reduce the cost of calls to auth-gated endpoints, cache
valid admin passwords in-memory. The appliance's frontend calls
auth-gated endpoints in a tight loop, and bcrypt checking is
intentionally an expensive operation.

This could occasionally cause the appliance-frontend to disconnect from
the backend. We observed frontend's nginx reporting an upstream
connection close, and exec'ing into its pod and curling the backend
regularly hung.
2024-08-01 17:38:15 +01:00
Craig Furman
e54407d9f5
fix(appliance): reliably redirect to site-admin post-install (#64216)
When the admin has first installed Code Search Suite, the appliance
waits for the admin to click an "I'm ready" button. This causes the
appliance to unblock a background thread that periodically checks the
health of sg-frontend. When it is healthy, it ensures that the
ingress-facing frontend is pointed to sg-frontend. And when it is not,
it points to the appliance-frontend. Pointing to the appliance-frontend
is its initial state pre-install, and given that we've just installed
sg, the appliance switches the service over quickly.

Meanwhile, clicking this button transitions the frontend to a "refresh"
state (this being one of the states in its state machine). This causes
the UI to reload the web page. The reason we have to do this is that it
is a way to "redirect to yourself". If the ingress-facing service has
been repointed, refreshing like this will show site-admin, which is the
desired behavior. The issue this commit fixes, is that this is racy:
upon refresh, the browser tab queries the appliance (via an nginx proxy
hosted on the same domain serving appliance-frontend) for its state. We
have to store state on the backend (specifically, we use a ConfigMap
annotation), so that the appliance can do the right thing if it has been
rebooted at any time. This will help power future features such as
UI-driven upgrades. The race occurs if, upon refresh, the ingress-facing
service has been flipped over to sg-frontend. The appliance API that
answered the state questions is no longer available!

In general, we can't tell the difference between this expected turn of
events, and a state in which the backend can't be reached. This commit
mitigates the race by setting the appliance UI to refresh if it cannot
reach the appliance API. This looks no different to a "disconnected"
state if things really are broken, but in the expected path, it will
resolve the race by retrying.

This commit reliably causes the appliance-driven installation flow to
redirect to site-admin after clicking "ready", according to my
experimentation in minikube. I suspect that this would be the case even
without https://github.com/sourcegraph/sourcegraph/pull/64213, which
fixes an unrelated performance issue. I suspect we need both, otherwise
the appliance UI will regularly disconnect for prolonged periods of
time, which is confusing.

Closes
https://linear.app/sourcegraph/issue/REL-308/appliance-frontend-seems-to-disconnect-the-backend-during-installation
2024-08-01 17:26:49 +01:00
Julie Tibshirani
5c5ed6ca27
feat(search): remove smart search logic (#64215)
This change removes the backend smart search logic. After this, searches
with smart search enabled (`sm=1`) will be executed in the default
'precise' mode (`sm=0`). For old searches that use `sm=1` and
`patterntype=standard`, it's possible that they will now return no
results.

Looking at telemetry, only 0.1% of searches on dot com trigger any smart
search rule. So this change should only affect a small percentage of
usage. To mitigate the impact on these rare cases, this PR adds an alert
whenever there are no results and smart search is enabled, suggesting
users switch to keyword search. (This will help in the majority of
cases, since the most frequent smart search rule rewrites literal
queries to use 'AND' between terms).

Closes SPLF-92
2024-08-01 18:02:35 +03:00
Vova Kulikov
50dbc74fba
Bump @sourcegraph/cody-web to 0.3.2 (#64195)
This PR brings the most recent version of @sourcegraph/cody-web package
- Improvements in how we fetch providers and debounce logic for their
query
- Fix with switching-chat actions and providers list 

## Test plan
- Manual checks over cody web (React and Svelte version)
2024-08-01 12:01:35 -03:00
Matthew Manela
772e149729
feat(search): Add support to all Apex language extensions (#64194)
Part of
[GRAPH-759](https://linear.app/sourcegraph/issue/GRAPH-759/issue-with-apex-extension-not-appearing-for-langapex)

Linguist only supports a subset of the file extensions often used for
the Apex programming languages. This PR adds support for the main set
commonly used.

**Key changes**
1. Adds all extensions for Apex
2. Update our logic to handle multiple extensions for one language
3. Update tests to ensure we only manually map languages if they don't
exist OR have different extensions in go-enry (prevents us from
duplicating entries completely from go-enry)

## Test plan
- [x] Update unit tests
- [x] Validate locally by testing the language filter
2024-08-01 10:58:59 -04:00
Stefan Hengl
cd38adb4a7
chore(search_jobs): add janitor job (#64186)
Fixes SPLF-119

This adds a background job to Search Jobs that periodically scans for
finished jobs to aggregate the status, upload logs, and clean up the
tables. This drastically reduces the size of the tables and improves the
performance of the Search Jobs GQL API.

For example, with this change, a finished search job on .com only has 1
entry in the database, whereas before it could have several millions if
we searched each repository.

Notes:
- the diff seems larger than it actually is. I left a couple of comments
to help the reviewers.

## Test plan:
- new unit tests
- manual testing:

I ran a couple of search jobs locally (with the janitor job interval set
to 1 min) and checked that
 - logs are uploaded to `blobstore-go/buckets/search-jobs`
 - repo jobs are deleted from `exhaustive_repo_jobs`
 - logs are served from the blobstore after the janitor ran
 - downloading logs while the job is running still works

## Changelog
The new background job drastically reduces the size of the
`exhaustive_*` tables and improves performance of the Search Jobs GQL
API.
2024-08-01 15:29:10 +02:00
Julie Tibshirani
c966d942f7
search: apply phrase boosting to more queries (#64207)
To ease the transition from older search semantics to keyword search, we
[boost matches on
phrases](https://github.com/sourcegraph/sourcegraph/pull/59940). For
example if you search for `// The vararg opts parameter can include`, we
ensure the match in the method comment is highest, even though there
were no explicit quotes in the query.

We decided to limit this boosting to searches with 3 or more terms. With
2 terms, it's possible there are a ton of phrase matches, which can
drown out high quality 'AND' matches. However, we've seen a few dogfood
examples with fewer terms where boosting would have been really useful.

This PR removes the 3 term restriction on boosting. To mitigate noise,
it updates the phrase matching to only match on word boundaries. It also
switches to matching on the original query string instead of
reconstructing the phrase from terms. That lets us match even when
there's special characters, like `return "disabled"`.

Relates to SPLF-168

## Test plan

Adapted unit tests. Lots of manual testing:
* `invalid ModelID`
* `return "disabled"`
* `func TestClient_do(`
* `// The vararg opts parameter can include functions to configure the`
* `test server` -- this still works quite well, it's a bit fragile but
restricting the matches to word boundaries helped reduce noise
* `bytes buffer`
2024-08-01 16:26:41 +03:00
Varun Gandhi
554fd33eff
chore: Factor out sub-query for locating nearest uploads (#64210)
A large sub-query was duplicated between two queries, making
the code harder to understand. This patch factors that out.

Ancillary changes:
- Added more doc comments
- Tweak tests to make failures easier to follow.
2024-08-01 21:05:03 +08:00
Filip Haftek
66be2ddcb6
sg cloud eph: simplify status (#64209)
1. Make `sg cloud eph` instance status Reason simple string, as CloudAPI
will take over and return Reason with job URL - no need to parse Reason
anymore.
```sh
go run ./dev/sg cloud eph status --name ff-eph56
⚠️ Running sg with a dev build, following flags have different default value unless explictly set: skip-auto-update, disable-analytics
 Ephemeral instance "ff-eph56" status retrieved
Ephemeral instance details:
Name                                     Expires In           Instance status                          Details
ff-eph56                                 4h37m4.79031s        unspecified                              creation task is already running: https://console.cloud.google.com/workflows/workflow/us-central1/create-instance-c31bd1a4ea84/executions?project=michael-test-03
```
2. Allow re-run create if CloudAPI returns status with Reason - it means
instance is not fully created yet, so user might re-try create -
CloudAPI will ensure more than one create is not running at the same
time.

3. Updated printers with GOTO action for each instance details:
```sh
go run ./dev/sg cloud eph list --all
⚠️ Running sg with a dev build, following flags have different default value unless explictly set: skip-auto-update, disable-analytics
☁️ Fetched 10 instances
Name                                     Expires In           Instance status                          Details
andre-eph-1                              30h10m42.989163s     unspecified                              invoke: sg cloud eph status --name andre-eph-1
ff-eph56                                 4h34m43.989154s      unspecified                              invoke: sg cloud eph status --name ff-eph56
```

## Test plan

Unit tests simplified.
E2e against old and new CloudAPI.

---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2024-08-01 14:44:03 +02:00
William Bezuidenhout
29847d1ca3
chunk cleaner: remove comment (#64212)
This comment is no longer relevant

## Test plan
CI

<!-- OPTIONAL; info at
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c
-->
2024-08-01 13:48:41 +02:00
Anton Sviridov
7aba4732ee
Policy patch - leave fields unchanged if they're missing from request (#64174)
Fixes GRAPH-782

Specifically this allows us avoid updating syntactic_indexing_enabled
when we don't have the value available.

This is done to solve the problem where not providing that field crashes
the resolver. I confirmed it by both via tests and via manual testing of
the API
![CleanShot 2024-07-31 at 15 51
54](https://github.com/user-attachments/assets/2e82ff20-5541-4a7d-9dd6-17196274d59a)

## Test plan

- Added a new test for resolvers specifically to test the extra logic
around this field
2024-08-01 12:01:26 +01:00
Christoph Hegemann
a64832ab44
refactor: renames usage cursor and adds fields for future syntactic cursor (#64208)
Landing this early to avoid accumulating conflicts

## Test plan

Shouldn't change functionality as new fields are unused for now
2024-08-01 10:36:19 +00:00
Camden Cheek
be17da7305
Svelte: add welcome introduction when enabling svelte for the first time (#64163)
This implements a welcome dialog and some additional messaging around
the beta rollout.
2024-08-01 11:06:37 +02:00
William Bezuidenhout
78064ba956
fix(release): check for marker in container files instead of binary (#64205)
Frontend assets are not embedded into the binary anymore instead they're
added to the final container image at `/assets-dist`.

In this PR we check the directory inside the image for the marker
instead of the binary

Closes DINF-176
## Test plan
Tested locally
```
sg release run test --version 1.2.3
👉 [     setup] Finding release manifest in "."
   [     setup] No explicit branch name was provided, assuming current branch is the target: main
   [     setup] Found manifest for "sourcegraph" (github.com/sourcegraph/sourcegraph)
   [      meta] Owners: @sourcegraph/release
   [      meta] Repository: github.com/sourcegraph/sourcegraph
👉 [      vars] Variables
   [      vars] tag="1.2.3"
   [      vars] config="{\"version\":\"v1.2.3\",\"inputs\":\"\",\"type\":\"patch\"}"
   [      vars] git.branch="main"
   [      vars] is_development="false"
   [      vars] version="v1.2.3"
👉 [      reqs] Checking requirements...
   [      reqs]  jq
   [      reqs] 🔕 Buidkite access token (excluded for test)
   [      reqs] 🔕 GitHub Token to submit changelogs (excluded for test)
👉 [      test] Running testing steps for v1.2.3
👉 [      step] Running step "check:frontend and server image contain bundle"
   [check:frontend and server image contain bundle] pulling frontend image us.gcr.io/sourcegraph-dev/frontend:insiders
   [check:frontend and server image contain bundle] insiders: Pulling from sourcegraph-dev/frontend
   [check:frontend and server image contain bundle] Digest: sha256:1256bfb7c64bee0f11a3d0b82af6899f1d3fe22c0d6f3875a877c5f8f8b0e963
   [check:frontend and server image contain bundle] Status: Image is up to date for us.gcr.io/sourcegraph-dev/frontend:insiders
   [check:frontend and server image contain bundle] us.gcr.io/sourcegraph-dev/frontend:insiders
   [check:frontend and server image contain bundle] checking frontend has web-bundle at /assets-dist inside the container
   [check:frontend and server image contain bundle] WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
   [check:frontend and server image contain bundle] pulling server image us.gcr.io/sourcegraph-dev/server:insiders
   [check:frontend and server image contain bundle] insiders: Pulling from sourcegraph-dev/server
   [check:frontend and server image contain bundle] Digest: sha256:592c4e94ced4990a3b461eb474d5e7fee9c408d93ba4df44220b22f7d39ea645
   [check:frontend and server image contain bundle] Status: Image is up to date for us.gcr.io/sourcegraph-dev/server:insiders
   [check:frontend and server image contain bundle] us.gcr.io/sourcegraph-dev/server:insiders
   [check:frontend and server image contain bundle] checking server has web-bundle at /assets-dist inside the container
   [check:frontend and server image contain bundle] WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
   [      step] Step "check:frontend and server image contain bundle" succeeded
```
<!-- REQUIRED; info at
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->

## Changelog
* release: check contiainer directory `/assets-dist` for marker instead
of frontend binary
<!-- OPTIONAL; info at
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c
-->
2024-08-01 08:25:30 +00:00
Bolaji Olajide
776701ba9c
fix(sg): acknowledge command execution state to avoid recursion when executing short running commands (#64181)
Some commands like the
[`batcheshelper-builder`](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/sg.config.yaml?L821)
aren't long running commands.
This command is used to build and load an image into docker. The `cmd`
section returns an `exit 0`. This behavior combined with
`continueWatchOnExit` results in an infinite loop where the process is
continually restarted because `sg` doesn't know that the process has
finished executing and isn't a long-running process.


https://github.com/user-attachments/assets/e7a027a1-6f93-403f-9240-6a791255fba9

An example of the behavior is shown below as running `sg start batches`
results in the `batcheshelper-builder` command continually restarted.

The fix is quite simple, we return an empty receiver channel when the
process is done executing so that `sg` knows it's done and doesn't
restart the command unless there's a change.

## Test plan

* Manual testing with `go run ./dev/sg start batches` doesn't result in
an infinite loop anymore.
* Add unit tests

## Changelog
2024-07-31 16:09:44 -05:00
Matthew Manela
b2e550c8e5
feat(search): Enable improved symbol parsing for large repos (when using Rockskip) (#63988)
During an investigation, we saw that Rockskip was not using scip-ctags
for symbol parsing when applicable. This means that
1. Rockskip is getting less than optimal symbols for certain languages
(like Go)
2. Rockskip is getting no symbols for languages not in universal ctags
(Magik)

This PR attempts to solve this problem but updating Rockskip to re-use
the ctags parser pool logic from symbol service.

### Key Changes
- Update parser pool to be re-usable
- Push common logic for parser type detection into the parser pool
module
- Update rockskip service config to take a parser pool 
- Update and add unit/integration tests


## Questions
- What performance impact will using this pooled parser have compared to
its previous behavior of spawning a new ctags process each time?



## Test plan
- [x] Add unit tests
- [x] Update integration tests
- [x] Manually test rockskip
- [x] Manually test symbolservice (in case of regression)

---------

Co-authored-by: Keegan Carruthers-Smith <keegan.csmith@gmail.com>
2024-07-31 15:27:31 -04:00
Camden Cheek
60d450b079
Code intel: respect provenance when getting usages (#64193)
This updates the new references panel to respect the provenance of an
occurrence.
2024-07-31 15:50:31 -03:00
Erik Seliger
eb5a0d186c
soap: Fix auto-redirect to IdP when SOAP is enabled (#64184)
When exactly 1 auth provider is configured, Sourcegraph redirects users
automatically to the IdP to speed up the sign-in process, so that users
don't have to make an extra click to select the one and only sign-in
provider.

SOAP is a special case though because it is hidden by default, but
enabled on all cloud instances. That caused this auto redirect to never
fire for Cloud, since there are technically two auth providers.

This PR fixes it by checking for the sourcegraph-operator query
parameter which tells the UI to show the magic SOAP auth provider in the
list.

Closes SRC-500

Test plan: Tested on a cloud instance that indeed there is no auto
redirect. Then tested locally with SOAP configured that auto redirects
happen after this PR, and that there is no auto redirect when the
?sourcegraph-operator query parameter is set.

## Changelog

When only a single auth provider is configured, users are again
redirected correctly to the identity provider on Sourcegraph Cloud.
2024-07-31 20:27:05 +02:00