Skip to content

Commit ab2b123

Browse files
docs: Document displayName in declarative code host config (#2078)
Documents the optional `displayName` field for code host connections in declarative config (`EXTSVC_CONFIG_FILE` / `EXTSVC_CONFIG`). Docs for sourcegraph/sourcegraph#16774 ([SVC-2377](https://linear.app/sourcegraph/issue/SVC-2377/add-display-name-field-to-code-host-declarative-config)). Co-authored-by: Amp <amp@ampcode.com>
1 parent dbe5d89 commit ab2b123

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎docs/self-hosted/advanced-config-file.mdx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Where `extsvc.json` contains a JSON object that specifies _all_ of your code hos
6262
"GITHUB": [
6363
{
6464
// First GitHub code host configuration: literally the JSON object from the code host config editor.
65+
"displayName": "GitHub.com",
6566
"authorization": {},
6667
"url": "https://github.com",
6768
"token": "...",
@@ -90,6 +91,10 @@ Where `extsvc.json` contains a JSON object that specifies _all_ of your code hos
9091

9192
If you want to _allow_ edits to be made through the web UI (which will be overwritten with what is in the file on a subsequent restart), you may additionally set `EXTSVC_CONFIG_ALLOW_EDITS=true`. **Note** that if you do enable this, it is your responsibility to ensure the configuration on your instance and in the file remain in sync.
9293

94+
### Display names
95+
96+
Each connection can set an optional `displayName`, the name shown in the UI. If omitted, the name is `<KIND> #<position>`, e.g. `GITHUB #2`. Display names must be non-empty and unique within a kind. `displayName` is only available in declarative config.
97+
9398
### Configuring GitHub Apps declaratively
9499

95100
GitHub Apps can be fully configured via the `EXTSVC_CONFIG_FILE`, eliminating the need to manually add apps through the UI after redeploying an instance.
@@ -299,7 +304,7 @@ As Sourcegraph reads from an `extsvc.json` file it reads from the top level sche
299304
}
300305
```
301306

302-
You can avoid generation of a new config by changing the display name of your UI based config to match the relative display name which will be generated by the new `extsvc.json` file. For Sourcegraph to view a codehost config as already present its `display_name`, `kind`, and `config` **must not** change. You can take a look at these values in the database by running the following SQL query:
307+
You can avoid generation of a new config by changing the display name of your UI based config to match the relative display name which will be generated by the new `extsvc.json` file, or by setting `displayName` in `extsvc.json` to the current display name of your UI based config. For Sourcegraph to view a codehost config as already present its `kind` and either its `display_name` or its `config` **must not** change. You can take a look at these values in the database by running the following SQL query:
303308

304309
`sg=# select id, display_name, kind, config from external_services order by id;`
305310

0 commit comments

Comments
 (0)