|
| 1 | +# Publish GitLab and GitHub repositories |
| 2 | + |
| 3 | +You can sync your GitLab and GitHub repositories directly to CDS. |
| 4 | +Each new release will create a record on CDS with a ZIP archive of the repository's contents and automatically extracted metadata. |
| 5 | + |
| 6 | +## Connect your account |
| 7 | + |
| 8 | +To be able to sync your repositories, you need to connect your GitLab and/or GitHub account. |
| 9 | + |
| 10 | +1. From any page on CDS, click on the user dropdown, and click either **CERN GitLab** or **GitHub**. The option you select depends on where your repository is located. |
| 11 | + - Select **CERN GitLab** if your repository is on [**gitlab.cern.ch**](https://gitlab.cern.ch). |
| 12 | + - Select **GitHub** if your repository is on [**github.com**](https://github.com). |
| 13 | + |
| 14 | + {width=200px} |
| 15 | + |
| 16 | +2. Click **Connect** and follow the steps to log in with the service. |
| 17 | +3. Your repositories will show up in a list. |
| 18 | + |
| 19 | +  |
| 20 | + |
| 21 | +!!! info "Supported repository services" |
| 22 | + |
| 23 | + **We only support CERN's internal GitLab instance and public GitHub.** We do not currently support |
| 24 | + any other repository services. If your repository is hosted elsewhere, you can create and publish records |
| 25 | + for its releases manually: see how to [upload a record](./upload.md). |
| 26 | + |
| 27 | +!!! info "Repository visibility" |
| 28 | + |
| 29 | + **Only repositories for which you have sufficient access permissions are shown.** |
| 30 | + In general, you must be able to view the repository and manage its webhooks. |
| 31 | + If you do not have the correct level of access to a repository, it will not be visible in the list on CDS. |
| 32 | + |
| 33 | + On GitLab, this means you need either the **Maintainer** or **Owner** role on the project or its group. See [GitLab's project permissions documentation](https://docs.gitlab.com/user/permissions/#projects) for more information. |
| 34 | + |
| 35 | + On GitHub, this usually means you need at least the **Admin** role on the repository. See [GitHub's roles documentation](https://docs.github.com/en/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization) for more information. |
| 36 | + |
| 37 | +## Enable a repository |
| 38 | + |
| 39 | +When a repository is enabled, CDS will start listening for releases and automatically create a record when a new one is received. |
| 40 | +By default, none of your repositories are enabled, so no records will be created. |
| 41 | + |
| 42 | +1. Find the repository in the list. If you cannot find it, please refer to the "Repository visibility" section above. |
| 43 | +2. Click on the **toggle switch**. |
| 44 | +3. Select the [community](../communities/communities.md) that records made for the repository's releases should be published to. |
| 45 | + All records on CDS must be published to a community. The record will be subject to the [community's review policy](../communities/submit.md) as normal. |
| 46 | + |
| 47 | +  |
| 48 | + |
| 49 | +4. The repository is enabled! New releases from this point will result in the creation of a record on CDS. |
| 50 | + |
| 51 | +## View a repository's releases |
| 52 | + |
| 53 | +Whenever you create a new release for an enabled repository, CDS will receive it and attempt to publish a record from it. |
| 54 | + |
| 55 | +To view the status of a release and the record created from it, click on the repository's name in the list. |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | +### Release statuses |
| 60 | +The status of each release is shown. The possible statuses are as follows: |
| 61 | + |
| 62 | +- **Received**/**Processing**: CDS has received the release from GitHub/GitLab and is processing it. This normally takes a few seconds, but can sometimes take longer for very large repositories. If a repository is stuck in this state for a longer time, please [contact the CDS team via ServiceNow](https://cern.service-now.com/service-portal?id=sc_cat_item&name=incident&se=CDS-Service) with the full name of your repository. |
| 63 | + |
| 64 | +- **Failed**: There was a problem creating a record from the release. Usually, this means some part of the repository contained unexpected data. Click on the release and click on the "Errors" tab to see more information. |
| 65 | + |
| 66 | +- In most cases, you will need to modify the repository, and then create a new release. |
| 67 | +- If an "Edit record" button is visible, you can instead edit the draft record to correct the errors, and then publish it manually. |
| 68 | + |
| 69 | +- **Pending review**: The record was successfully created as a draft and is pending review by the community it was submitted to. Once it is accepted, it will be published immediately. No further action is required from you. |
| 70 | + |
| 71 | +- **Published**: The record has been published. |
| 72 | + |
| 73 | +### Create a DOI |
| 74 | + |
| 75 | +By default, records published from repository releases are not assigned a DOI. |
| 76 | +If a release's published record does not have a DOI, you can create one: |
| 77 | + |
| 78 | +1. Click on the **View record** button for the relevant release. |
| 79 | +2. Click on the **Edit** button. |
| 80 | +3. Follow the [steps to either obtain a new DOI or specify an existing one](./upload.md#dois). |
| 81 | +4. Click on the **Publish** button to save your changes. |
| 82 | + |
| 83 | +If a release's record has a DOI, this is shown in the list of releases. |
| 84 | + |
| 85 | +## Disable a repository |
| 86 | + |
| 87 | +Disabling a repository will stop new releases from being published as record on CDS. |
| 88 | + |
| 89 | +!!! warning "Existing records created from repository releases" |
| 90 | + **Disabling a repository will not affect existing records created from its releases**. |
| 91 | + Deleting published records is usually not possible on CDS. |
| 92 | + Please [see the deletion policy](../deposit/published-records.md#delete) for more details. |
| 93 | + |
| 94 | +1. Find the repository in the list. It will be shown above other, non-enabled repositories, in a separate section titled "Enabled Projects" or "Enabled Repositories". |
| 95 | +2. Click on the toggle switch. |
| 96 | +3. The repository is disabled. New releases will no longer result in the creation of a record on CDS. |
0 commit comments