Commit Graph

8515 Commits

Author SHA1 Message Date
Robert Lin
92c44507f9
feat/dotcom: show subscription UUID in Enterprise Portal format (#63482)
The current "name" thing is not used anywhere for subscriptions - all
internal capabilities and APIs depend use the UUID, and Enterprise
Portal will use the UUID as well.

This change replaces all name/IDs with the UUID, prefixed in Enterprise
Portal format, as we prepare to launch Enterprise Portal in more places
(such as Cody Analytics: https://linear.app/sourcegraph/issue/CORE-101).
This is particularly relevant for Cody Analytics so I can document how
to find the UUID in a way that isn't "get it from the URL".

It's not super beautiful in the subscriptions list, but as we progress
on the migration to Enterprise Portal I plan to replace the ID in the
list with "Display name", which is a first-class citizen in Enterprise
Portal.

## Test plan

<img width="953" alt="image"
src="https://github.com/sourcegraph/sourcegraph/assets/23356519/30c4ae6b-e50b-485c-a2c8-e4ab6445fc01">


![image](https://github.com/sourcegraph/sourcegraph/assets/23356519/cca8e6d1-2e20-4954-8f72-7694ad1d8bfa)
2024-06-25 17:26:26 -07:00
Quinn Slack
b79cf5b03b
remove beta labels for code monitoring Slack notifs & logs (#63480)
These features have passed the steps needed to take them out of beta.
They have been feature-complete and in widespread use for more than a
year with no outstanding issues, and they work well.

-
https://linear.app/sourcegraph/project/slack-notifications-ga-code-monitoring-7dbb9fa13f62
-
https://linear.app/sourcegraph/issue/SRCH-533/remove-beta-label-from-code-monitor-logs-tab

Closes
https://linear.app/sourcegraph/issue/SRCH-533/remove-beta-label-from-code-monitor-logs-tab



## Test plan

Create a new code monitor with a Slack notif. Ensure it works e2e by
pushing a commit that matches and watching it show up in Slack
(https://sourcegraph.slack.com/archives/C68386Z5Z/p1719357942294309).


## Changelog

- Code monitoring Slack notifications, previously in beta, are now GA.
This feature lets you post matching code changes to a Slack channel.
- Code monitoring logs, previously in beta, are now GA. This feature
lets you see the status of and activity related to code monitors to
troubleshoot issues with finding results and performing configured
actions.
2024-06-25 17:11:57 -07:00
Julie Tibshirani
37b6ded5f1
Search: always respect default pattern type (#63410)
Previously, enabling then disabling the regexp toggle would always set the
patterntype to `keyword`, even when the user has set
`search.defaultPatternType: standard`. Now, toggles always revert back to the
default pattern type.

To support this, this PR adds `defaultPatternType` to the nav bar query state,
which is updated every time there's a settings update. Having
`defaultPatternType` available also lets us fix another bug: when
the default pattern type has been set to `standard` we no longer awkwardly show
`patterntype: standard` in the search bar. (This confusing behavior was
introduced recently in #63326.)

**Overall, this PR set us up to remove `experimentalFeatures.keywordSearch`,
along with the keyword search toggle.** To opt out of keyword search, users can
just set `search.defaultPatternType`, and have it work everywhere.
2024-06-25 09:43:14 -07:00
Taras Yemets
dbc8d5b68a
fix(plg): ensure invite flow is enabled only for embedded UI (#63466)
Makes the invite flow on "/cody/manage" page dependent on the
`dotcom.codyProConfig.useEmbeddedUI` site config param.

Previously we didn't have a check for this site config param on this
page (to be precise, it's predecessor, see
https://github.com/sourcegraph/sourcegraph/pull/63442).

<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->

| `useEmbeddedUI` | Plan |  Role  | Screenshot |
| -- | -- | -- | -- |
| `false` | admin | Pro |<img width="1483" alt="Screenshot 2024-06-25 at
13 02 18"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/8d5687df-43a9-4dbe-b82c-ecc60696da0f">|
| `false` | member | Pro |<img width="1483" alt="Screenshot 2024-06-25
at 13 14 17"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/cd53550c-5d51-4830-834c-1c233d13e72a">|
| `false` | n/a | Free |<img width="1483" alt="Screenshot 2024-06-25 at
13 17 15"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/f18720d4-a000-4bfb-b948-bbda29e49911">|
| `true` | admin | Pro |<img width="1483" alt="Screenshot 2024-06-25 at
13 30 03"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/618675d5-13b9-44b8-be50-4c506b46b702">|
| `true` | member | Pro |<img width="1483" alt="Screenshot 2024-06-25 at
13 25 24"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/ccac77e8-c7ca-44a5-b033-3c6dad8e5d70">|
| `true` | n/a | Free |<img width="1483" alt="Screenshot 2024-06-25 at
13 31 41"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/a7373ae9-a440-4282-805f-018d703cf3b0">|


## Test plan
- Tested manually (screenshots attached):
  - Run Sourcegraph instance in dotcom mode
- Tweak `dotcom.codyProConfig.useEmbeddedUI` site config param, log in
with users with different team roles (member/admin) and check results
with the table above.
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->




<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-25 15:33:53 +00:00
Quinn Slack
6c861d1446
add back /post-sign-up (#63456)
This is needed for the signup flow to work.


## Test plan

Manually test
2024-06-24 16:09:39 -07:00
Quinn Slack
4d69b06d4d
remove extraneous Cody onboarding steps (#63373)
- Remove the "personal or work" step
- Remove the "do you want us to call you?" step
- Cleaner design of the Cody dashboard
- Improve some wording
- Remove CodySurveyToast (unused) and user.CompletedPostSignup. These
have not been used in many months. On Amplitude, the relevant events
have no data.

Fix
https://linear.app/sourcegraph/issue/PRIME-375/remove-personal-or-work-survey-signup-step

<img width="2032" alt="image"
src="https://github.com/sourcegraph/sourcegraph/assets/1976/ef100e60-71b5-479b-ac63-2450cdad0220">


## Test plan

n/a
2024-06-24 20:37:39 +00:00
Dan Adler
5413fd1fd4
fix(analytics): fix broken v1 codeintel event logging (#63449)
Codeintel v1 telemetry/event logging was broken in
https://github.com/sourcegraph/sourcegraph/pull/62586 due to the lack of
parens around a ternary operator. This simply fixes that issue.

## Test plan

CI

## Changelog

Co-authored-by: Dan Adler <5589410+dadlerj@users.noreply.github.com>
2024-06-24 20:35:28 +00:00
Dan Adler
e8742bcf9c
Add language ID to private metadata for v2 codeintel events (for in p… (#63421)
…orduct analytics)

As part of the v1 -> v2 telemetry transition, in product analytics
("IPA") aka admin analytics pages need to all be updated as well.

The codeintel IPA page shows codeintel actions by language. We aren't
capturing this metadata for v2 events. This PR adds it to private
metadata (since this is only needed on the instance itself).


## Test plan

CI

---------

Co-authored-by: Dan Adler <5589410+dadlerj@users.noreply.github.com>
Co-authored-by: Aditya Kalia <32119652+akalia25@users.noreply.github.com>
2024-06-24 11:26:26 -07:00
Quinn Slack
c3ce26f308
remove Code Search upsell from Cody page (#63440)
The general principle here is that we want to remove non-functional
upsells in our product. They add clutter and complexity and sometimes
annoy admins and users. As we unify the products, we will be adding a
lot more functional CTAs in the product to the same effect.

## Test plan

n/a; removal only
2024-06-24 08:39:15 -07:00
Quinn Slack
673f9e87dd
remove old and unused Cody search page (#63439)
This page (at `/cody/search`) let you type in a natural-language
description of what to search for, and then it used an LLM to rewrite
that to Sourcegraph search query syntax. This was enabled using the
`cody-web-search` feature flag, which has been disabled on dotcom for a
while and was never documented or shared with customers, so it's safe to
remove.

It was a cool idea, but we decided to focus on making Cody's search in
the editor better, and we haven't seriously improved this for ~12
months.

## Test plan

n/a; removed feature
2024-06-24 08:39:02 -07:00
Quinn Slack
6f9b7c5d80
remove unused CODY_APP esbuild config and entrypoint (#63438)
Cody App was removed in Dec 2023, and the `app/main.tsx` file has not
existed for a long time.

## Test plan

n/a
2024-06-24 08:38:40 -07:00
Quinn Slack
896819f811
remove disabled web UI code for embeddings (#63432)
Repository embeddings were removed in Feb 2024 as part of the Cody
Enterprise GA. They have not been used since. Some Sourcegraph instances
still running an older pre-GA version may still rely on Cody Gateway
(deployed by us) for embeddings generation, but they do not rely on this
UI code at all, so it is safe to remove.

No changelog entry needed since this code's UI has been disabled since
Feb 2024.

## Test plan

Existing tests suffice since this is removing functionality.
2024-06-24 08:38:09 -07:00
Felix Kling
843f703958
fix(svelte): Properly rounded corner for file view hover cards (#63446)
Fixes srch-130

## Test plan

Visual inspection
2024-06-24 15:33:05 +00:00
Taras Yemets
345a06abb1
chore(plg): add useEmbeddedUI site config param (#63442)
Adds `dotcom.codyProConfig.useEmbeddedUI` site config param. 
This param defines whether the Cody Pro subscription and team management
UI should be served from the connected instance running in the dotcom
mode. The default value is `false`. This change allows us to enable the
SSC proxy on the instance without enabling the new embedded Cody Pro UI.

Previously whether the embedded Cody Pro UI is enabled was defined by
the `dotcom.codyProConfig` being set, which prevented us from enabling
the SSC proxy without enabling the embedded UI:
> Whether the SSC proxy is enabled is [defined based on
`dotcom.codyProConfig`](41fb56d619/cmd/frontend/internal/ssc/ssc_proxy.go (L227-L231))
being set in the site config. This value is also partially
[propagated](41fb56d619/cmd/frontend/internal/app/jscontext/jscontext.go (L481))
to the frontend via jscontext. And the frontend [uses this
value](41fb56d619/client/web/src/cody/util.ts (L8-L18))
to define whether to use new embedded UI or not.

For more details see [this Slack
thread](https://sourcegraph.slack.com/archives/C05PC7AKFQV/p1719010292837099?thread_ts=1719000927.962429&cid=C05PC7AKFQV).

<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


## Test plan
- CI
- Tested manually:
  - Run Sourcegraoh instance locally in dotcom mode
  - Set `dotcom.codyProConfig` in the site config
- Type `context. frontendCodyProConfig` that it returns the [correct
values from the site
config](184da4ce4a/cmd/frontend/internal/app/jscontext/jscontext.go (L711-L715))
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-24 07:49:58 -07:00
Quinn Slack
1ff74b0f27
"Cody" in navbar not "Cody AI" (#63429)
The name of the product is "Cody", not "Cody AI". Also, "AI" just looks
dumb and hype-y.


## Test plan

View the navbar and ensure it reads "Cody" not "Cody AI".

## Changelog

- In the navbar, Cody is now just "Cody" not "Cody AI".
2024-06-22 23:58:20 -06:00
Taras Yemets
dfabe647ba
Revert "fix(plg): Cody Pro routes conditions & add links to the user nav dropdown (#63378) (#63424)
This reverts commit 5cf81e0210
(https://github.com/sourcegraph/sourcegraph/pull/63378).

This PR intorduced a call to the SSC backend via proxy on the
Sourcegraph backend (see `cmd/frontend/internal/ssc/ssc_proxy.go`). It
appeared that proxy is not properly configured on dotcom, causing
requests to fail with 503 "proxy not configured" errors.
Reverting this PR until we fix the configuration.

<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


## Test plan
- CI
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-22 00:58:32 +03:00
Bolaji Olajide
e707101ebd
chore(batch-changes): remove beta badge from batch changes (#63423) 2024-06-21 21:15:59 +00:00
Felix Kling
ce7531f060
feat(svelte): Make fuzzy finder matching more reliable (#63397)
Currently the fuzzy finder filters and ranks results received from the
server locally. This was done to improve performance since local
filtering is much faster.
However it can introduce inconsistencies (as reported) because the local
filtering logic works differently that the one on the server. That means
the shown results is depedent on on the local cache, which is not
obvious to the user.

This commit removes the client side filtering and ranking and instead
relies only on the server for this. This makes things more consistent
and predictable, at the expense of being a little slower. However it
still feels quite fast to me.

Note that I didn't implement some aspects due to the limitations of the
GraphQL-based search API:
- No match highlighting. Personally I didn't miss is it so far. I don't
know if the highlighting actually provides a lot of value.
- No total result count. It seems since we are adding `count:50`, the
server cannot actually give use an approximate total count. But we
should probably still convey somehow that we are limiting results to the
top 50.

Because we don't have locally cached data anymore that can be shown
immediately I decided to increase the throttle time to prevent the
result list flickering in and out when typing with a moderate speed.

This change enables three additional features: 'search all' mode, multi
word search and regex search via `/.../` literals (just like for normal
search queries). This is consistent with our existing search query
language (currently regex literals are not syntax highlighted, but we
should consider doing that).

Fixes srch-139
Fixes srch-133
Fixes srch-134
Fixes srch-543



https://github.com/sourcegraph/sourcegraph/assets/179026/81e24345-9e06-4df6-bb4a-8a55e433bfd1


## Test plan

Manual testing.

## Changelog

- Add 'search all' tab
- Support multi-word search
- Support regular expression patterns
- Fix matching reliability
2024-06-21 22:23:48 +02:00
Jean-Hadrien Chabran
19a0c73030
fix(client): restore paths for extension bundles (#63402)
When moving to ESBuild, the filenames for extension bundles changed,
which led to broken bitbucket plugins for example.

See
[discussion](https://sourcegraph.slack.com/archives/C04MYFW01NV/p1718902092493689)


## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->

Inspected the relevant target to see the paths in their proper location.


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-21 16:12:34 +02:00
Taras Yemets
2c2ec726ef
feat(plg): remove seats from subscription (#63408)
Closes https://github.com/sourcegraph/sourcegraph/issues/63234

[Design](https://www.figma.com/design/FMSdn1oKccJRHQPgf7053o/Cody-PLG-GA?node-id=5556-13856&t=f13ek1ZSgoUdrH6z-0)

Adds a button to remove the remaining invites from a subscription. 


https://github.com/sourcegraph/sourcegraph/assets/25318659/679e19dd-0e0e-4561-8ac1-af1b6979ee73

**Known deviation from design (cc: @rrhyne)**

The “Remove User” success message and the “Remove Seats from
Subscription” alerts are positioned differently than in the design. The
“Remove User” banner, along with other user and invite list alerts, is
placed above the users list, below the page title or the invites textbox
if rendered. The “Remove Seats from Subscription” banner, along with
other invite textbox alerts, is located above the invites textbox
instead of above the page title and all the page content. These issues
will be addressed in follow-up PRs, as we need to refactor the existing
Team Members page layout.
Created an issue to address it:
- https://github.com/sourcegraph/sourcegraph/issues/63411






<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


## Test plan
- Run a Sourcegraph instance in dotcom mode
- Sign in as a team admin
- Ensure there are free seats on your team (invites remaining)
- Ensure "Remove invites from plan" button is rendered
- Check the number of invites remaining
- Click the button
- Ensure the subscription has been updated and now the max seats reduced
by the number of remaining invites
- Ensure the success banner is rendered

<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-21 02:35:58 +03:00
Bolaji Olajide
c437c21ba6
chore(batch-changes): remove visibility options from create batch changes page (#63393) 2024-06-20 17:23:21 -05:00
Taiyab Raja
9aa5cb850e
Svelte: Make the byline in the fuzzy finder items bigger (#63398)
Tiny change to increase font-size of byline on the items in the fuzzy
finder.

## Before
<img width="1304" alt="CleanShot 2024-06-20 at 18 19 30@2x"
src="https://github.com/sourcegraph/sourcegraph/assets/5337876/8af80041-d64a-4cae-b717-a807b37081e6">

## After 
<img width="1337" alt="CleanShot 2024-06-20 at 18 20 53@2x"
src="https://github.com/sourcegraph/sourcegraph/assets/5337876/53725e1e-2ebd-4b2c-be4d-ca9fa7fb00cb">


## Test plan
Manually tested locally.
2024-06-20 20:37:59 +01:00
Taras Yemets
18f42a7873
feat(plg): require confirmation before removing user or revoking admin (#63388)
Closes https://github.com/sourcegraph/sourcegraph/issues/63240

Adds a confirmation modal before revoking admin or removing user.

<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->








<img width="549" alt="Screenshot 2024-06-20 at 19 50 28"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/361bce61-b2c3-42da-8d3c-5389a7ba9bd2">
<img width="549" alt="Screenshot 2024-06-20 at 19 50 36"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/f0bbc9c7-2097-46af-a290-74551d99896e">

## Test plan

- Run Sourcegraph instance in dotcom mode
  - Sign in as Cody Pro team site admin
  - Navigate to "/cody/team/manage" page
  - Click on remove button next to the team member
    - Ensure the confirmation modal is visible
- Ensure clicking the cancel button closes the confirmation modal and
user is not removed
- Ensure clicking the confirm button removes the user and closes the
confirmation modal
  - Click on the revoke admin button next to the team admin
    - Repeat steps for the user removal

<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-20 17:00:52 +00:00
Felix Kling
b05bd5bb16
fix(svelte): Open correct file from preview panel line number (#63309)
Fixes srch-553

This commit changes the "selectline" handler to open the correct file
when the file view is embedded.


## Test plan

Manual testing. Open reference panel, click on reference to open preview
panel, click on line number in review panel.
2024-06-20 17:44:32 +02:00
Varun Gandhi
0505269d54
chore: Bump go-enry and Zoekt to handle new languages (#63281)
- Updates enry to include languages from Linguist v7.29.0 such as Mojo etc.
- Updates auto-complete filters in frontend code.
- Updates Zoekt to pick up newer version with bumped enry dep.
- Updates language extension overrides to avoid ambiguity for `.json` and `.yml`.
- Updates snapshot tests.
2024-06-20 22:19:39 +08:00
Taras Yemets
5cf81e0210
fix(plg): Cody Pro routes conditions & add links to the user nav dropdown (#63378)
Closes https://github.com/sourcegraph/sourcegraph/issues/63264

1. Adds Cody Pro section to the user nav dropdown on dotcom:
- team admins have links to "cody/subscription/manage" and
"cody/team/manage" pages
   - team members have only link only to the "cody/team/manage" page
2. Makes subscription management page only available for team admins. If
team members try to navigate this page by changing the URL, they will be
redirected to the "/cody/manage" page.
- Makes "Manage subscription" link on the "/cody/manage" available only
for the team admins (previously - any Pro user)
3. Lifts `QueryClientProvider` (wrapper around react-query
`ClientProvider` higher in the component tree so that Cody Pro API query
and mutations can be used not only on the Cody Pro routes.


[Design](https://www.figma.com/design/FMSdn1oKccJRHQPgf7053o/Cody-PLG-GA?node-id=5351-19126&t=LfNQR7vUCJhlNvyT-4)

| Role | Screenshot |
|--|--|
|Admin|<img width="1605" alt="Screenshot 2024-06-20 at 12 57 13"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/e7b995fd-4322-4f7f-86bb-c7027cacd644"><img
width="1605" alt="Screenshot 2024-06-20 at 13 10 28"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/84be111c-76e2-4b14-9b73-ebdd5f8cbb9a">|
|Member|<img width="1605" alt="Screenshot 2024-06-20 at 12 56 50"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/aefd8b3b-29fe-4957-87ee-b493eb489922"><img
width="1605" alt="Screenshot 2024-06-20 at 13 09 51"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/8209e7a0-4deb-4681-9f6b-3cfde8110842">|




<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


## Test plan
- Start Sourcegraph instance in dotcom mode
  - sign in as a Cody Pro team admin 
- ensure that "Manage subscription" and "Manage team" links are present
in the user nav dropdown
    - ensure "/cody/manage" page has "Manage subscription" link
  - sign in as a Cody Pro team member (not admin)
    - ensure "Manage team" link is present in the user nav dropdown
    - navigate to "/cody/subscription/manage/ page by changing the URL
    - ensure you've been redirected to the "/cody/manage" page
    - ensure "/cody/manage" page doesn't have "Manage subscription" link
- start Sourcegraph in the enterprise mode
  - ensure the mentioned links are not rendered
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-20 11:12:19 +00:00
David Veszelovszki
625e188512
plg(feat): Make page headers the same style (#63380)
**Note:** This PR also makes sure that we use `CodyProRoutes` everywhere
for URLs.
2024-06-20 10:50:33 +00:00
David Veszelovszki
2a02d7c88b
Improve InviteUsers interface (#63383)
Based on @taras-yemets's
[feedback](https://github.com/sourcegraph/sourcegraph/pull/63375#discussion_r1647346730)
on https://github.com/sourcegraph/sourcegraph/pull/63375

## Test plan

Just a refactor
2024-06-20 12:42:53 +02:00
David Veszelovszki
03179a757e
feat(plg): Tweak invite co-workers flow (#63374) 2024-06-20 10:28:36 +00:00
David Veszelovszki
345f6b94a0
feat(plg): Invite users on Cody Dashboard (#63375) 2024-06-20 12:15:00 +02:00
Felix Kling
3b7919501a
chore(svelte): Update fuzzy finder designs (#63354)
Closes srch-458

This implements the new fuzzy finder design, specifically:

- Backdrop and dropshadow
- Border radius
- Tab header (affects all tab headers)
- Options

Note 1: Some aspects of the options UI (such as how paths are rendered
and highlighted), and the "footer" depend on how the highlighted parts
are computed. This will change when the local matching and ranking logic
is removed and will be updated when that happens.

Note 2: The symbol icon coloring was broken by #63288 and will be fixed
in a separate PR.

## Test plan

Manual testing
2024-06-20 08:28:29 +00:00
Julie Tibshirani
5630eef9e9
Search: surface pattern type in query input (#63326)
We plan to remove the 'Keyword Search' toggle as part of bringing the feature
to GA. Once the toggle is removed, the search UX will only represent `keyword`
(the default pattern type) and `regexp` (through the regex toggle), with no
visual indication for other pattern types. So if a user clicks on a link using
`patterntype:standard`, the search will just behave differently, without any
indication in the UX as to why.

This PR surfaces the `patterntype` filter in the search bar whenever it's not
`keyword` or `regexp`. That way, users can see an old pattern type is being
used and understand why the search behavior may be different.

Relates to SPLF-68
2024-06-19 14:24:10 -07:00
Felix Kling
15ea951e0d
chore(svelte): Simplify development for dotcom (#63341)
Whether or not the app is in "dotcom mode" is determined by
`window.context.sourcegraphDotComMode`. In development we use a stub
`window.context` object defined in `app.html`.

This commit extends that object to set `sourcegraphDotComMode` depending
on an environment varible. The environment variable is set by using vite
modes (https://vitejs.dev/guide/env-and-mode.html).

The whole setup can be started with `pnpm dev:dotcom`.


## Test plan

Ran `pnpm dev:dotcom` and saw the dotcom specific header and footer.
2024-06-19 22:55:01 +02:00
Camden Cheek
4087e1a844
Svelte: repo header followups (#63319)
Two followups from implementing the repo menu:
1) Remove the rounded corners from the trigger button to match the rest
of the header
2) Add an external link icon to the code host link
2024-06-19 14:02:55 -06:00
Rob Rhyne
d4948d25f6
Cody pro icon was squashed in the upgrade banner (#63356) 2024-06-19 19:29:38 +00:00
Felix Kling
2bdcc36ef7
fix(svelte): Use correct symbol icon color (#63355)
Fixes srch-601

## Test plan

Visual inspection
2024-06-19 19:26:41 +00:00
David Veszelovszki
1a038db04d
feat(plg): Update Cody Pro badge deck (#63352) 2024-06-19 20:47:12 +02:00
Peter Guy
5ee5e8817b
fix(search): VSCode Search extension: remove auth provider (#63262)
VSCode extensions can use authentication providers to enable
authentication actions from the Accounts menu, and to allow for
federated authentication. The Sourcegraph Search extension needs neither
of those - it can meet all of its authentication needs with the existing
actions in is side panel.

On top of that, the authentication provider isn't implemented quite
correctly, which leads to issues like #43608.

This PR removes the authentication provider.

It retains all of the expected behavior of the extension: the user can
still authenticate against sourcegraph.com or private instances using an
access token, and log out.

## Test plan

### First
Build and run locally.
```
git switch peterguy/vscode-remove-auth-provider
cd client/vscode
pnpm run build
```
### Then
- Launch extension in VSCode: open the `Run and Debug` sidebar view in
VS Code, then select `Launch VS Code Extension` from the dropdown menu.
- Note that the Accounts icon does not display a "1" badge and "Sign in
with SOURCEGRAPH_AUTH" is not present in the menu.
- Click on `Have an account?` to open the login dialog.
- Enter an access token and the URL of the Sourcegraph instance to which
you would like to connect.
- Click `Authenticate account`.
- Check the Accounts icon and menu - should not be anything there that's
a result of Sourcegraph Search.
- In the Help and Feedback section, click your username to open the
logout panel, then log out.
- Note again, the lack of modifications to the Accounts icon and menu
from the Sourcegraph Search extension.

## Changelog

- Remove interaction between the Sourcegraph Search extension and the
Accounts menu.
2024-06-19 11:23:10 -07:00
Jean-Hadrien Chabran
c521d988ac
chore(ci): mark web-sveltekit:e2e_test as flaky (#63351)
Marks the `web-sveltekit:e2e_test` as flaky (tries them up to three
times). It just failed main on this build
db7a268c34

## Test plan

ci

<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-19 17:44:09 +00:00
David Veszelovszki
76a1c65d8b
feat(plg): Use react-query for team management (#63267) 2024-06-19 19:05:14 +02:00
Camden Cheek
db7a268c34
Chore: remove search console (#63322)
The search console page is broken, is not used or maintained, and is
only referenced by a series of blog posts years ago. We have product
support to remove it.
2024-06-19 11:05:03 -06:00
David Veszelovszki
611dcfa806
feat(plg): Add seats (#63227) 2024-06-19 19:04:00 +02:00
Felix Kling
8b5eec2301
fix(svelte): Data/code preloading doesn't work when using panels (#63339)
Fixes srch-507

The panels code prevents event propagation of mouse move events, which
in turn seems to prevent SvelteKit from its own preloading logic.

Looking at the event handlers it seems they are global only (per
document), so I don't think that stopping the propagation is necessary
for the panel itself to work. However, I think it makes sense to stop
any of default event behavior when the mouse is currently pressed, since
that means the user is currently dragging a resize handler. Would love
to get @vovakulikov's confirmation that my understanding is correct.

## Test plan

Manual testing. Changing the size of a panel (e.g. repo page) seems to
work as expected. Hovering over a file tree entry preloads data and code
now, as visible in the network tab.
2024-06-19 16:33:42 +00:00
Felix Kling
29e07b7f6a
fix(svelte): Properly scope global CSS selector (#63332)
The tags page contains a `:global` selector at the root level, which
affects all elements that match the selector, even those not part of the
page.
`:global` selectors always need to be scoped one way or the other.

## Test plan

Code inspection, trivial change.
2024-06-19 17:38:21 +02:00
Taras Yemets
e617ca4c76
chore(plg): migrate invoices list to react-query (#63343) 2024-06-19 17:49:08 +03:00
Felix Kling
ec3b6b14a9
chore(svelte): Remove stub logger (#63342)
We've recently added v2 telemetry support and should not use the stub
logger anymore.

## Test plan

Code inspection.
2024-06-19 13:54:31 +00:00
Felix Kling
399525b716
fix(svelte): History suggestions should show immediately when clicking the history button (#63335)
Fixes srch-545

We are hiding suggestions until the user has interacted with the input
(e.g. by clicking or typing), but, as it is not, it does not include
clicking on the history button.

This commit changes that.


## Test plan

Manual testing. Clicking the history button without having interacted
with the search input in any other way will now show history suggestions
and focus in the input.
2024-06-19 11:54:46 +00:00
David Veszelovszki
0e3a85f80e
feat(plg): Apply designs to Cody Pro pages (#63244) 2024-06-19 10:58:46 +02:00
Camden Cheek
f9cae73b3f
Minor: update license wording (#63318)
In response to some customer feedback that multiple users thought this
meant their user's license was expiring, this updates the wording to
clarify that it's the sourcegraph instance license that's expiring.
2024-06-18 14:25:49 -06:00
Felix Kling
29aaa71449
fix(svelte): Fix reference panel loading/error state (#63316)
Contributes to srch-578

Currently we keep showing the loading indicator even if no references
have been found. This commit moves the info messages into the layout
because the layout has information we need to properly distinguish the
different states.

I think more refactoring is necessary to make this API better but that
will be done as part of adding search-based code intel support.


## Test plan

Manual testing.
2024-06-18 17:55:37 +02:00