We have a number of docs links in the product that point to the old doc site.
Method:
- Search the repo for `docs.sourcegraph.com`
- Exclude the `doc/` dir, all test fixtures, and `CHANGELOG.md`
- For each, replace `docs.sourcegraph.com` with `sourcegraph.com/docs`
- Navigate to the resulting URL ensuring it's not a dead link, updating the URL if necessary
Many of the URLs updated are just comments, but since I'm doing a manual audit of each URL anyways, I felt it was worth it to update these while I was at it.
See https://github.com/typescript-eslint/typescript-eslint/pull/6754.
Also removes needless `.eslintrc.js` files (now that we can use the root `tsconfig.all.json` for linting and it's still fast enough).
Some of our eslint rules were unintentionally made ineffective in `client/web`, and this commit also re-enables them and in some cases suppresses the eslint warning where a fix is not urgent.
Our tracking of frontend (TypeScript) code coverage has decayed and was no longer being used. The Codecov report at https://app.codecov.io/gh/sourcegraph/sourcegraph significantly under-counts coverage, and what coverage tasks we did have were flaky in CI and relied on old libraries that have not been updated recently to keep with modern practices (such as `@storybook/addon-storyshots` only supporting Jest with `injectGlobals`).
From https://sourcegraph.slack.com/archives/C04MYFW01NV/p1698059032863009?thread_ts=1698054092.709309&cid=C04MYFW01NV, the proposal is to remove coverage tracking for now and prioritize getting tests to run really fast and smooth locally first, including upgrading our testing infra, and then reenable code coverage tracking.
- Revert "revert "bazel: improve ESLint rule" (#52853)"
- bazel: fix eslint custom rule so js_binary runfiles are included as
tool inputs to ctx.actions.run_shell
## Test plan
Tested locally that fix commit resolves the
```
FATAL: aspect_rules_js[js_test]: RUNFILES environment variable is not set
```
flaky issue that prompted the revert
- Custom ESLint Bazel rule now relies on `sh_test`. The build part of
the rule produces the output file with ESLint errors, and the `sh_test`
target verifies that it's empty. If it's not empty, the ESLint test
fails, and the report content is printed to stdout.
- Added additional ESLint targets to `*.js` files in the root of each
client package.
- Added additional ESLint targets for `*.story.tsx` files for client
packages with stories. It's temporary until we start building Storybook
story modules with `ts_project`.
- Disabled ESLint outside of Bazel: **10-12m job is gone!** 🎉
## Test plan
bazel test `bazel query 'attr("name", ".*_eslint$", //client/...)'`
- Upgraded `aspect_bazel_lib`, `aspect_rules_js` and `aspect_rules_ts`
to the latest versions.
- Ran [bazel run
//.aspect/bazelrc:update_aspect_bazelrc_presets](40a7422385)
- Added `eslint_config` macro for client package eslint configuration
`js_library` targets.
- Implemented the custom ESLint rule, which copies `srcs` with
dependencies and **declarations** to the Bazel to lint them. This way,
we maintain the ability to do type-aware linting in Bazel.
- Added a custom ESLint formatter used in Bazel to print out relative
paths in ESLint reports.
In the follow-up PR, I will look into improvements suggested by
@alexeagle that should allow us to convert ESLint build targets into
test targets and gracefully manage linting failures.
## Test plan
1. CI
2. `bazel build $(bazel query 'kind("_eslint_test_with_types",
//client/...)')`
This PR removes old views extension logic that was used primary for the
first prototype version of code insights and it's no longer used
anywhere in our application at the moment.
## Test plan
- Make sure that CI is green and there is no regression in still used
extension logic
- Remove support for toggling native tooltips from the browser
extension. This let users choose to keep the browser extension installed
and partially active on GitHub but not show Sourcegraph's hovers. This
functionality is less important now that GitHub's new code nav no longer
uses hovers. For old GitHub Enterprise server instances (and GitHub.com
users who have not enabled the new code view), users can disable the
browser extension if they want to disable Sourcegraph's hover
functionality.
- Remove hover alerts, which were used to warn users that the results
are imprecise. We still show this in a hover badge, which is a much
nicer UI for this than a dismissible warning (which felt more "CYA").
- Remove command palette because it was inextricable from notifications
and it was only used by the Sourcegraph extension API (which is
deprecated and will be removed).
- Remove the old notifications UI, which showed notification messages in
Sourcegraph and code host UIs. This is no longer necessary with the
removal of the command palette, because it is no longer possible to
invoke long-running actions whose errors must be shown in a separate,
global UI.
## Test plan
Existing tests suffice to test the existing code intelligence
functionality. This PR just removes functionality.
There was an undocumented `go.imports:` search operator that did a hacky
attempt to find Go files that imported a given package. This was never
documented and was the only known use of the query transformer API in
the deprecated Sourcegraph extension API. This removal is part of the
removal of the deprecated Sourcegraph extension API. The upcoming
support for packages in Sourcegraph will be a better way to support this
in the future.
## Test plan
The existing search integration tests are sufficient to ensure that this
does not break searches in general.
Webpack bundles compile but need further testing. Jest + mocha tests
compile but are marked as `manual` until further work is done to get them
passing. The four jest tests are green and enabled now, though.
## Test plan
`bazel build //client/...` and `bazel test //client/...`
Bazel's rules_js rely on the pnpm package manager. To simplify the integration, we're migrating to pnpm from our current package manager — yarn. Another reason to migrate is that pnpm is cool and fast. 😉
This is part of the deprecation and removal of the extension API. This change will only affect instances using `enableLegacyExtensions` that upgrade to version 4.4 on Jan 20 or later.
These features have been deprecated for more than 1 year and were always experimental. They rely on the (also) deprecated extension API, which is slated for removal soon. This commit is one step on the way to that removal.
Removes the extension registry UI and the GraphQL API that is necessary for the registry extension UI.
Any extensions that already exist locally or remotely can still be used with the enableLegacyExtensions site config flag and by enabling the extensions in your user settings.
This change is an intermediate step toward removing the extension registry (except the endpoint that's needed to support pre-4.0 Sourcegraph instances).
I think this PR has a 99% chance of going into the 4.4 release (2023-01-20) and not needing to be reverted. Subsequent PRs that actually make it impossible to use local or custom legacy extensions are still pending customer communication and confirmation. I hope we can merge other future PRs there as well, but there is a greater chance we'd need to revert them before 4.4. By making this PR first, it means less of a revert and more progress regardless of what we learn from customers.
This was not used in any important way by any legacy extensions and is not used by the new code intel support. Removing this is part of our removal of the legacy extension API.
Spotted a place linking to the master branch. Ended up updating all
references I could find with a simple regex:
ruplacer --go '(sourcegraph/sourcegraph/[^/]+)/master/' '$1/main/'
Test Plan: CI
* Update TS version to 4.7.2
* Update gql types and revert handling error type problems
* Update ts-loader
* Use T|null instead of Partial<T>| undefined for the GQL response data
Follow up to #29629 to allow extensions to also use the user-configured
`codeIntelligence.maxPanelResults` setting to tell the Sourcegraph how
many results are shown in provided panel.
* Extend sourcegraph.d.ts API types
* Use link URLs map inline chart components
* Update insight chart data generators based on the new API of LineChart
* Support backward compatibility with linkURLs list interface
* Add chart data preparation step for the line chart axis
* Add comments to process data methods
* Update CHANGELOG.md
* Add inactive Percy class to the root element of the line chart
* Improve docs based on hallway test
* Scaffold the contexts API page
* Update heading level
* Add search contexts API docs examples. Remove experimental from search contexts docs and fix links.
* Fix links
* Add link to API doc
Co-authored-by: Rok <rok@sourcegraph.com>
Add sourcegraph.app.log to the extension API. Logs are automatically prefixed with the extension's ID.
Co-authored-by: Felix Becker <felix.b@outlook.com>