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

[docs] Support GitHub fine-grained access tokens with limitations#50274

Merged
pjlast merged 5 commits into
mainfrom
pjlast/github-fgat
Apr 3, 2023
Merged

[docs] Support GitHub fine-grained access tokens with limitations#50274
pjlast merged 5 commits into
mainfrom
pjlast/github-fgat

Conversation

@pjlast

@pjlast pjlast commented Apr 3, 2023

Copy link
Copy Markdown
Contributor

Add docs to explain what is supported by fine-grained access tokens.

Test plan

I verified that repository and permissions syncing does work, and that repositoryQuery and Batch Changes does not work.

| ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| [Sync private repositories](#private-repositories) | `repo` |
| [Sync repository permissions][permissions] | `repo` |
| [Repository permissions caching][permissions-caching] | `repo`, `write:org` |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm removing this line because it is not applicable to Personal Access Tokens. It only applies to OAuth tokens, as that's where this setting is used.

@sourcegraph-bot

sourcegraph-bot commented Apr 3, 2023

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 3289d1d...1277a21.

Notify File(s)
@sourcegraph/delivery doc/admin/external_service/github.md

@pjlast pjlast requested a review from a team April 3, 2023 08:29
Comment thread doc/admin/external_service/github.md Outdated
The `repositoryQuery` option `"public"` is valuable in that it allows sourcegraph to sync all public repositories, however, it does not return whether or not a repo is archived. This can result in archived repos appearing in normal search. You can see an example of what is returned by the GitHub API for a query to "public" [here](https://docs.github.com/en/rest/reference/repos#list-public-repositories).

If you would like to sync all public repositories while omitting archived repos, consider generating a GitHub token with access to only public repositories, then use `respositoryQuery` with option `affiliated` and an `exclude` argument with option `public` as seen in the example below:
If you would like to sync all public repositories while omitting archived repos, consider generating a GitHub token with access to only public repositories, then use `repositoryQuery` with option `affiliated` and an `exclude` argument with option `public` as seen in the example below:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch :)

@kopancek kopancek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, added 1 suggestion to change or to and, sounds better to me that way, since both are not supported.

@vdavid vdavid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; if you want to invest a bit more time in this, I think a short guide to answer the question "Which one shall I use, a Personal or a fine-grained access token? What are the pros and cons for each?" would help customers big time. Part of the answer is in there already, but I suggest extracting and completing it.

Comment thread doc/admin/external_service/github.md
Comment thread doc/admin/external_service/github.md
Comment thread doc/admin/external_service/github.md Outdated
@pjlast pjlast enabled auto-merge (squash) April 3, 2023 10:18
@pjlast pjlast merged commit 5da0e8d into main Apr 3, 2023
@pjlast pjlast deleted the pjlast/github-fgat branch April 3, 2023 10:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants