Skip to content

GitHub App: add docs #12114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

GitHub App: add docs #12114

wants to merge 4 commits into from

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Apr 15, 2025

Extracted from #11942

Closes #12129


📚 Documentation previews 📚

stsewd added a commit that referenced this pull request May 14, 2025
First I wanted to pass the env var just in the clone step, but we don't
allow passing additional env vars once the environment is created, so
it's available in the whole "clone" environment. The access token we
create is read-only, and should be scoped to just one project as well
(waiting on PyGithub/PyGithub#3287).

Once the clone is done, the token is stored in the .git/config file, so
that token isn't always kept secret from the rest of the build like ssh
keys, but since the token is read-only and scoped to the current
project, and temporary (1 hour). It should be fine. Additionally, the
token is only created for private repos, meaning that only people with
explicit access to the repo may be able to extract the token, but again,
since they already have access to the repo, there is no additional
permissions the token is granting to the user (will document this in
#12114).
@stsewd stsewd marked this pull request as ready for review May 15, 2025 19:49
@stsewd stsewd requested a review from a team as a code owner May 15, 2025 19:49
@stsewd stsewd requested a review from ericholscher May 15, 2025 19:50
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

Looks good with some suggestions.

Comment on lines +11 to +16
Read the Docs uses SSH keys (with read only permissions) for GitLab and Bitbucket in order to clone private repositories,
this key is added to your main repository, but not to your submodules.
For GitHub we make use of a temporary token generated using our :ref:`GitHub App <reference/git-integration:GitHub App>`.

When a project is created, a SSH key is automatically generated.
You can use this SSH key to give Read the Docs access to clone your private submodules.
Copy link
Member

Choose a reason for hiding this comment

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

I would finish taking about SSH keys and submodules first and then explain the GitHub case.

Suggested change
Read the Docs uses SSH keys (with read only permissions) for GitLab and Bitbucket in order to clone private repositories,
this key is added to your main repository, but not to your submodules.
For GitHub we make use of a temporary token generated using our :ref:`GitHub App <reference/git-integration:GitHub App>`.
When a project is created, a SSH key is automatically generated.
You can use this SSH key to give Read the Docs access to clone your private submodules.
When adding a private GitLab and/or a Bitbucket project,
Read the Docs will generate a SSH key (with read only permissions) and add it to the repository to be able to clone. This SSH key is not added to the submodules of the repository.
In case you need to clone the private submodules, you can add this SSH key on those repositories as well.
When adding a GitHub project, Read the Docs make use of a temporary token generated using our :ref:`GitHub App <reference/git-integration:GitHub App>` instead of SSH keys.

Comment on lines -209 to -210
In case of GitHub,
check that you have granted access to the Read the Docs `OAuth App`_ to your organization.
Copy link
Member

Choose a reason for hiding this comment

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

Don't we still need to mention this but pointing to our GitHub Application instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

There are no webhook creation related errors when using the github app.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I don't refer to webhooks but to the authorization of our GitHub App. The user still have to grant access to it, right?

I'm taking about this https://github.com/settings/connections/applications/Iv23liE6t9Wm8swttujH

Copy link
Member Author

Choose a reason for hiding this comment

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

That authorization is done when you log in. But isn't needed as long as the app is installed in the repo. But again, users are never presented with this error when using a GH app.


.. figure:: /_static/images/tutorial/rtd-import-projects.gif
Copy link
Member

Choose a reason for hiding this comment

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

Just to note that we are deleting an image here. I know that @agjohnson wanted to re-new/re-take them using the new dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitHub App: write docs
2 participants