-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
GitHub App: open beta #12217
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
GitHub App: open beta #12217
Changes from 10 commits
2b05646
32d79cb
fbe6d2b
4a6142d
4bf8ecb
566b8de
5799157
e813e5c
45d79df
cdfc7fa
48be9be
4c9a394
5dd4ae2
12f8b5c
2079bf9
21496ce
8633b1b
d2c32ec
edf4b5d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -229,3 +229,136 @@ depending on where the project you are trying to access has permissions from. | |
.. seealso:: GitHub doc on `requesting access to your organization OAuth`_ for step-by-step instructions. | ||
|
||
.. _requesting access to your organization OAuth: https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/requesting-organization-approval-for-oauth-apps | ||
|
||
GitHub App | ||
---------- | ||
|
||
.. warning:: | ||
|
||
Our GitHub App is currently in beta, see our `blog post <https://about.readthedocs.com/blog/2025/06/welcome-to-our-beta-github-app/>`__ for more information. | ||
|
||
We are in the process of migrating our GitHub OAuth application to a `GitHub App <https://docs.github.com/en/apps/overview>`__. | ||
We have two GitHub Apps, one for each of our platforms: | ||
|
||
- `Read the Docs Community <https://github.com/apps/read-the-docs-community>`__ | ||
- `Read the Docs Business <https://github.com/apps/read-the-docs-business>`__ | ||
|
||
Features | ||
~~~~~~~~ | ||
|
||
When using GitHub, Read the Docs uses a GitHub App to interact with your repositories. | ||
This has the following benefits over using an OAuth application: | ||
|
||
- More control over which repositories Read the Docs can access. | ||
You don't need to grant access to all your repositories in order to create an account or import a single repository. | ||
- No need to create webhooks on your repositories. | ||
The GitHub App subscribes to all required events when you install it. | ||
- No need to create a deploy key on your repository (|com_brand| only). | ||
The GitHub App can clone your private repositories using a temporal token. | ||
- If the original user who connected the repository to Read the Docs loses access to the project or repository, | ||
the GitHub App will still have access to the repository. | ||
- You can revoke access to the GitHub App at any time from your GitHub settings. | ||
- Never out of sync with changes on your repository. | ||
The GitHub App subscribes to all required events and will always keep your project up to date with your repository. | ||
|
||
Creating a project from a repository | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
To create a project from a repository, | ||
you need to install the Read the Docs GitHub App and grant access to that repository. | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- `Read the Docs Community <https://github.com/apps/read-the-docs-community/installations/new/>`__ | ||
- `Read the Docs Business <https://github.com/apps/read-the-docs-business/installations/new/>`__ | ||
|
||
Once you have installed the GitHub App, click on the :guilabel:`Projects` tab, and click on :guilabel:`Add project`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels pretty clunky :/ I definitely know we're going to get support on this, and we should make sure we're including this information in the dashboard as well:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not really clear to me what we're trying to solve here, or at least what the aim is on UX. Is the user expected to have to update their GHA permissions every time they create a project from a new repository? If so, and this is going to be consistently the case, then we should probably have some better UI for GitHub App users specifically. Basically a more prominent or mandatory block than the "Can't find the repository" block at the bottom, and something explicit and closer to what Eric mentioned above. If this isn't a standard case, the button at the botton is okay but I'd replace the "Referesh your repositories" button instead of having two buttons for GHA users. Having two buttons is going to result in users clicking both repeatedly trying to figure out which one and which order helps. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The buttons solve different issues, one suggest the user to install the app into the repository they want to install, this action needs to be done from GH, the other button resyncs our DB with the repositories the use has access to. When the GH app users shouldn't need to refresh, but it could still be needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This depends on how the user grants access to repositories to the app, if they select individual projects, then it's needed, if they marked "select all", then there is no need, as GH will install the app on every repository when created. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
But not future repositories, correct? We might be somewhere in the middle then, it's going to be common enough that users will get tripped up here but not common enough to make this mandatory, visually.
I get they have different functions, but my concern is probably more that GHA users shouldn't need to refresh repositories. They definitely shouldn't have to click refresh after clicking to update our GHA permissions. But I thought refresh would be less common with GHA as we have repository create/update events through the webhook now. It's okay if we're not there yet though. Can follow up more in readthedocs/ext-theme#606 I don't think the docs will change with that PR. |
||
then search for the repository you want to import, and follow the instructions from there. | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Connect a repository to an existing project | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
To connect a repository to an existing Read the Docs project, | ||
you need to install the Read the Docs GitHub App and grant access to the repository you want to connect. | ||
|
||
- `Read the Docs Community <https://github.com/apps/read-the-docs-community/installations/new/>`__ | ||
- `Read the Docs Business <https://github.com/apps/read-the-docs-business/installations/new/>`__ | ||
|
||
Once you have installed the GitHub App, go the :guilabel:`Settings` page of the project, | ||
and select the repository you want to connect from the :guilabel:`Connected repository` dropdown. | ||
|
||
Manually migrating a project | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
We recommend using the migration page to migrate your projects from the old OAuth application to the new GitHub App. | ||
|
||
- `Read the Docs Community <https://app.readthedocs.com/accounts/migrate-to-github-app/>`__ | ||
- `Read the Docs Business <https://app.readthedocs.com/accounts/migrate-to-github-app/>`__ | ||
|
||
But in case you need to manually migrate a project, | ||
you can follow these steps: | ||
|
||
- Go to the :guilabel:`Settings` page of your Read the Docs project, | ||
and click on :guilabel:`Integrations`, and delete all the integrations that are listed there. | ||
- Go to the settings page of your GitHub repository, | ||
click on :guilabel:`Webhooks`, and delete all the webhooks with URLs that start with: | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- ``https://readthedocs.org/api/v2/webhook/<your-project-slug>`` or ``https://app.readthedocs.org/api/v2/webhook/<your-project-slug>`` for Read the Docs Community. | ||
- ``https://readthedocs.com/api/v2/webhook/<your-project-slug>`` or ``https://app.readthedocs.com/api/v2/webhook/<your-project-slug>`` for Read the Docs Business. | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- For projects using Read the Docs Business, | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
go to the settings page of your GitHub repository, | ||
click on :guilabel:`Deploy keys`, and delete the deploy with a title matching the format ``support@readthedocs.com (<your-project-slug>)``. | ||
- :ref:`Connect the project to the repository <reference/git-integration:Connect a repository to an existing project>`. | ||
|
||
Revoking access | ||
~~~~~~~~~~~~~~~ | ||
|
||
.. warning:: | ||
|
||
If you revoke access to the GitHub App with any of the methods below, | ||
all projects linked to that repository will stop working, | ||
but the projects and its documentation will still be available. | ||
If you grant access to the repository again, | ||
you will need to :ref:`manually connect your project to the repository <reference/git-integration:Connect a repository to an existing project>`. | ||
|
||
You can revoke access to the Read the Docs GitHub App at any time from your GitHub settings. | ||
|
||
- `Read the Docs Community <https://github.com/apps/read-the-docs-community/installations/new/>`__ | ||
- `Read the Docs Business <https://github.com/apps/read-the-docs-business/installations/new/>`__ | ||
|
||
There are three ways to revoke access to the Read the Docs GitHub App: | ||
|
||
Revoke access to one or more repositories: | ||
Remove the repositories from the list of repositories that the GitHub App has access to. | ||
Suspend the GitHub App: | ||
This will suspend the GitHub App and revoke access to all repositories. | ||
The installation and configuration will still be available, | ||
and you can re-enable the GitHub App at any time. | ||
Uninstall the GitHub App: | ||
This will uninstall the GitHub App and revoke access to all repositories. | ||
The installation and configuration will be removed, | ||
and you will need to re-install the GitHub App and reconfigure it to use it again. | ||
|
||
Troubleshooting | ||
~~~~~~~~~~~~~~~ | ||
|
||
**Repository not in the list to import** | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Make sure you have installed the corresponding GitHub App in your GitHub account or organization, | ||
and have granted access to the repository you want to import. | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- `Read the Docs Community <https://github.com/apps/read-the-docs-community/installations/new/>`__ | ||
- `Read the Docs Business <https://github.com/apps/read-the-docs-business/installations/new/>`__ | ||
|
||
If you still can't see the repository in the list, | ||
you may need to wait a couple of minutes and refresh the page, | ||
or click on the "Refresh your repositories" button in the import page. | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
**Repository is in the list, but can't be imported** | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Make sure you have admin access to the repository you are trying to import. | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
If you are using |org_brand|, make sure your project is public, | ||
or use |com_brand| to import private repositories. | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
If you still can't import the repository, | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
you may need to wait a couple of minutes and refresh the page, | ||
or click on the "Refresh your repositories" button in the import page. | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.