mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:51:57 +00:00
docs: Replace src lsif with src code-intel. (#37389)
This commit is contained in:
parent
9f1b03fc78
commit
7b33210353
@ -82,7 +82,7 @@ func uploadAll(ctx context.Context, commitsByRepo map[string][]string, limiter *
|
||||
return uploads, nil
|
||||
}
|
||||
|
||||
// upload invokes `src lsif upload` on the host and returns the graphql identifier of
|
||||
// upload invokes `src code-intel upload` on the host and returns the graphql identifier of
|
||||
// the uploaded resource.
|
||||
func upload(ctx context.Context, repoName, commit, file string) (string, error) {
|
||||
argMap := map[string]string{
|
||||
|
||||
@ -207,7 +207,7 @@ steps:
|
||||
- name: Generate LSIF data
|
||||
run: lsif-go
|
||||
- name: Upload LSIF data
|
||||
run: src lsif upload -github-token=${{ "\\${{secrets.GITHUB_TOKEN}}" }}
|
||||
run: src code-intel upload -github-token=${{ "\\${{secrets.GITHUB_TOKEN}}" }}
|
||||
EOF
|
||||
```
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ jobs:
|
||||
- name: Upload index
|
||||
# this will upload to Sourcegraph.com, you may need to substitute a different command
|
||||
# by default, we ignore failures to avoid disrupting CI pipelines with non-critical errors.
|
||||
run: src lsif upload -github-token=${{ secrets.GITHUB_TOKEN }} -ignore-upload-failure
|
||||
run: src code-intel upload -github-token=${{ secrets.GITHUB_TOKEN }} -ignore-upload-failure
|
||||
```
|
||||
|
||||
### Sub-projects
|
||||
@ -66,7 +66,7 @@ jobs:
|
||||
working-directory: backend/
|
||||
# this will upload to Sourcegraph.com, you may need to substitute a different command
|
||||
# by default, we ignore failures to avoid disrupting CI pipelines with non-critical errors.
|
||||
run: src lsif upload -github-token=${{ secrets.GITHUB_TOKEN }} -ignore-upload-failure
|
||||
run: src code-intel upload -github-token=${{ secrets.GITHUB_TOKEN }} -ignore-upload-failure
|
||||
```
|
||||
|
||||
### Custom build environments
|
||||
@ -143,7 +143,7 @@ jobs:
|
||||
- run: scip-typescript index
|
||||
# this will upload to Sourcegraph.com, you may need to substitute a different command
|
||||
# by default, we ignore failures to avoid disrupting CI pipelines with non-critical errors.
|
||||
- run: src lsif upload -github-token=<<parameters.github-token>> -ignore-upload-failure
|
||||
- run: src code-intel upload -github-token=<<parameters.github-token>> -ignore-upload-failure
|
||||
|
||||
workflows:
|
||||
scip-typescript:
|
||||
|
||||
@ -101,7 +101,7 @@ local dev environment.
|
||||
1. Run `lsif-clang compile_commands.json` from the root directory. This should emit a `dump.lsif`
|
||||
file.
|
||||
|
||||
1. Run `src lsif upload` from the root directory. You may first have to [authenticate to your
|
||||
1. Run `src code-intel upload` from the root directory. You may first have to [authenticate to your
|
||||
Sourcegraph instance](https://github.com/sourcegraph/src-cli#log-into-your-sourcegraph-instance).
|
||||
|
||||
If you run into issues along the way, a useful reference is [one of the
|
||||
@ -140,7 +140,7 @@ if things don't work on the first try:
|
||||
should generate a `dump.lsif` file in the same directory. This `dump.lsif` should contain JSON
|
||||
describing all the symbols and references in the codebase (it should be rather large).
|
||||
1. Once the `dump.lsif` file is generated correctly, set the environment variables
|
||||
`SRC_ACCESS_TOKEN` and `SRC_ENDPOINT` to the appropriate values in your shell. Then run `src lsif
|
||||
`SRC_ACCESS_TOKEN` and `SRC_ENDPOINT` to the appropriate values in your shell. Then run `src code-intel
|
||||
upload` from the directory containing the `lsif.dump` file. This should successfully upload the
|
||||
LSIF dump to Sourcegraph.
|
||||
1. After you've successfully done all of the above in the container's interactive shell, incorporate
|
||||
|
||||
@ -27,7 +27,7 @@ jobs:
|
||||
- name: Upload LSIF data
|
||||
# this will upload to Sourcegraph.com, you may need to substitute a different command.
|
||||
# by default, we ignore failures to avoid disrupting CI pipelines with non-critical errors.
|
||||
run: src lsif upload -github-token=${{ secrets.GITHUB_TOKEN }} -ignore-upload-failure
|
||||
run: src code-intel upload -github-token=${{ secrets.GITHUB_TOKEN }} -ignore-upload-failure
|
||||
```
|
||||
|
||||
The following projects have example GitHub Action workflows to generate and upload LSIF indexes.
|
||||
@ -50,7 +50,7 @@ jobs:
|
||||
- run: lsif-go
|
||||
# this will upload to Sourcegraph.com, you may need to substitute a different command.
|
||||
# by default, we ignore failures to avoid disrupting CI pipelines with non-critical errors.
|
||||
- run: src lsif upload -github-token=<<parameters.github-token>> -ignore-upload-failure
|
||||
- run: src code-intel upload -github-token=<<parameters.github-token>> -ignore-upload-failure
|
||||
|
||||
workflows:
|
||||
scip-typescript:
|
||||
@ -78,7 +78,7 @@ jobs:
|
||||
script:
|
||||
- |
|
||||
docker run --rm -v $(pwd):/src -w /src sourcegraph/lsif-go:latest /bin/sh -c \
|
||||
"lsif-go; src lsif upload -github-token=$GITHUB_TOKEN -ignore-upload-failure"
|
||||
"lsif-go; src code-intel upload -github-token=$GITHUB_TOKEN -ignore-upload-failure"
|
||||
```
|
||||
|
||||
The following projects have example Travis CI configurations to generate and upload LSIF indexes.
|
||||
@ -113,7 +113,7 @@ The following projects have example Travis CI configurations to generate and upl
|
||||
# for private instances
|
||||
src -endpoint=<your sourcegraph endpoint> lsif upload
|
||||
# for public instances
|
||||
src lsif upload -github-token=<your github token>
|
||||
src code-intel upload -github-token=<your github token>
|
||||
```
|
||||
|
||||
The upload command will provide a URL you can visit to see the upload's status, and when it's done you can visit the repo and check out the difference in code navigation quality!
|
||||
|
||||
@ -30,7 +30,7 @@ jobs:
|
||||
curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src
|
||||
chmod +x /usr/local/bin/src
|
||||
- name: Upload index
|
||||
run: src lsif upload -github-token='${{ secrets.GITHUB_TOKEN }}' -no-progress
|
||||
run: src code-intel upload -github-token='${{ secrets.GITHUB_TOKEN }}' -no-progress
|
||||
env:
|
||||
SRC_ENDPOINT: https://sourcegraph.com/
|
||||
```
|
||||
@ -80,7 +80,7 @@ jobs:
|
||||
- name: Generate index
|
||||
run: scip-typescript index
|
||||
- name: Upload index
|
||||
run: src lsif upload -github-token=${{ secrets.GITHUB_TOKEN }} -no-progress
|
||||
run: src code-intel upload -github-token=${{ secrets.GITHUB_TOKEN }} -no-progress
|
||||
env:
|
||||
SRC_ENDPOINT: https://sourcegraph.com/
|
||||
```
|
||||
@ -120,9 +120,9 @@ The steps here are similar to those in the GitHub Actions example from before.
|
||||
4. Upload the data to a Sourcegraph instance.
|
||||
```
|
||||
# for private instances
|
||||
SRC_ENDPOINT=<your sourcegraph endpoint> src lsif upload
|
||||
SRC_ENDPOINT=<your sourcegraph endpoint> src code-intel upload
|
||||
# for public instances
|
||||
src lsif upload -github-token=<your github token>
|
||||
src code-intel upload -github-token=<your github token>
|
||||
```
|
||||
The upload command will provide a URL you can visit to see the upload's status.
|
||||
Once the upload finishes processing, you can visit the repo and enjoy precise code navigation!
|
||||
|
||||
@ -49,13 +49,13 @@ The upload step is the same for all languages. Make sure the current working dir
|
||||
#### To a private Sourcegraph instance (on prem)
|
||||
|
||||
```
|
||||
$ SRC_ENDPOINT=https://sourcegraph.mycompany.com src lsif upload -file=dump.lsif
|
||||
$ SRC_ENDPOINT=https://sourcegraph.mycompany.com src code-intel upload -file=dump.lsif
|
||||
```
|
||||
|
||||
#### To cloud based Sourcegraph.com
|
||||
|
||||
```
|
||||
$ src lsif upload -github-token=YourGitHubToken -file=dump.lsif
|
||||
$ src code-intel upload -github-token=YourGitHubToken -file=dump.lsif
|
||||
```
|
||||
|
||||
The `src-cli` upload command will try to infer the repository and git commit by invoking git commands on your local clone. If git is not installed, is older than version 2.7.0 or you are running on code outside of a git clone, you will need to also specify the `-repo` and `-commit` flags explicitly.
|
||||
|
||||
@ -153,7 +153,7 @@ indexer_args:
|
||||
- lsif-clang
|
||||
- compile_commands.json
|
||||
|
||||
# Ensure lsif-clang generates the file expected by src lsif upload.
|
||||
# Ensure lsif-clang generates the file expected by src code-intel upload.
|
||||
outfile: dump.lsif
|
||||
```
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ Feature | Supported?
|
||||
|
||||
There are two ways to sync JVM dependency repositories.
|
||||
|
||||
* **Indexing** (recommended): run [`scip-java`](https://sourcegraph.github.io/scip-java/) against your JVM codebase and upload the generated index to Sourcegraph using the [src-cli](https://github.com/sourcegraph/src-cli) command `src lsif upload`. This is usually setup to run in a CI pipeline. Sourcegraph automatically synchronizes JVM dependency repositories based on the dependencies that are discovered by `scip-java`.
|
||||
* **Indexing** (recommended): run [`scip-java`](https://sourcegraph.github.io/scip-java/) against your JVM codebase and upload the generated index to Sourcegraph using the [src-cli](https://github.com/sourcegraph/src-cli) command `src code-intel upload`. This is usually setup to run in a CI pipeline. Sourcegraph automatically synchronizes JVM dependency repositories based on the dependencies that are discovered by `scip-java`.
|
||||
* **Code host configuration**: manually list dependencies in the `"dependencies"` section of the JSON configuration when creating the JVM dependency code host. This method can be useful to verify that the credentials are picked up correctly without having to upload an index.
|
||||
|
||||
## Credentials
|
||||
|
||||
@ -15,7 +15,7 @@ Feature | Supported?
|
||||
|
||||
There are three ways to sync npm dependency repositories.
|
||||
|
||||
* **SCIP** (recommended): run [`scip-typescript`](https://github.com/sourcegraph/scip-typescript) on your JavaScript/TypeScript codebase and upload the generated index to Sourcegraph using the [src-cli](https://github.com/sourcegraph/src-cli) command `src lsif upload`. Sourcegraph automatically synchronizes npm dependency repositories based on the dependencies that are discovered by `scip-typescript`.
|
||||
* **SCIP** (recommended): run [`scip-typescript`](https://github.com/sourcegraph/scip-typescript) on your JavaScript/TypeScript codebase and upload the generated index to Sourcegraph using the [src-cli](https://github.com/sourcegraph/src-cli) command `src code-intel upload`. Sourcegraph automatically synchronizes npm dependency repositories based on the dependencies that are discovered by `scip-typescript`.
|
||||
* **Dependencies search**: Sourcegraph automatically synchronizes npm dependency repositories that are in `package-lock.json` or `yarn.lock` files during a [dependencies search](../code_search/how-to/dependencies_search.md).
|
||||
* **Code host configuration**: manually list dependencies in the `"dependencies"` section of the JSON configuration when creating the npm dependency code host. This method can be useful to verify that the credentials are picked up correctly without having to upload an index.
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ var errUnprocessableRequest = errors.New("unprocessable request: missing expecte
|
||||
// POST /upload
|
||||
//
|
||||
// handleEnqueue dispatches to the correct handler function based on the request's query args. Running
|
||||
// the `src lsif upload` command will cause one of two sequences of requests to occur. For uploads that
|
||||
// the `src code-intel upload` command will cause one of two sequences of requests to occur. For uploads that
|
||||
// are small enough repos (that can be uploaded in one-shot), only one request will be made:
|
||||
//
|
||||
// - POST `/upload?repositoryId,commit,root,indexerName`
|
||||
|
||||
@ -7,7 +7,7 @@ To regenerate `lsif-go@foo.sql` you will need to:
|
||||
3. `sourcegraph/lsif-go` as a repository.
|
||||
3. Start the `sg start enterprise-codeintel` server
|
||||
4. Run `lsif-go` (master revision) manually in a checkout of the `lsif-go` repository at the revision mentioned in the `lsif-go@rev.sql` filename.
|
||||
5. Use `src lsif upload` against your local server to upload the LSIF bundle.
|
||||
5. Use `src code-intel upload` against your local server to upload the LSIF bundle.
|
||||
6. Run the following to generate the SQL file:
|
||||
|
||||
```
|
||||
|
||||
Loading…
Reference in New Issue
Block a user