akhairna / fedrepo_req

Forked from fedrepo_req 6 years ago
Clone
README.md

fedrepo_req

Overview

fedrepo_req is a command-line (CLI) tool developed in Python that provides an easy way to submit ticket requests for things such as:

  • Requesting a new repository/package
  • Requesting a new branch for your repository/package

Usage

fedrepo-req - a command to request new packages:

Usage: fedrepo-req [OPTIONS] REPO [BRANCH]

  The entry point of the Click application

Options:
  -d, --description TEXT          The package's description.
  -m, --monitor [no-monitoring|monitoring|monitoring-with-scratch]
                                  Monitoring type for the package.
  -n, --namespace [rpms|container|modules|test-modules]
                                  The repo's namespace.
  -s, --summary TEXT              Override the package's summary from the
                                  ticket.
  -t, --ticket TEXT               The package request's ticket number.
  -u, --upstreamurl TEXT          The package's upstream URL.
  --sla TEXT                      The SLAs tied to the first branch. This must
                                  be in the format of "sla_name:2017-12-25"
  --help                          Show this message and exit.

Below is an example when requesting the "python" repository with the default "f27" branch and default SLA. The -t represents the Bugzilla ticket number for the package review:

$ fedrepo-req python -t 1234

Below is an example when requesting the "python" repository with the "2.7" branch and two SLAs. The -t represents the Bugzilla ticket number for the package review:

$ fedrepo-req python 2.7 --sla security_fixes:2020-01-01 --sla bug_fixes:2020-01-01 -t 1234

fedrepo-req-branch - a command to request new package branches:

Usage: fedrepo-req-branch [OPTIONS] PACKAGE BRANCH

  The entry point of the Click application

Options:
  -n, --namespace [rpms|container|modules|test-modules]
                                  The repo's namespace.
  --sla TEXT                      [required]
  --help                          Show this message and exit.

Below is an example of requesting the "2.7" branch for the "python" package:

$ fedrepo-req-branch python 2.7  --sla security_fixes:2020-01-01 --sla bug_fixes:2020-01-01

Configuration

The default configuration is located at /etc/fedrepo_req/config.ini.

To get started, you'll need to get a Pagure API key to the "dist-git-requests" repo and add it to ~/.config/fedrepo_req/config.ini. To do this:

  • Visit https://pagure.io/dist-git-requests/token/new
  • Select "Create a new ticket against this project"
  • Select "Change the status of a ticket of this project"
  • Select "Comment on a ticket of this project"
  • Click on "Create"
  • Scroll down to the "API Keys" section and copy the API key.
  • Create your personal config file at ~/.config/fedrepo_req/config.ini
  • Paste the API key so that it looks like this:
[app]
pagure_api_token = <api_key_here>

Admin Configuration

If you are using the fedrepo-req-admin tool, you'll need to get a Pagure API key to create projects/repos and add it to ~/.config/fedrepo_req/config.ini. To do this:

  • Visit https://src.fedoraproject.org/pagure/settings/token/new
  • Select "Create a new project"
  • Select "Modify an existing project"
  • Click on "Create"
  • Scroll down to the "API Keys" section and copy the API key.
  • Modify your personal config file at ~/.config/fedrepo_req/config.ini
  • Paste the API key in the admin section so that it looks like this:
[admin]
pagure_api_token = <api_key_here>

Additionally, you'll need an API key on the "dist-git-requests" repo to comment and close tickets. To do this:

  • Visit https://pagure.io/dist-git-requests/token/new
  • Select "Change the status of a ticket of this project"
  • Select "Comment on a ticket of this project"
  • Select "Update an issue, status, comments, custom fields..."
  • Click on "Create"
  • Scroll down to the "API Keys" section and copy the API key.
  • Create your personal config file at ~/.config/fedrepo_req/config.ini
  • Paste the API key in the admin section so that it looks like this:
[admin]
pagure_ticket_api_token = <api_key_here>

Additionally, you'll need an API token to make modifications in PDC. To do this:

  • Visit https://pdc.fedoraproject.org/rest_api/v1/auth/token/ and follow the directions to obtain a token
  • Paste the API key in the admin section so that it looks like this:
[admin]
pdc_api_token = <api_key_here>