Skip to main content

Creating CentOS Stream 9 source-git repositories

Source-git repos for CentOS Stream 9 are stored as separate repositories in in c9s branches.

Here is how the repositories should be set up:

  • They are open to the public (for contributions).

  • Issues are disabled (BZ is the official bug tracker).

  • Merge requests are enabled.

  • Description is set:

    Source repo for CentOS Stream package $package.
    You can contribute here by following
  • c9s branch is protected, though force-pushes are allowed from maintainers (for sake of rebasing).

How to create such repo

using packit source-git init

Pushing the repository to GitLab

We have an identity, centos-stream-packit, which has permissions to create new repositories in the namespace.

Here comes a sample script utilizing ogr and python-gitlab to create a new repo to satisfy the requirements above:

import ogr
import os

TARGET_GROUP = "redhat/centos-stream/src"

gitlab_service = ogr.GitlabService(GITLAB_TOKEN)
target_group = gitlab_service.gitlab_instance.groups.get(TARGET_GROUP)

repo_name = "edk2"
project = gitlab_service.gitlab_instance.projects.create({
"name": repo_name,
"description": (
f"Source repo for CentOS Stream package \"{repo_name}\". "
"You can contribute here by following"
"issues_enabled": False,
"visibility": "public",
{"name": "c9s", "push_access_level": "40", "merge_access_level": "40"}