Difference between revisions of "Add a git repository"

From Apertis
Jump to: navigation, search
(Add the git repository to Phabricator)
(Add the git repository to Phabricator: Clarify visibility and autoclose for staging repositories)
Line 49: Line 49:
 
# Import an Existing External Repository
 
# Import an Existing External Repository
 
# Type: Git
 
# Type: Git
# Name: Whatever; Callsign: WHATEVER (you can abbreviate the callsign: if it is named apertis-something, use SOMETHING).
+
# Name: Whatever; Callsign: WHATEVER (you can abbreviate the callsign: if it is named apertis-something, use SOMETHING). For a staging repository, use the STAGING suffix, i.e. WHATEVERSTAGING.
 
# Remote URI: <tt>ssh://git.apertis.org/git/whatever.git</tt>
 
# Remote URI: <tt>ssh://git.apertis.org/git/whatever.git</tt>
 
# SSH Key: K1 (already selected)
 
# SSH Key: K1 (already selected)
# Visible To: Space S3 Public, members of project Apertis; Editable By: members of project Apertis
+
# Set visibility settings:
 +
#* ''For a public repository'': Visible To: Space S3 Public, members of project Apertis; Editable By: members of project Apertis
 +
#* ''For a staging repository'': more restricted; copy from other staging repositories
 
# Configure More Options First
 
# Configure More Options First
 
# Edit Basic Information. Add a description (the same as [[#Adding the project to Phabricator|above]], ending in a full stop). Set Projects to include the project from [[#Adding the project to Phabricator]], plus either ‘Apertis’ or ‘Apertis staging’.
 
# Edit Basic Information. Add a description (the same as [[#Adding the project to Phabricator|above]], ending in a full stop). Set Projects to include the project from [[#Adding the project to Phabricator]], plus either ‘Apertis’ or ‘Apertis staging’.
# Edit Branches. Autoclose Only: regexp(/^(?!wip)/)
+
# Set autoclose options:
 +
#* ''For a public repository'': Edit Branches. Autoclose Only: <tt>regexp(/^(?!wip)/)</tt>
 +
#* ''For a staging repository'': Edit Actions. Autoclose: Disable Autoclose
 
# Activate Repository
 
# Activate Repository
  
 
[[Category:TSC]]
 
[[Category:TSC]]

Revision as of 09:29, 15 April 2016

Apertis hosts its own git repositories. These repositories are used to host code which makes up Apertis, but Apertis also makes use of code that is hosted elsewhere.

Prerequisites

Only projects of high quality can be added to the Apertis git repositories. To ensure this, the project must fulfil some criteria:

  • The project must be free/open source software
  • It must be part of Apertis
  • You must make a commitment to maintain the project
  • To the best of your knowledge, it must not infringe on patents
  • If it re-uses free/open source code from elsewhere, it must comply with all licenses

New projects are currently assessed for compliance with these rules by the Apertis sysadmins. In future, this will be done by the Technical Steering Committee after it has been formed.

Request the git repository

Most people will need to file a task in Phabricator. You will need to include:

  • The repository name
  • A short repository description
  • Any supporting evidence to prove that your repository satisfies the prerequisites

Create the git repositories

You can only add a git repository if you have permissions to do so. Only proven developers are granted this permissions on a case-by-case basis. Most people will need to make a request for the new repository.

$ ssh git.apertis.org
$ cd /git
$ mkdir $project_name.git
$ cd $project_name.git
$ git init --bare --shared=group
$ vim description  # edit it to something descriptive

Add the project to Phabricator

The project should be added to Phabricator as a tag, mainly for ease of grouping related tasks together easily. Only one Phabricator project should be created for a given codebase.

  1. Open https://phabricator.apertis.org/project/create/
  2. Set the project name (human readable) and description (ending in a full stop).
  3. Leave the sprint settings unchecked.
  4. Set the icon to ‘Tag’ and the colour to yellow.
  5. Add additional hashtags for other names the project goes by. Do not add the project name as a hashtag, as Phabricator does this automatically.
  6. Leave the visibility, editability and joinability settings as ‘All Users’.

Add the git repository to Phabricator

This exposes the git data to Phabricator, adding context to differential revisions and allowing auto-closing tasks and revisions based on commits.

  1. Open https://phabricator.apertis.org/diffusion/new/
  2. Import an Existing External Repository
  3. Type: Git
  4. Name: Whatever; Callsign: WHATEVER (you can abbreviate the callsign: if it is named apertis-something, use SOMETHING). For a staging repository, use the STAGING suffix, i.e. WHATEVERSTAGING.
  5. Remote URI: ssh://git.apertis.org/git/whatever.git
  6. SSH Key: K1 (already selected)
  7. Set visibility settings:
    • For a public repository: Visible To: Space S3 Public, members of project Apertis; Editable By: members of project Apertis
    • For a staging repository: more restricted; copy from other staging repositories
  8. Configure More Options First
  9. Edit Basic Information. Add a description (the same as above, ending in a full stop). Set Projects to include the project from #Adding the project to Phabricator, plus either ‘Apertis’ or ‘Apertis staging’.
  10. Set autoclose options:
    • For a public repository: Edit Branches. Autoclose Only: regexp(/^(?!wip)/)
    • For a staging repository: Edit Actions. Autoclose: Disable Autoclose
  11. Activate Repository