ryanlerch / fedscm-admin

Forked from fedscm-admin 3 years ago
Clone

fedscm-admin

An admin CLI tool to process Fedora SCM requests.

Configuration

The default configuration is located at /etc/fedscm-admin/config.ini. For more information on this, please view the "Default Configuration" section below. The user specified configuration should be located in ~/.config/fedscm-admin/config.ini. To add an additional path, you may set the environment variable FEDSCM_ADMIN_CONFIG to the path of a configuration file.

To get started, you'll also need to get a Pagure API key to create projects/repos and add it to ~/.config/fedscm-admin/config.ini. To do this:

  • Ask @pingou for a token generated by pagure-admin
  • Modify your personal config file at ~/.config/fedscm-admin/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 "releng/fedora-scm-requests" repo to comment and close tickets. To do this:

  • Go to the releng/fedora-scm-requests API tokens page
  • 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/fedscm-admin/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:

  • Go to the PDC API tokens page
  • (In Firefox, YMMV) Press F12 to open the console
  • Enter the Network Tab
  • Ctrl-R to refresh
  • Right-click on the line containing auth/token/obtain and Copy as cURL
  • Paste on the command line, add -H "Accept: application/json" and Enter
  • This will return your API token
  • Paste the API key in the admin section so that it looks like this:
[admin]
pdc_api_token = <api_key_here>

Lastly, since the tool uses git, you'll need to trust the remote git server's SSH key. To do this, make sure you have the proper "@cert-authority" entries in your ~/.ssh/known_hosts file. One way to achieve this is by running the following command:

curl --silent https://admin.fedoraproject.org/ssh_known_hosts >> ~/.ssh/known_hosts

Default Configuration

The default configuration is located at /etc/fedscm-admin/config.ini. This sets the values for:

  • pagure_url - the URL to the Pagure instance that contains the releng/fedora-scm-requests repository. This defaults to https://pagure.io.
  • pagure_dist_git_url - the URL to the Pagure instance on dist-git. This defaults to https://src.fedoraproject.org.
  • pdc_url - the URL to the Product Definition Center (PDC) instance that stores branch and service level agreements. This defaults to https://pdc.fedoraproject.org.

Migrating From fedrepo-req-admin

Although the arguments and options are the same on both commands, the configuration file paths changed to:

  • /etc/fedscm-admin/config.ini
  • ~/.config/fedscm-admin/config.ini

Additionally, the old configuration used to have two sections: [app] and [admin]. Now all settings must be in the [admin] section or they will be ignored.

Building fedscm-admin in Fedora

First check if all the tests are passing using tox. Run the following command to run tox from project directory

$ tox

Once all the tests are passed, create the tarball by running the following command from the project directory

$ python setup.py sdist

This creates a tarball in the dist/ directory under the project folder. Use this tarball to build fedscm-admin in Fedora.