Skip to content

Commit b6a65da

Browse files
committed
Documentation updates for researchers (WIP)
WIP updates to the OpenSAFELY documentation, following changes to our processes around repo creation, transfer, and management.
1 parent d3a6120 commit b6a65da

2 files changed

Lines changed: 70 additions & 43 deletions

File tree

docs/getting-started/how-to/create-a-code-repository-for-your-project/index.md

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,10 @@
77

88
You only need to create a code repository once for a particular project.
99

10-
Create a new research code repository based on the research template.
1110

12-
1. In your web browser,
13-
go to the [research code template repository](https://github.com/opensafely/research-template).
14-
1. Click the "Use this template" button
15-
to begin the process of creating a new research code repository for you to work on.
16-
The screenshot below shows this.
11+
To create a repository for your OpenSAFELY project, you can either:
1712

18-
![A screenshot showing the "Use this template" button for the research code template repository.](../../../images/codespaces-template.png)
13+
- Have a new repository created for you in the `opensafely` GitHub organisation
14+
- Create a repository in your own GitHub account, and request to have this trasnferred to the `opensafely` GitHub organisation later
1915

20-
There are several options given
21-
when creating a new repository from a template.
22-
23-
Here is a quick explanation of the options:
24-
25-
* If you are creating a repository for an OpenSAFELY project,
26-
you should choose `opensafely` as the repository owner.
27-
* If you are creating a repository for testing OpenSAFELY out,
28-
you should choose *your own GitHub user account* as the repository owner.
29-
* You can enter any name and description that you choose for your repository.
30-
* You can choose whether the repository visibility is public or private.
31-
* You do not need to select "Include all branches".
32-
* You can ignore the mention of "GitHub Apps from GitHub Marketplace"
33-
in GitHub's instructions for creating a new repository from a template.
34-
35-
If you are unsure of what to do,
36-
refer to GitHub's step-by-step instructions for [creating a new repository from a template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template#creating-a-repository-from-a-template).
37-
38-
!!! warning
39-
Creating a repository owned by your GitHub user account
40-
will enable you to:
41-
42-
* work on your OpenSAFELY research code in Codespaces
43-
* check that your research code works with the OpenSAFELY platform
44-
45-
**It will not allow you to run code on OpenSAFELY's platform.**
46-
47-
For that, you would have to request that your repository is transferred to the `opensafely` organization.
48-
49-
Approved OpenSAFELY users are able to create a repository within the `opensafely` organization directly.
16+
You can find more information about both of these options, and how to create a repository, in the [Creating a repository for a project](docs/repositories.md/#Creating-a-repository-for-a-project) section of the OpenSAFELY documentation.

docs/repositories.md

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,23 @@ GitHub is the means by which code in the repository is passed to the server to b
99

1010
## Repository visibility
1111

12-
In accordance with the [Principles of OpenSAFELY](https://www.opensafely.org/about/#transparency-and-public-logs), we expect all code from all users to be made public. As technical users will know, a public GitHub repository is visible by anyone on the internet, but only specified people will have the ability to change it.
12+
In accordance with the [Principles of OpenSAFELY](https://www.opensafely.org/about/#transparency-and-public-logs), we expect all code from all users to be made public.
13+
14+
By default, repositories will initially be public, visible to anyone. Repositories may be temporarily set to private, visible to members of the opensafely organization only, by request (see How to make your repository private, below).
15+
16+
### How to make your repository private
17+
18+
Contact [Tech Support](how-to-get-help.md/#slack) to request that your repository is made private at any time.
19+
20+
If your request is approved, Tech Support will make your repository private and you will be notified once this has been completed.
21+
22+
Private repositories will be made public after 12 months. Ahead of that, you can make a new request to extend the private visibility period for another 12 months.
23+
24+
!!! info
25+
A repository must be made public if it forms part of a publication.
26+
27+
Refer to our information on when you need to [make your code public](https://docs.opensafely.org/repositories/#when-you-need-to-make-your-code-public).
28+
1329

1430
### How to make your code public
1531

@@ -26,29 +42,73 @@ A repository must be made public if it forms part of a [publication](https://www
2642
!!! warning
2743
You should _never_ commit files or content that should not be made public to the repository. All committed files, whether on the `main` branch or on development branches, will remain in the git history of the repository even after they have been deleted. These might include for example patient- or commercially-sensitive data from other sources, internal institutional documentation or forms, and incomplete manuscript drafts.
2844

29-
## Creating a repository for a new project
45+
## Creating a repository for a project
46+
47+
### New researchers and projects
48+
49+
When you are approved to start working on an OpenSAFELY research project, you will be added to the OpenSAFELY GitHub organisation. Within the OpenSAFELY GitHub organisation, you’ll be added to the researchers team.
50+
51+
Contact [Tech Support](how-to-get-help.md/#slack) and ask them to create a new repository for your research, or transfer a repository from your personal GitHub account into the OpenSAFELY GitHub organisation (depending on your preference, and whether you have an existing repository to transfer).
52+
53+
New repositories will be created with the settings listed in [Default opensafely repository settings](tbc) below. A transferred repository's settings will also be updated to match these.
54+
55+
Repositories will initially be public, but may be (temporarily) set to private at your request. See [Repository visibility](#repository-visibility) to make the right choice for your study.
56+
57+
### Established researchers and projects
58+
59+
Contact [Tech Support](how-to-get-help.md/#slack) to request the creation of any additional repositories you require. Please provide a name for the repository when you make a request. Your repository name should be short but informative — browse [existing repo names](https://github.com/orgs/opensafely/repositories) for inspiration.
60+
61+
All repositories will be created using the OpenSAFELY [research-template repo](https://github.com/opensafely/research-template). You can see a detailed breakdown of this repository’s structure in [Repository structure](#repository-structure).
62+
63+
## Transferring your own repository to the OpenSAFELY GitHub organisation
64+
65+
You may want to start work on a project before approval by creating a repository in your own GitHub account (see instructions for how to do this below).
66+
67+
!!! warning
68+
Creating a repository owned by your GitHub user account will enable you to:
69+
70+
- work on your OpenSAFELY research code in Codespaces
71+
- check that your research code works with the OpenSAFELY platform
72+
73+
It will not allow you to run code on OpenSAFELY's platform. For that, you would have to request that your repository is transferred to the opensafely organization.
74+
75+
### How to transfer an existing repository to the opensafely organization
76+
77+
To request that a repository be transferred from your own GitHub account to the OpenSAFELY GitHub organisation, please contact [Tech Support](how-to-get-help.md/#slack).
78+
79+
If your request is approved, Tech Support will make the transfer and you will be notified once this has been completed.
80+
81+
The settings of any transferred repositories will be updated to match the default opensafely repository settings, listed below:
82+
83+
- Deletion of branches on merge: enabled
84+
- Branch protection for `master` and `main` branches: enabled
85+
- Require a pull request before merging: disabled
86+
87+
### Creating a research repository in your own GitHub account so that you can transfer it later
3088

3189
For ease of use, we have created a research template that you should use for your study.
3290
Go to the [OpenSAFELY research template repo](https://github.com/opensafely/research-template) on GitHub.
3391
Click the green button that says <span style="background-color: green; color: white">&nbsp;**Use this template**&nbsp;</span>.
3492

3593
Fill in the details:
3694

37-
- **owner**: select your personal GitHub for testing/experimenting, or select the `opensafely` organisation for a bona fide OpenSAFELY-approved study. The repo can be transferred into the `opensafely` organisation later if needed.
38-
- **repository name**: It needs to be short but informative &mdash; browse existing repo names for inspiration.
39-
- **Description**: This will appear at the top of the repo on GitHub. No more than a sentence is needed as the repo should be explained fully in the README.
95+
- **owner**: Select your personal GitHub for testing/experimenting.
96+
- **repository name**: It needs to be short but informative &mdash; browse [existing repo names](https://github.com/orgs/opensafely/repositories) for inspiration.
97+
- **description**: This will appear at the top of the repo on GitHub. No more than a sentence is needed as the repo should be explained fully in the `README.md`.
4098
- **public / private**: See [Repository visibility](#repository-visibility) to make the the right choice for your study.
4199
- **Include all branches**: Leave unchecked.
42100

43101
And submit. You will now be at the GitHub landing page for the repo.
44102

103+
If you are unsure of what to do, refer to GitHub's step-by-step instructions for [creating a new repository from a template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template#creating-a-repository-from-a-template).
104+
45105
You should also download a copy of this repo to your machine so you can work on it locally.
46106
This is necessary because you can:
47107

48108
* develop your code using familiar editing tools
49109
* test and run code without disturbing other contributors
50110

51-
To clone your new repository to your machine, [follow these instructions](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) which explains cloning both via GitHub Desktop or via the command line.
111+
To clone your new repository to your machine, [follow these instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) which explains cloning both via GitHub Desktop or via the command line.
52112
When this is done, you should have a folder whose name is the same as the repo on your machine.
53113

54114
Note that if someone else wants to commit to your recently created OpenSAFELY repo, they may need to wait up to an hour for the necessary write permissions to be granted.

0 commit comments

Comments
 (0)