Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit d2b0714

Browse files
authored
clarify GitHub ext svc docs, standardize on terms (#2952)
- fix #2946 by implying that no "repo" scope is needed in the example JSON and explicitly mentioning it in the JSON Schema docs (the explicit mention is omitted from the example JSON for brevity, so that the "token" property is above the fold on an average-sized screen) - use "repository" not "repo" per https://docs.sourcegraph.com/dev/style_guide
1 parent cf83046 commit d2b0714

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

schema/github.schema.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"default": "http"
2626
},
2727
"token": {
28-
"description": "A GitHub personal access token with repo and org scope.",
28+
"description": "A GitHub personal access token. Create one for GitHub.com at https://github.com/settings/tokens/new?scopes=repo&description=Sourcegraph (for GitHub Enterprise, replace github.com with your instance's hostname). The \"repo\" scope is required to mirror private repositories. If using only public repositories, you can create the token with no scopes.",
2929
"type": "string",
3030
"minLength": 1
3131
},
@@ -40,7 +40,7 @@
4040
"items": { "type": "string", "pattern": "^[\\w-]+/[\\w.-]+$" }
4141
},
4242
"exclude": {
43-
"description": "A list of repos to never mirror from this GitHub instance. Takes precedence over \"repos\" and \"repositoryQuery\" configuration.",
43+
"description": "A list of repositories to never mirror from this GitHub instance. Takes precedence over \"repos\" and \"repositoryQuery\" configuration.",
4444
"type": "array",
4545
"minItems": 1,
4646
"items": {
@@ -49,12 +49,12 @@
4949
"anyOf": [{ "required": ["name"] }, { "required": ["id"] }],
5050
"properties": {
5151
"name": {
52-
"description": "The name of a GitHub repo (\"owner/name\") to exclude from mirroring.",
52+
"description": "The name of a GitHub repository (\"owner/name\") to exclude from mirroring.",
5353
"type": "string",
5454
"pattern": "^[\\w-]+/[\\w.-]+$"
5555
},
5656
"id": {
57-
"description": "The id of a GitHub repo (as returned by the GitHub instance's API) to exclude from mirroring.",
57+
"description": "The ID of a GitHub repository (as returned by the GitHub instance's API) to exclude from mirroring.",
5858
"type": "string",
5959
"minLength": 1
6060
}
@@ -86,7 +86,7 @@
8686
"type": "object",
8787
"properties": {
8888
"ttl": {
89-
"description": "The TTL of how long to cache permissions data. This is 3 hours by default.\n\nDecreasing the TTL will increase the load on the code host API. If you have X repos on your instance, it will take ~X/100 API requests to fetch the complete list for 1 user. If you have Y users, you will incur X*Y/100 API requests per cache refresh period.\n\nIf set to zero, Sourcegraph will sync a user's entire accessible repository list on every request (NOT recommended).",
89+
"description": "The TTL of how long to cache permissions data. This is 3 hours by default.\n\nDecreasing the TTL will increase the load on the code host API. If you have X repositories on your instance, it will take ~X/100 API requests to fetch the complete list for 1 user. If you have Y users, you will incur X*Y/100 API requests per cache refresh period.\n\nIf set to zero, Sourcegraph will sync a user's entire accessible repository list on every request (NOT recommended).",
9090
"type": "string",
9191
"default": "3h"
9292
}

schema/github_stringdata.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/src/site-admin/externalServices.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,24 +136,24 @@ export const GITHUB_EXTERNAL_SERVICE: ExternalServiceKindMetadata = {
136136
defaultDisplayName: 'GitHub',
137137
defaultConfig: `{
138138
// Use Ctrl+Space for completion, and hover over JSON properties for documentation.
139-
// Configuration options are documented here:
140-
// https://docs.sourcegraph.com/admin/external_service/github#configuration
139+
// Docs: https://docs.sourcegraph.com/admin/external_service/github#configuration
141140
142-
"url": "https://github.com",
141+
"url": "https://github.com", // change to use with GitHub Enterprise
143142
144-
// A token is required for access to private repos, but is also helpful for public repos
145-
// because it grants a higher hourly rate limit to Sourcegraph.
146-
// Create one with the repo scope at https://[your-github-instance]/settings/tokens/new
143+
// Enter an access token to mirror GitHub repositories. Create one for GitHub.com at
144+
// https://github.com/settings/tokens/new?scopes=repo&description=Sourcegraph
145+
// (for GitHub Enterprise, replace github.com with your instance's hostname).
146+
// The "repo" scope is required to mirror private repositories.
147147
"token": "",
148148
149149
// An array of strings specifying which GitHub or GitHub Enterprise repositories to mirror on Sourcegraph.
150-
// See https://docs.sourcegraph.com/admin/site_config/all#githubconnection-object for more details.
150+
// See the repositoryQuery documentation at https://docs.sourcegraph.com/admin/external_service/github#configuration for details.
151151
"repositoryQuery": [
152152
"none"
153+
// "org:sourcegraph"
153154
],
154155
155-
// Sync public repositories from https://github.com by adding them to "repos".
156-
// (This is not necessary for GitHub Enterprise instances)
156+
// Sync specific repositories by name (in addition to those matched in the repositoryQuery).
157157
"repos": [
158158
// "sourcegraph/sourcegraph"
159159
]

0 commit comments

Comments
 (0)