Skip to content

Commit 34512f6

Browse files
authored
Update import private repository UI shots and directions (#12255)
There is a bit more rewriting here than I'd hoped, but figured I'd update this page once. This also updates the "importing" to "create project" nomenclature. I added shot-scraper for automation of screenshots. This is not super repeatable just yet, but it at least outputs some screenshots in an automated way. I don't feel we should spend time making this repeatable or clean just yet. We could also just end up deleting the scripting part of this and leave the screenshots. But I'll probably end up generating more screenshots with this method for now to see if it's possible to build up this pattern. - [ ] This does require a redirect to be added afterwards, for the previous URL <!-- readthedocs-preview docs start --> --- :books: Documentation previews :books: - User's documentation (`docs`): https://docs--12255.org.readthedocs.build/12255/ <!-- readthedocs-preview docs end --> <!-- readthedocs-preview dev start --> - Developer's documentation (`dev`): https://dev--12255.org.readthedocs.build/12255/ <!-- readthedocs-preview dev end -->
1 parent 616482a commit 34512f6

13 files changed

+249
-148
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ tags
6060
.pytest_cache/
6161
scripts/travis/elasticsearch*
6262

63+
# Secrets
64+
/docs/user/img/screenshots/auth*.json
65+
6366
# Environments
6467
.env
6568
.venv

docs/user/guides/access/index.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ How-to guides: security and access
1414
When using an :doc:`organization </commercial/organizations>` on |com_brand|,
1515
it's possible to create different teams with custom access levels.
1616

17-
⏩️ :doc:`Manually importing private repositories </guides/importing-private-repositories>`
18-
You can grant access to private Git repositories using |com_brand| using a custom process if required.
19-
Here is how you set it up.
17+
⏩️ :doc:`/guides/creating-project-private-repository`
18+
How to create and configure a project using a private repository on |com_brand|.
2019

2120
⏩️ :doc:`Using private Git submodules </guides/private-submodules>`
2221
If you are using private Git repositories and they also contain private Git submodules,
@@ -38,7 +37,7 @@ How-to guides: security and access
3837
Single sign-on (SSO) with Google Workspace </guides/setup-single-sign-on-google-email>
3938
Single sign-on (SSO) with SAML </guides/set-up-single-sign-on-saml>
4039
Managing Read the Docs teams </guides/manage-read-the-docs-teams>
41-
Manually importing private repositories </guides/importing-private-repositories>
40+
/guides/creating-project-private-repository
4241
Using private Git submodules </guides/private-submodules>
4342
Installing private python packages </guides/private-python-packages>
4443
Manage maintainers </guides/managing-maintainers>
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
Creating a project from a private repository
2+
============================================
3+
4+
.. include:: /shared/admonition-rtd-business.rst
5+
6+
On |com_brand|, projects can be connected to both private and public repositories.
7+
There are two methods you can use to create a project from a private repository:
8+
9+
`Automatically create a project from a connected repository`_
10+
If you have a |git_providers_or| service connected to your account,
11+
projects can be created automatically from a connected private repository.
12+
We will handle the configuration of your repository to allow cloning
13+
and pushing status updates to trigger new builds for your project.
14+
15+
We recommend this method for most projects.
16+
17+
`Manually create a project from a repository`_
18+
If your Git provider is unsupported or if your Read the Docs account is not connected to your provider,
19+
you can still manually create a project against a private repository.
20+
You will have to manually configure your Git provider and repository after project creation.
21+
22+
Automatically create a project from a connected repository
23+
----------------------------------------------------------
24+
25+
.. Putting this section up front to provide a clear focus on automatic project
26+
connection before pointing users at manual connection
27+
28+
If your Read the Docs account has a connected |git_providers_or| account,
29+
you should be able to automatically create a project from your repository.
30+
Your account will need sufficient permissions to the repository to automatically configure it.
31+
32+
We recommend most users follow our :doc:`directions on automatically creating projects </intro/add-project>` from a connected repository.
33+
34+
Manually create a project from a repository
35+
-------------------------------------------
36+
37+
In the case that automatic project creation isn't supported or doesn't work for your repository,
38+
projects may be able to be manually created and configured.
39+
You can still clone the repository with SSH but you will have to manually
40+
configure the repository SSH keys and webhooks.
41+
42+
.. seealso::
43+
44+
:doc:`/guides/setup/git-repo-manual`
45+
An overview of all of the steps required to manually add a project.
46+
This guide is useful for both projects using public and private repositories.
47+
48+
Creating a project manually
49+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
50+
51+
.. figure:: /img/screenshots/business-project-manual-team-select.png
52+
:scale: 40%
53+
:align: right
54+
:alt: Select an organization team to create the project in.
55+
56+
#. Select :guilabel:`Add project` from the the main dashboard.
57+
#. Select :guilabel:`Configure manually` and then :guilabel:`Continue`.
58+
#. Select the organization team you'd like to create the project for.
59+
You must be on a team with ``admin`` permission to do this.
60+
61+
In the next form page you will manually configure your project's repository details.
62+
63+
.. figure:: /img/screenshots/business-project-manual-form.png
64+
:scale: 40%
65+
:align: right
66+
:alt: Specify your project and repository configuration.
67+
68+
4. In the :guilabel:`Repository URL` field, provide the repository's SSH or Git URL.
69+
This URL usually starts with ``git@...``, for example ``[email protected]:readthedocs/readthedocs.org.git``.
70+
#. In the :guilabel:`Default branch` field, provide the name of the default remote branch.
71+
This is usually ``main`` or ``master``.
72+
#. The project's first build should fail to clone your repository.
73+
This is expected, your repository is not configured to allow access yet.
74+
75+
Configuring your repository
76+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
77+
78+
Each project is configured with an SSH key pair consisting of a public and private key.
79+
Your repository will need to be configured with the public SSH key
80+
in order to allow builds to clone your repository.
81+
82+
.. figure:: /img/screenshots/business-project-ssh-key.png
83+
:scale: 40%
84+
:align: right
85+
:alt: Project SSH key details.
86+
87+
#. Go to the :menuselection:`Settings --> SSH keys` page for your project.
88+
#. Click on the fingerprint of the SSH key.
89+
#. Copy the text from the :guilabel:`Public SSH key` field
90+
#. Next, configure your repository with this key,
91+
we've provided instructions for common Git providers:
92+
93+
.. tabs::
94+
95+
.. tab:: GitHub
96+
97+
For GitHub, you can use
98+
`deploy keys with read only access <https://docs.github.com/en/developers/overview/managing-deploy-keys#deploy-keys>`__.
99+
100+
#. Go to your project on GitHub
101+
#. Click on :guilabel:`Settings`
102+
#. Click on :guilabel:`Deploy Keys`
103+
#. Click on :guilabel:`Add deploy key`
104+
#. Put a descriptive title and paste the public key you copied above.
105+
#. Click on :guilabel:`Add key`
106+
107+
.. tab:: GitLab
108+
109+
For GitLab, you can use `deploy keys with read only access <https://docs.gitlab.com/ee/user/project/deploy_keys/index.html>`__.
110+
111+
#. Go to your project on GitLab
112+
#. Click on :guilabel:`Settings`
113+
#. Click on :guilabel:`Repository`
114+
#. Expand the :guilabel:`Deploy Keys` section
115+
#. Put a descriptive title and paste the public key you copied above.
116+
#. Click on :guilabel:`Add key`
117+
118+
.. tab:: Bitbucket
119+
120+
For Bitbucket, you can use `access keys with read only access <https://confluence.atlassian.com/bitbucket/access-keys-294486051.html>`__.
121+
122+
#. Go your project on Bitbucket
123+
#. Click on :guilabel:`Repository Settings`
124+
#. Click on :guilabel:`Access keys`
125+
#. Click on :guilabel:`Add key`
126+
#. Put a descriptive label and paste the public key you copied above.
127+
#. Click on :guilabel:`Add SSH key`
128+
129+
.. tab:: Azure DevOps
130+
131+
For Azure DevOps, you can use `SSH key authentication <https://docs.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate?view=azure-devops>`__.
132+
133+
#. Go your Azure DevOps page
134+
#. Click on :guilabel:`User settings`
135+
#. Click on :guilabel:`SSH public keys`
136+
#. Click on :guilabel:`New key`
137+
#. Put a descriptive name and paste the public key you copied above.
138+
#. Click on :guilabel:`Add`
139+
140+
.. tab:: Others
141+
142+
If you are using a provider not listed here,
143+
you should still be able to configure your repository with your project's SSH key.
144+
Refer to your provider's documentation for managing SSH keys on private repositories.
145+
146+
Configuring repository webhooks
147+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
148+
149+
Your repository will also need to be configured to push updates via webhooks to Read the Docs on repository events.
150+
Webhook updates are used to to automatically trigger new builds for your project and syncronize your repository's branches and tags.
151+
152+
This step is the same for public repositories,
153+
follow the directions for :doc:`manually configuring a Git repository integration </guides/setup/git-repo-manual>`.

docs/user/guides/importing-private-repositories.rst

Lines changed: 0 additions & 141 deletions
This file was deleted.

docs/user/guides/private-submodules.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ to give read access to several repositories using only one SSH key.
5353
#. Click on :guilabel:`SSH and GPG keys`
5454
#. Click on :guilabel:`New SSH key`
5555
#. Put a descriptive title and paste the
56-
:ref:`public SSH key from your Read the Docs project <guides/importing-private-repositories:copy your project's public key>`
56+
:ref:`public SSH key from your Read the Docs project <guides/creating-project-private-repository:Configuring your repository>`
5757
#. Click on :guilabel:`Add SSH key`
5858

5959
Azure DevOps
@@ -65,7 +65,7 @@ Read the Docs can clone all the repositories with the same key.
6565

6666
.. seealso::
6767

68-
:ref:`Allow access to your Azure DevOps repository with an SSH key <guides/importing-private-repositories:Add the public key to your project>`.
68+
:ref:`Allow access to your Azure DevOps repository with an SSH key <guides/creating-project-private-repository:Configuring your repository>`.
6969

7070
Others
7171
------
@@ -76,4 +76,4 @@ you only need to add it to each submodule repository.
7676

7777
.. seealso::
7878

79-
:doc:`/guides/importing-private-repositories`
79+
:doc:`/guides/creating-project-private-repository`
-29.9 KB
Binary file not shown.
-41.2 KB
Binary file not shown.

docs/user/img/screenshots/Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
SHOTSCRAPER=uvx --from shot-scraper shot-scraper
2+
3+
all: reqs screenshots
4+
5+
reqs: install auth-business.json auth-community.json
6+
screenshots: business
7+
8+
clean:
9+
-rm *.png
10+
-rm auth-*.json
11+
12+
install:
13+
$(SHOTSCRAPER) install
14+
auth-business.json:
15+
$(SHOTSCRAPER) auth https://app.readthedocs.com/accounts/login/ $@
16+
auth-community.json:
17+
$(SHOTSCRAPER) auth https://app.readthedocs.org/accounts/login/ $@
18+
19+
business: business.yml auth-business.json
20+
$(SHOTSCRAPER) \
21+
multi \
22+
--auth auth-business.json \
23+
--no-clobber \
24+
--log-console \
25+
business.yml
26+
27+
community: community.yml auth-community.json
28+
$(SHOTSCRAPER) \
29+
multi \
30+
--auth auth-community.json \
31+
--no-clobber \
32+
--log-console \
33+
community.yml
22.5 KB
Loading
12.9 KB
Loading

0 commit comments

Comments
 (0)