#1 Add the fedrepo-req, fedrepo-req-branch, and fedrepo-req-unretire scripts
Merged 2 years ago by mprahl. Opened 2 years ago by mprahl.

file added
+7

@@ -0,0 +1,7 @@ 

+ .idea

+ .tox

+ __pychache__

+ *.pyc

+ *.pyo

+ .cache

+ fedrepo_req.egg-info/

file modified
+91 -1

@@ -1,3 +1,93 @@ 

  # fedrepo_req

  

- A CLI tool that provides an easy way to submit ticket requests for packaging tasks in Fedora 

\ No newline at end of file

+ ## 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

+ * Requesting to unretire a repository/package

+ 

+ ## Usage

+ 

+ **fedrepo-req** - a command to request new packages:

+ 

+ ```

+ Usage: fedrepo-req [OPTIONS] REPO BRANCHES...

+ 

+ Options:

+   -c, --comaintainers TEXT        The package's co-maintainers.

+   -d, --description TEXT          The package's description.

+   -k, --koschei                   Enable Koschei integration.

+   -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.

+   --help                          Show this message and exit.

+ ```

+ 

+ Below is an example when requesting the "python" repository with branches

+ "2.7" and "3.6". The `-t` represents the Bugzilla ticket number for the package

+ review:

+  

+ ```

+ $ fedrepo-req python 2.7 3.6 -t 1234

+ ```

+ 

+ 

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

+ 

+ ```

+ Usage: fedrepo-req-branch [OPTIONS] PACKAGE BRANCHES...

+ 

+ Options:

+   -n, --namespace [rpms|container|modules|test-modules]

+                                   The repo's namespace.

+   --help                          Show this message and exit.

+ ```

+ 

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

+  

+ ```

+ $ fedrepo-req-branch python 3.5

+ ```

+ 

+ 

+ **fedrepo-req-unretire** - a command to unretire a package:

+ 

+ ```

+ Usage: fedrepo-req-unretire [OPTIONS] REPO

+ 

+ Options:

+   --acknowledge                   Disable the confirmation prompt.

+   -n, --namespace [rpms|container|modules|test-modules]

+                                   The repo's namespace.

+   --help                          Show this message and exit.

+ ```

+ 

+ Below is an example of unretiring the "python" package:

+  

+ ```

+ $ fedrepo-req-unretire python

+ ```

+ 

+ ## Configuration (UPDATE ME)

+ 

+ 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 "pkgdb-tickets"

+ repo and add it to `~/.config/fedrepo_req/config.ini`. To do this:

+ * Visit `http://127.0.0.1:5000/pkgdb-tickets/token/new`

+ * Select "Create a new ticket against 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:

+ ```ini

+ [app]

+ pagure_api_token = <api_key_here>

+ ```

file added
+6

@@ -0,0 +1,6 @@ 

+ [app]

+ # TODO: Change me

+ pagure_url = http://127.0.0.1:5000

+ # TODO: Change me

+ pagure_repo = pkgdb-tickets

+ bugzilla_url = https://bugzilla.redhat.com

@@ -0,0 +1,153 @@ 

+ #!/usr/bin/env python

+ # -*- coding: utf-8 -*-

+ #

+ # This file is part of fedrepo_req.

+ # Copyright © 2017 Red Hat, Inc.

+ #

+ # This program is free software; you can redistribute it and/or modify

+ # it under the terms of the GNU General Public License as published by

+ # the Free Software Foundation; either version 2 of the License, or

+ # (at your option) any later version.

+ #

+ # This program is distributed in the hope that it will be useful,

+ # but WITHOUT ANY WARRANTY; without even the implied warranty of

+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

+ # GNU General Public License for more details.

+ """

+ Initializes the module and provides helper functions

+ """

+ from __future__ import absolute_import

+ import os

+ import click

+ import requests

+ from bugzilla import Bugzilla

+ from six.moves import configparser

+ 

+ 

+ NAMESPACE_CHOICES = ['rpms', 'container', 'modules', 'test-modules']

+ 

+ 

+ def get_config():

+     """

+     An abstraction of using ConfigParser for the project

+     :return: ConfigParser object

+     """

+     config = configparser.ConfigParser()

+     home_dir = os.path.expanduser('~')

+     paths = [

+         '/etc/fedrepo_req/config.ini',

+         os.path.join(home_dir, '.config', 'fedrepo_req', 'config.ini'),

+     ]

+     config.read(paths)

+     return config

+ 

+ 

+ def get_config_item(config, section, item):

+     """

+     Gets a config item and throws a ClickException if it doesn't exist

+     :param config: ConfigParser object from get_config

+     :param section: string representing the section in the ini (e.g. app)

+     :param item: string representing the item in the section you want

+     (e.g. pagure_url)

+     :return: string of the config item

+     """

+     try:

+         return config.get(section, item)

+     except configparser.NoOptionError:

+         error_msg = ('The "{0}" setting is not set in the "{1}" section'

+                      .format(item, section))

+         raise click.ClickException(error_msg)

+ 

+ 

+ def new_pagure_issue(config, title, body):

+     """

+     Posts a new Pagure issue

+     :param config: ConfigParser object from get_config

+     :param title: string representing the issue's title

+     :param body: string representing the issue's body

+     :return: the URL to the created issue

+     """

+     pagure_url = get_config_item(config, 'app', 'pagure_url').rstrip('/')

+     pagure_api_url = '{0}/api/0'.format(pagure_url)

+     pagure_api_token = get_config_item(config, 'app', 'pagure_api_token')

+     pagure_repo = get_config_item(config, 'app', 'pagure_repo')

+     pagure_new_issue_url = '{0}/{1}/new_issue'.format(

+         pagure_api_url, pagure_repo)

+ 

+     headers = {

+         'Authorization': 'token {0}'.format(pagure_api_token)

+     }

+     payload = {

+         'title': title,

+         'issue_content': body

+     }

+     output = requests.post(

+         pagure_new_issue_url, data=payload, headers=headers).json()

+ 

+     if 'error' in output:

+         raise click.ClickException(output['error'])

+ 

+     return '{0}/{1}/issue/{2}'.format(

+         pagure_url, pagure_repo, output['issue']['id'])

+ 

+ 

+ def get_valid_bugzilla_bug(config, id, pkg):

+     """

+     Checks the validity of a Bugzilla bug representing a Fedora package review

+     This function was inspired by:

+     https://github.com/fedora-infra/pkgdb2/blob/master/pkgdb2/api/extras.py

+     :param config: ConfigParser object from get_config

+     :param id: string or integer of the Bugzilla ticket ID

+     :param pkg: string of the package name 

+     :return: Bugzilla bug object

+     """

+     bz_url = get_config_item(config, 'app', 'bugzilla_url')

+     bz_api_url = '{0}/xmlrpc.cgi'.format(bz_url.rstrip('/'))

+     bz_api = Bugzilla(bz_api_url)

+     bug = bz_api.getbug(id)

+ 

+     # Check that the ticket is valid

+     if bug.component != 'Package Review':

+         raise click.ClickException(

+             'The ticket provided is not the proper type')

+     elif bug.product != 'Fedora':

+         raise click.ClickException('The ticket provided is not for Fedora')

+     elif bug.assigned_to in ['', None, 'nobody@fedoraproject.org']:

+         raise click.ClickException(

+             'The ticket provided is not assigned to anyone')

+ 

+     # Check if the review was approved and by whom

+     flag_set = False

+     for flag in bug.flags:

+         if flag.get('name') == 'fedora-review':

+             if flag.get('status') == '+':

+                 flag_set = True

+ 

+             if flag['setter'] == bug.creator:

+                 error = ('The ticket\'s review is approved by the person '

+                          'creating the ticket. This is not allowed.')

+                 raise click.ClickException(error)

+             elif flag['setter'] != bug.assigned_to:

+                 raise click.ClickException(

+                     'The review is not approved by the assignee of the ticket')

+             break

+ 

+     if not flag_set:

+         raise click.ClickException('The ticket provide is not yet approved')

+ 

+     # Check the format of the Bugzilla ticket title

+     tmp_summary = bug.summary.partition(':')[2]

+     if not tmp_summary:

+         raise click.ClickException(

+             'Invalid title for this Bugzilla ticket (no ":" present)')

+     if ' - ' not in tmp_summary:

+         raise click.ClickException(

+             'Invalid title for this Bugzilla ticket (no "-" present)')

+ 

+     pkg_in_ticket = tmp_summary.split(' - ', 1)[0].strip()

+     if pkg != pkg_in_ticket:

+         error = ('The package in the ticket "{0}" doesn\'t match the one '

+                  'provided "{1}"'.format(pkg_in_ticket, pkg))

+         raise click.ClickException(error)

+ 

+     return bug

@@ -0,0 +1,71 @@ 

+ #!/usr/bin/env python

+ # -*- coding: utf-8 -*-

+ #

+ # This file is part of fedrepo_req.

+ # Copyright © 2017 Red Hat, Inc.

+ #

+ # This program is free software; you can redistribute it and/or modify

+ # it under the terms of the GNU General Public License as published by

+ # the Free Software Foundation; either version 2 of the License, or

+ # (at your option) any later version.

+ #

+ # This program is distributed in the hope that it will be useful,

+ # but WITHOUT ANY WARRANTY; without even the implied warranty of

+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

+ # GNU General Public License for more details.

+ """

+ The fedrepo-req script

+ """

+ from __future__ import absolute_import

+ import click

+ import json

+ 

+ from fedrepo_req import (

+     get_config, get_valid_bugzilla_bug, new_pagure_issue, NAMESPACE_CHOICES)

+ 

+ MONITOR_CHOICES = ['no-monitoring', 'monitoring', 'monitoring-with-scratch']

+ 

+ 

+ @click.command()

+ @click.option('--comaintainers', '-c', help='The package\'s co-maintainers.',

+               multiple=True, default=[])

+ @click.option('--description', '-d', help='The package\'s description.')

+ @click.option('--monitor', '-m', type=click.Choice(MONITOR_CHOICES),

+               default=MONITOR_CHOICES[2],

+               help='Monitoring type for the package.')

+ @click.option('--namespace', '-n', type=click.Choice(NAMESPACE_CHOICES),

+               default='rpms', help='The repo\'s namespace.')

+ @click.option('--summary', '-s',

+               help='Override the package\'s summary from the ticket.')

+ @click.option('--ticket', '-t', help='The package request\'s ticket number.',

+               prompt=True)

+ @click.option('--upstreamurl', '-u', help='The package\'s upstream URL.')

+ @click.argument('repo')

+ @click.argument('branches', nargs=-1, required=True)

+ def cli(branches, repo, upstreamurl, ticket, summary, namespace, monitor,

+         koschei, description, comaintainers):

+     """

+     The entry point of the Click application

+     """

+     config = get_config()

+     bug = get_valid_bugzilla_bug(config, ticket, repo)

+     summary_from_bug = bug.summary.split(' - ', 1)[1].strip()

+ 

+     ticket_body = json.dumps({

+         'action': 'new_repo',

+         'branches': branches,

+         'comaintainers': comaintainers,

+         'description': description or '',

+         'monitor': monitor,

+         'namespace': namespace,

+         'repo': repo,

+         'summary': summary or summary_from_bug,

+         'ticket': ticket,

+         'upstreamurl': upstreamurl or ''

+     }, indent=True)

+     ticket_title = 'New Repo for "{0}/{1}"'.format(namespace, repo)

+     click.echo(new_pagure_issue(config, ticket_title, ticket_body))

+ 

+ 

+ if __name__ == '__main__':

+     cli()

@@ -0,0 +1,52 @@ 

+ #!/usr/bin/env python

+ # -*- coding: utf-8 -*-

+ #

+ # This file is part of fedpkg-req.

+ # Copyright © 2017 Red Hat, Inc.

+ #

+ # This program is free software; you can redistribute it and/or modify

+ # it under the terms of the GNU General Public License as published by

+ # the Free Software Foundation; either version 2 of the License, or

+ # (at your option) any later version.

+ #

+ # This program is distributed in the hope that it will be useful,

+ # but WITHOUT ANY WARRANTY; without even the implied warranty of

+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

+ # GNU General Public License for more details.

+ """

+ The fedrepo-req-branch script

+ """

+ from __future__ import absolute_import

+ import click

+ import json

+ 

+ from fedrepo_req import get_config, new_pagure_issue

+ 

+ NAMESPACE_CHOICES = ['rpms', 'container', 'modules', 'test-modules']

+ MONITOR_CHOICES = ['no-monitoring', 'monitoring', 'monitoring-with-scratch']

+ 

+ 

+ @click.command()

+ @click.option('--namespace', '-n', type=click.Choice(NAMESPACE_CHOICES),

+               default='rpms', help='The repo\'s namespace.')

+ @click.argument('package')

+ @click.argument('branches', nargs=-1, required=True)

+ def cli(branches, package, namespace):

+     """

+     The entry point of the Click application

+     """

+     config = get_config()

+ 

+     ticket_body = json.dumps({

+         'action': 'new_branches',

+         'branches': branches,

+         'namespace': namespace,

+         'package': package,

+     }, indent=True)

+     ticket_title = ('New Branch(es) "{0}" for "{1}/{2}"'

+                     .format(', '.join(branches), package, namespace))

+     click.echo(new_pagure_issue(config, ticket_title, ticket_body))

+ 

+ 

+ if __name__ == '__main__':

+     cli()

@@ -0,0 +1,51 @@ 

+ #!/usr/bin/env python

+ # -*- coding: utf-8 -*-

+ #

+ # This file is part of fedrepo_req.

+ # Copyright © 2017 Red Hat, Inc.

+ #

+ # This program is free software; you can redistribute it and/or modify

+ # it under the terms of the GNU General Public License as published by

+ # the Free Software Foundation; either version 2 of the License, or

+ # (at your option) any later version.

+ #

+ # This program is distributed in the hope that it will be useful,

+ # but WITHOUT ANY WARRANTY; without even the implied warranty of

+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

+ # GNU General Public License for more details.

+ """

+ The fedrepo-req-unretire script

+ """

+ from __future__ import absolute_import

+ import click

+ import json

+ 

+ from fedrepo_req import get_config, new_pagure_issue, NAMESPACE_CHOICES

+ 

+ 

+ @click.command()

+ @click.option('--acknowledge', is_flag=True, default=False,

+               help='Disable the confirmation prompt.')

+ @click.option('--namespace', '-n', type=click.Choice(NAMESPACE_CHOICES),

+               default='rpms', help='The repo\'s namespace.')

+ @click.argument('repo')

+ def cli(repo, namespace, acknowledge):

+     """

+     The entry point of the Click application

+     """

+     config = get_config()

+ 

+     ticket_body = json.dumps({

+         'action': 'unretire',

+         'namespace': namespace,

+         'repo': repo

+     }, indent=True)

+     ticket_title = 'Unretire "{0}/{1}"'.format(namespace, repo)

+     confirmation_msg = ('Are you sure you want to unretire {0}/repo?'

+                         .format(namespace, repo))

+     if acknowledge or click.confirm(confirmation_msg):

+         click.echo(new_pagure_issue(config, ticket_title, ticket_body))

+ 

+ 

+ if __name__ == '__main__':

+     cli()

file added
+25

@@ -0,0 +1,25 @@ 

+ from setuptools import setup

+ 

+ description = \

+     'A CLI tool to issue tickets for repo requests'

+ 

+ setup(

+     author='Red Hat, Inc.',

+     # TODO: Change me to something more appropriate

+     author_email='mprahl@redhat.com',

+     data_files=[('/etc/fedrepo_req/', ['config.ini'])],

+     description=description,

+     entry_points='''

+         [console_scripts]

+         fedrepo-req=fedrepo_req.fedrepo_req:cli

+         fedrepo-req-branch=fedrepo_req.fedrepo_req_branch:cli

+         fedrepo-req-unretire=fedrepo_req.fedrepo_req_unretire:cli

+     ''',

+     include_package_data=True,

+     install_requires=['click', 'python-bugzilla', 'requests', 'six'],

+     license='GPLv2+',

+     name='fedrepo_req',

+     packages=['fedrepo_req'],

+     package_dir={'fedrepo_req': 'fedrepo_req'},

+     version='0.1.0',

+ )

empty or binary file added

@@ -0,0 +1,35 @@ 

+ interactions:

+ - request:

+     body: !!python/unicode 'issue_content=%7B%0A+%22action%22%3A+%22new_branches%22%2C+%0A+%22namespace%22%3A+%22rpms%22%2C+%0A+%22branches%22%3A+%5B%0A++%222.7%22%2C+%0A++%22dev%22%0A+%5D%2C+%0A+%22package%22%3A+%22some_package%22%0A%7D&title=New+Branch%28es%29+%222.7%2C+dev%22+for+%22some_package%2Frpms%22'

+     headers:

+       Accept: ['*/*']

+       Accept-Encoding: ['gzip, deflate']

+       Authorization: [token 1234]

+       Connection: [keep-alive]

+       Content-Length: ['281']

+       Content-Type: [application/x-www-form-urlencoded]

+       User-Agent: [python-requests/2.13.0]

+     method: POST

+     uri: http://127.0.0.1:5000/api/0/pkgdb-tickets/new_issue

+   response:

+     body: {string: !!python/unicode "{\n  \"issue\": {\n    \"assignee\": null, \n\

+         \    \"blocks\": [], \n    \"close_status\": null, \n    \"closed_at\": null,\

+         \ \n    \"comments\": [], \n    \"content\": \"{\\n \\\"action\\\": \\\"new_branches\\\

+         \", \\n \\\"namespace\\\": \\\"rpms\\\", \\n \\\"branches\\\": [\\n  \\\"\

+         2.7\\\", \\n  \\\"dev\\\"\\n ], \\n \\\"package\\\": \\\"some_package\\\"\\\

+         n}\", \n    \"custom_fields\": [], \n    \"date_created\": \"1492629392\"\

+         , \n    \"depends\": [], \n    \"id\": 30, \n    \"last_updated\": \"1492629392\"\

+         , \n    \"milestone\": \"\", \n    \"priority\": null, \n    \"private\":\

+         \ false, \n    \"status\": \"Open\", \n    \"tags\": [], \n    \"title\":\

+         \ \"New Branch(es) \\\"2.7, dev\\\" for \\\"some_package/rpms\\\"\", \n  \

+         \  \"user\": {\n      \"fullname\": \"Matt Prahl\", \n      \"name\": \"mprahl\"\

+         \n    }\n  }, \n  \"message\": \"Issue created\"\n}"}

+     headers:

+       content-length: ['716']

+       content-type: [application/json]

+       date: ['Wed, 19 Apr 2017 19:16:32 GMT']

+       server: [Werkzeug/0.11.10 Python/2.7.13]

+       set-cookie: ['pagure=eyJfcGVybWFuZW50Ijp0cnVlfQ.C9lJEA.5dhdh5O1Nq9JsmPvKc-1WmJh1pQ;

+           Expires=Sat, 20-May-2017 19:16:32 GMT; HttpOnly; Path=/']

+     status: {code: 200, message: OK}

+ version: 1

@@ -0,0 +1,275 @@ 

+ interactions:

+ - request:

+     body: !!python/unicode '<?xml version=''1.0''?>

+ 

+       <methodCall>

+ 

+       <methodName>Bugzilla.version</methodName>

+ 

+       <params>

+ 

+       <param>

+ 

+       <value><struct>

+ 

+       </struct></value>

+ 

+       </param>

+ 

+       </params>

+ 

+       </methodCall>

+ 

+       '

+     headers:

+       Accept: ['*/*']

+       Accept-Encoding: ['gzip, deflate']

+       Connection: [keep-alive]

+       Content-Length: ['161']

+       Content-Type: [text/xml]

+       User-Agent: [Python/Bugzilla]

+     method: POST

+     uri: https://bugzilla.redhat.com/xmlrpc.cgi

+   response:

+     body:

+       string: !!binary |

+         H4sIAAAAAAAAA1yOwQ6CMBBEf4X0bpcaNB6W5cYHGPyAChsloS1pC+HzRdMa42mzMy8zg81mpmJl

+         H0Zna6FkKQq2vRtG+6jFrWsPF9EQGo5PN1w5zM4GJpy11yakS7jqadnVEP3Sxzdt7uwJrTZMKRvh

+         8/2gewNVspLqWJ5PUiEkDSExkHMgB3+d1At5B/wNfAEAAP//AwD2noGt1wAAAA==

+     headers:

+       connection: [close]

+       content-encoding: [gzip]

+       content-type: [text/xml]

+       date: ['Thu, 20 Apr 2017 17:44:58 GMT']

+       server: [Apache]

+       set-cookie: [Bugzilla_login_request_cookie=uNkpqwYHWi; domain=bugzilla.redhat.com;

+           path=/; HttpOnly]

+       soapserver: ['SOAP::Lite/Perl/1.11']

+       vary: ['Accept-Encoding,User-Agent']

+       x-content-type-options: [nosniff]

+       x-frame-options: [SAMEORIGIN]

+       x-xss-protection: [1; mode=block]

+     status: {code: 200, message: OK}

+ - request:

+     body: !!python/unicode '<?xml version=''1.0''?>

+ 

+       <methodCall>

+ 

+       <methodName>Bug.get</methodName>

+ 

+       <params>

+ 

+       <param>

+ 

+       <value><struct>

+ 

+       <member>

+ 

+       <name>extra_fields</name>

+ 

+       <value><array><data>

+ 

+       <value><string>comments</string></value>

+ 

+       <value><string>description</string></value>

+ 

+       <value><string>external_bugs</string></value>

+ 

+       <value><string>flags</string></value>

+ 

+       <value><string>tags</string></value>

+ 

+       <value><string>sub_component</string></value>

+ 

+       </data></array></value>

+ 

+       </member>

+ 

+       <member>

+ 

+       <name>ids</name>

+ 

+       <value><array><data>

+ 

+       <value><int>1346249</int></value>

+ 

+       </data></array></value>

+ 

+       </member>

+ 

+       </struct></value>

+ 

+       </param>

+ 

+       </params>

+ 

+       </methodCall>

+ 

+       '

+     headers:

+       Accept: ['*/*']

+       Accept-Encoding: ['gzip, deflate']

+       Connection: [keep-alive]

+       Content-Length: ['609']

+       Content-Type: [text/xml]

+       Cookie: [Bugzilla_login_request_cookie=uNkpqwYHWi]

+       User-Agent: [Python/Bugzilla]

+     method: POST

+     uri: https://bugzilla.redhat.com/xmlrpc.cgi

+   response:

+     body:

+       string: !!binary |

+         H4sIAAAAAAAAA+xdeXMbN5b/n58C8axG0gxvkZTE2PLasuxoYydeHZtJpVIssBske9SXgW5JnKnZ

+         z7L7Wbb2e+17APpgHxSPVqLxSqnIUjfw8PDwTuAn8OXre8cmt4wLy3Nfveg02y8Icw3PtNzpqxfX

+         V+8bRy9en7x0WDDzzAsmfM8V7OSlTzl1hP735OUttUN4KgIeGgG2dsaMn7x0qcNOJjS0A/GyJX+J

+         WlLO6fzkpUkDSlonL1v695Z+3YooLFAah9MldJZz4XPL41Ywz/SHtjDRk9AVPjOsicXMly397AFm

+         jMnIoAGberyEZqPRWJXW2PaMm0pEZHBGA48Xc/SJ8sByyffc+hu7WZU3m4pgZMyoO2WjwHJYhjSw

+         x67gcdMS3tGg3TnptjuD9nHn4KrTHXb6w37nZSvX5mHRercWD0YBo87WwrXEyDBG1DCYENbYzk5g

+         7Hk2o+4J8Bn9+BB7nuMwd5lKL1dFYAi08RaEUsJKew1WQjfIULHcACngP7+5sqysIINO76rTGUod

+         WV9BwBGMLLNg3p2D3qDbO15p9jQEl1bp5Nl9di10x0twLuT64uOQzILAF8NWy7mRpJsTZnqc+szz

+         bdb0+LSFfki0OBPoNM1xE3+vXV58/rRqf+47qf6NThP+GzS6zYnRPWgKbjShQe0dEwa3/AB8/pBc

+         qMZEgC4wMvE4AdF4DqyJSQIqbkTt/ZvLIdFDruwfUbmA/upOYzudKNSH417noI8uaHVrKFasg3av

+         0z8qo9OK7Dx68zub/1oTLlbZf7O4Rb4PbZNWbvuHneOrTm/Y7gy7T9H2N5h5qeF/psYNnTIwsVuL

+         3dVeLXzVah/ZlLnmsPbL/a/kFflMhaiTX77Bn99Ty4afG/jzD15AqO/blkEhfMHT19FThqOhndZ+

+         IfjsE3VDahMuRyMuYya8gi85HPl0fXlFrIA5gujxPzCXccuQDAxJxKwlCIzFIM8zyZ0VzAh1iecz

+         tyG8kBuMQPzzwbSBl6gdtDCJw1ggagS/vGDGOLHZVDLzJbQ4kxGTUEFMNrFcoAzuFVrpRoIZ6CuI

+         N9FcgPAUqQ+hZTIbeoim4vKjHhJyNTum4mvW0VvCG+AM3JcxY0K+pUaAYtHMNhVhkB8bktMZM25g

+         MKCA7U2i5gicTgKYwo7PmS9dou4smhEDeqoTMEFzSF58+PyR7N12CTaFFeH7L+rkxbV743p3Lj6c

+         oqhxqV40SedI8ijIjN4yRSbULSMeyeKSGJ4bUMsVxPXIGAa0gVPbGnPKLSCDi+SFAXn/+ZSwe4NJ

+         v67FdSozN9uboqhgNuj3x9Ab5gQi0o0u9aT1MMRz7TnxGXcslTLBC5PhLLABLGSzhDuTiZvA89UK

+         WBNQNlQmSj5cn0canGLtHbsFxnzUDC0PJxQBGTNklZKGie+jpV0cMQT5gyyCGS4dtN4xPUMuEweH

+         iM4kx6CwBHIO85J9HWpwT5A94BqSTBMVb0a52cCJmsQEhTXANc7V4qBli/1mzkrwuQnaZXgcyyUS

+         eFLdohY/UAef5jQ4em96ahKxboAZzZHXCQgqK2NvzOaCvP/usq6XGNef3TMDeJXm1woFbwWUT1nU

+         9XyyYBtyJThDpnG61FVWql/XQTnAyDn5cSwg9gRoAq6p5v+ZQzpu4hPID1CHEhW4UNaNqsNRZnXy

+         V1hDWUiROyDPwAth4k35PNK12ETRz7Cp1C+cwB2UZ7BEuJxvHHRL4HbO3KltiVmZvok5rJ5jSnJ7

+         Yl+qnCv9XsFigaCVjcEyaaeEnu3s3rBDk73hxgyynWnkZVCQsEJGiOoptVZp59SLtBM0ToRjLb6m

+         7gERGbwSqLCAXElJb+8/O5/e7qP1uCEGDRS+VPcFR/RuYSjsjUx32t1em4znuBwwbC/qmBGHA6aF

+         vi6tf4uqt9hDhLIamoS2PZfdpfXhIoxDyzZxLKA1tlxYNoIJJXgEQkHlGBSD2sW7SMb3PY5pIiQ0

+         DralIEWIMOBvedYG0dKobQutZ3akDxe+AxxKRwHGKweybTUoTkYyhH3M0MiI7ErqF+ok1zQc1LQp

+         TGVPMHgTBNSYoVD3E4vYw1lK/2ZN9uUIOqrFZuJKfVCjY2TH9YKf1cjaP0tlA1WFkIYahatSx0YY

+         jWigf9dqKj3DA7TQdWVsVfMhQ9xOHLoWRMoj41uwZCGpRS4M9QLcMDq9TG+pzsg9yjvdXE4B+sj8

+         sNxrRRMXJDMcvAC2x/MMW5rOGxhNLarJIKkwmWtY2rXY6KPlhN9ig8i3xB5PliaudsqSy8VeKME4

+         /onCpKLcG8uwwCzJ8s7fJYfc84J/4Oz+Beqv0dvr84/vRhc//nhVIhBUX+6QBp8sEtjLU9hHa4oV

+         YQxe0JV6AqzuaEPR7H1SgQpmdxk6aGN1CHZJ9Qbz9UGjqXSiAZGFopJuKgy+Awmhb0O1WnTfuTlE

+         GYAZqmit/M7OgtvReQGK2ItUABdCsCBr3Cnhkh2H3jA9OWWBd2gw+DRyDuTd2eXVu/OLV81mU/Lk

+         7mp3c+fxm7IAHAopOqQINLw7ePTm8vT8nBgQ0iH3Y7xUh5EvKslofbJB5805SBVElu2lgwiHpAUk

+         gyLPpE8hZszoONUCpOxZZqPySehDacCoo91OHVJiNUNfBdlYkYXeM8iFTcmtNN6EqmwcDbbzd2zy

+         j3pESaV6ahT9Tm4raMrvI6JqFaGksEwiN34X56/TMxSB3imQKw/ZKFhMS/DbOml5YKWg7TIXQSnZ

+         tdrnOSSnblRiyF8Im05T1ExwGLYHSRimPwtOwQx55D2lTGNJYfSK/Ek877uZBeKw9DqA/8mkOOTW

+         ohjxYXQMcIxPKPh9McOQvbAGusXEy3pMrHBKQ+xwqGZXkqu8vRgSXzbo6swWBKUeHKgHquNbFXUT

+         EY3R0TverQ4FWJFEFd3ldz9ef3y3rKbTOWAmxsX6r4NMXMdhjMJ4RDFXFAx39wPtpKTuTbjnxCpc

+         T6s4j5j5EjJgP1bzwIsHsdDrfCM1zoVyzI+zSojIcSiTjoRCcpEJ4bn8exK6hvLzsqjUdU2cvoHn

+         CqJjDen3VLdsYrhUElrDIzkszj4uYhJfjBMRyktHwUeUV6iRZuhwxqkrbKr6YKBLkqsfPLehE2Go

+         Ld1piMZYx2SX3lLLTjmiOL+TOh1ldkliV5zXgd+NB1PMpNO4yM52DCyVUyFEksXOKGoUsDTJb9IO

+         Q/MRwGgwruzHb5kMTeDvHV9gwIOkYSoVQgeBiImCVJfXyX+Ad/Dg38+cQX5QJ6eePwcCMxng4hFx

+         RVUdGcs7U+mCHxiz2PVgQYyLe31xLkOtbDVEklGZgzsqoOTRjFC7ZMRIr22cPBPHM6Jw9TZKBKL4

+         ocW3uGIzKmv7HQO3/eLMRe6+lKQUSkjZvEJR/cFTKpYkiGEg0LGBuFssMMBTgxLAd6H+QXed/IQP

+         FyLbX1TtiDEYXV4mKMnYPrW9sV5CXU7vqI0eiA+wjCIpC5uR8zr7y9XFm2W+q7gyiLUklVhuWhTU

+         anqMWkN91aL9oCEp3kLvNl0PrUPuopP4q6xxtN+e7Oer7kNyNiTKcTT07k1DzNgYrFsuULKB34Ks

+         KgCGRNOfN9k9GA2o8lrk5JJCJsRSRKnNnLFlNKE6KSD20xB0seHIzcSGD7JrgENqRG4jal7rJhUH

+         uoK2tDXlMqWvYOa3pEsY5x4Hd9Uhd5S7cia4JRlJXm3BLC7ofrQchV9fpzA72wgzqpRqeRmRPWkH

+         4zr58PH87Sn6Bch8mLk/lOobmX5Lpyby4YSZjlD7r+rxHh1b+6nfG3rK6UcTm4qb3IOG7YFzzz8G

+         /oJJaOdfiC82tWHGzjz/7i6YpB/qA4P0I2HdL/xaSAzIQEYsUHDRzlaB4JR8kgWCr0u9/43rAXFe

+         5NS0Fh3PfaEyo2sathea0SEd9/4Kfl2e0kENwSgUnCktyrqQZkB5c/o3gnycfnd2+v3l9ae9y+/e

+         dPsD3LdIUhrpgIbkaEIZ6/XHg/74sMe68P8hM9oDOu7TntE7PO4cHQw6tHt80Osag/Zhr9s7nnQm

+         x0Z7PO6Z7e6kaJg4i4uGqmCYWu1Un58nQm9E+4jqlAACaPrUoBncx4WpGMa8QAjR+V2TXMqwDNWi

+         jPq4NwpF5R+nwbevMMu2gl0RRy9VeWJgxS0sTeE1OaUYx6KEAeMHBpt4e1N2UARrwO4nLIDlqQGH

+         wgkrTJmzQWi/BY5lzZLkOJi1RwWujuxIA1LzAnekQi1uAlvTkKvdQBnLIdvADacoAxmzVCSEEaSj

+         +1N8FBCTE+FkYt0/3qHtdod5xYe2/W6v0z6s4ND2qN/ulNJ5aoe23QoObSn3oIi4Jf/7XzeU39JH

+         PLwdbITsefzD280lUHqIu3eO/si3ZRGTnA6rikGDgcgfOvs19A+kSsNWFB+07lrtDaQMeBgUym2p

+         qG5dcIquzvxddIhuOpP5U5O8sYVHgFl4D9+9Zr5vqjnZm3sh8ALuDA8wUSroXEHyIbChgqyEkET1

+         Z2pzeL/5+K5oM9Usd0XHFbii7nH78LjUwp+aKzp46vCxw27/qtMetg+HCMp5cl6oYvjYeg4ogzmR

+         zzLAE/lMfY8gKPKX7XEoikw5GCU1cvp7CUAl1SLeGogYrQivIslVCFpJ6KVPmhKmK4CvJENsj2FJ

+         aG0PZElo5dEs+VXbCNKSkHkI15K0XB/csoTZlREuCY31YC75sR/GuhTyuyHgJVnECPVSaHDrQ1/y

+         ZB7Cv+R7rAeCSfpXgYRJBFMMh0lGWwsTk9LTjYAxS3R1GTqmeFFXhcik3FklOJlEtkvAMlm3tx5i

+         pkhOK8Bm8t22w86kws0KAJqCVcqjaFKKtx6UJivQtbbOF4xrc1BNwkNFyJpCgivDa/ICXxtjkyex

+         OtBmiY9cH22TEKsAcpOItQLcTUmMWxF8s0RImyBwkpmVwHCS8bbE4qRSgiJAzpJ5LUflpDquBs0p

+         lP/G+JxEgAqksyRfWAmps0QOD8F1SqPaAmYnnxpuCtxJpl6O3ikK8JtCeJLxFnE8yRjLwDw56WyG

+         6EkVZRG2J0V5S4DPgkQVyiflx6qB+uRWLYX3KfDeq4F+luRhKyB/kt4rwX9ylXMBEGh57VwJLihV

+         PFYCDlLsbYMQyq9CGUwoncKWY4WW+KINAEPpmnBr1FAqIm8JHSrIcTfHDyVsZUBEySirIYkSZdga

+         TrSop0VxYitgUcFWw8roonTVuAnEKOU4ynBG+eXdAGyUiDCHOEroVwE7ygqzCHuUCalrA5By7jMP

+         RVruPVdHJm1fY6W/R2glddCkD8/lL2vhlhKmyALGoQS8JJuvgZJRHVZA3qxL+GH4TQnFFTE4svfm

+         qKaSve2FpSuGO6XXsxjz9P9rDTYHQ5VJPwJILUg6w+oSqFRsMTm8VPxGg6bi39PIqczDGD6Vfa4w

+         VIVPNZCq+F2Epip+m0JBFTdAXFX2TQSuyj5HhFXuWfkAEdaqZF1i/NWydUmJP6Mn+e85iFahaamn

+         VYK1FMUYsqUZXgG3pZpujaoqGzCP4KpywPT3GNVVsJTV4bsUvUpBXoseYgHppab3M6OzukzFduXu

+         LiK8PMgwm+QntXOSmwzmGmqHMHX244fc94TeOtRRQB/p4GU34BaZe9usRRLbGmKWWpvfBZNyBTRu

+         RLz3qs6Bv6nVrn1TXi2iV2VY+/1vRzlYuB3lEREqW8EWShAqvf7R0Vr3/XwNN5z0nvQNJ0fdg6tO

+         f3hwMEQwyZODpzzfcPJ8w8kSdMjz1SPPV488Xz3ylV898nyDyPMNIs83iDzfIPJ8g8jzDSLPN4g8

+         3yDyz3ODyP02N4ikzpOfbxB5vkHk+QaR5xtEfrsbRA7WuUHk4KEbROSBqtvAoh2XqmG5DViYJWe+

+         j3vTRzs+j+0+4k0fv+GkVzmELp30840czzdy/NPcyFF0Icc51GUggBl5L0XVPdD7xamDS9zJw8J/

+         oQjHTCxUpaj+S3AwxtAHS4xLtPNdB1bRYNYtusnaLxiQ/vUL80Sjc9DPOcJf/5BCaNSuoBxjY5g7

+         2XM8EUg64FoMpIufVCKNSNYjL2JDiru/qBPMs8mxLGz+aAffOp4Z2gxPNKVuYSAfAT0+H/keuKy9

+         3bjvq1eKnd062cU9Xc9mI5W3CXwUt9vd39tfZAFMPbLl5mFLQLhqRI6l5d9MR9BVpRSt0chyrWA0

+         AmFFrPb7R5LZLGfaFCC9csmUBSPTwvOYcYhBfw9/2W/mJjPlXujXZaFWJYvdwVH3QR6ZL/mpVDbd

+         g34/Hjg9mGD2pIld7VtW8YiDTl3BFyRxOajSIfKKQAcHc+DRaE9yoF6MUN51mRziPtOrX3ZH8tFo

+         tPsrkEWn9KqdMClTtNYYl7AJY4b3jfujwWjQa0E5l/JNBcwd9YvU+icVlYbkZy+U29OYR6uP81En

+         R77fhGQRJDe6YXMiD/c00AA3TNVlNW8cck4cDUgQHn4YFPz0mtTwHhvDl1Yfww9Ufitvhmj4xFOF

+         TXHy/oiXQWx3BFt81D7oddqDte5G+Brupek/9csgjrq9q/bREIEV3Sd42l7xZRAFdnx5dnpxdjX6

+         /uznGJdTmAtjl9h69d66RPpAoYUf0taE2geymDED47XAC0a2DK5gTMd40KPGS7Zm4P10VoeyNYjw

+         UXp/U314kLdQ3KpD+0e1+W0Uoczme4f9ta5m+hrgNYMnDq+RMKruYNg7eIIGXyW85scbaaEaR8fu

+         fZu6CshA3oVMWRiYLKbUfigNnWByrE4Dk4rkUY1um8UoM7qj3vFacedrCLRrXTNVrC4gevIessHq

+         g+xxe3DV7Qw7vWG3/QRtbv2Jb3nb0kCj+qsyUEiyhQgddVhFA9lBHjFB2ix7zTEgR8NryAueV+K+

+         Ku6c4+7mwiaECrd1jQvBK9vweFXtfDQ0gA7Y2/3zLiQFyVY0Z46GHOhTsmSv+8bCXS+o+yevH8+f

+         bKdoJf7kqNc9qCJxbx/3u6Wx8an5k9JsY3V/8uFu7pJTiwm7+ii+3WfEPrpH2WTqD6Jk8TgFD37w

+         sGbMmIvlN8eD2QS7Tk1wAgUblP7NFLJ5bdytRRz7I1rjVotUbI2H7W6/iuiODA5KP+oyZ40t9cm8

+         q32O8g2b33ncrOYzmY3VPin4odwx03KFm04Xe3xPHcsmn//nvzm1H2q7COt+qPWy6LuO1ENuF9qP

+         lPVySxbCmrrMHAVeVUm53C6tRAEEYyNqiyxnmynTZCSPMOSBSUUfkL2tG93mo37bGwT5O4QWjD3K

+         s4yvqi1f6EhiJ4wSd63OPMjZfcDBUf97SG0rmBNM0Dh1DbaqYNXJiBh5bkUrz9mUMwmcG4mABmFW

+         O9dfe9MzxFJZPCzMFJbw+dOvU4uFBPVJyPbrJA8cwlIZP7xKho0ucqL/DGKZ2q/KEhgFrSY+Tkag

+         hqNg7medh2bkfIJweKH/3Kcu6xiqjipWZdbzR2JesgzXLqqZhJassbwGL/a8Dy+F+kuJkT5xXj03

+         KFaXdeLrMqfxw9lPa8y+fLHehtM16Cz8mcOIGuXKuYaxaARdMR2V0ci/HoFMPIXSkX+l/IAvWJUD

+         KAQYd6k9gjKlKhtxsMxbIvh1Ij7EJAhNJZVnZ+XK07epRG5UZleC3TIOsbaYYLg+wYlNly3A8hrd

+         8czYY47MfKleXjK1D4ft7rC/yQaGkFZwmx1L5mTrZWO/EcfLnMqfVy6dQa2Lq7zBapUifivmYWHH

+         a6ucuHt43D1or7YKeOzGtjkg2K5+BX/B3FuLey561w0DlQY/rx6hOIXU3CwKyuvwHiw12TV8puf4

+         npuf/pIJPFT2rrsGE+sealJr06QNnEG0A0Ll39vhXyxu77UVsqOKHFCnMg6iIgOQdRWRSV5HwR2W

+         tcD1JyorJplkjVwvYMU+aoXUeTLCqIRhZzTGAnC2OqG1rTjfQV4AEv0rZNNg5pmQq4B2C3byfwAA

+         AP//AwDy89Q9wo0AAA==

+     headers:

+       connection: [close]

+       content-encoding: [gzip]

+       content-type: [text/xml]

+       date: ['Thu, 20 Apr 2017 17:44:59 GMT']

+       server: [Apache]

+       soapserver: ['SOAP::Lite/Perl/1.11']

+       vary: ['Accept-Encoding,User-Agent']

+       x-content-type-options: [nosniff]

+       x-frame-options: [SAMEORIGIN]

+       x-xss-protection: [1; mode=block]

+     status: {code: 200, message: OK}

+ - request:

+     body: !!python/unicode 'issue_content=%7B%0A+%22description%22%3A+%22%22%2C+%0A+%22repo%22%3A+%22resultsdb%22%2C+%0A+%22comaintainers%22%3A+%5B%5D%2C+%0A+%22ticket%22%3A+%221346249%22%2C+%0A+%22branches%22%3A+%5B%0A++%22master%22%0A+%5D%2C+%0A+%22monitor%22%3A+%22monitoring-with-scratch%22%2C+%0A+%22namespace%22%3A+%22rpms%22%2C+%0A+%22summary%22%3A+%22Results+store+for+automated+tasks%22%2C+%0A+%22koschei%22%3A+false%2C+%0A+%22action%22%3A+%22new_repo%22%2C+%0A+%22upstreamurl%22%3A+%22%22%0A%7D&title=New+Repo+for+%22rpms%2Fresultsdb%22'

+     headers:

+       Accept: ['*/*']

+       Accept-Encoding: ['gzip, deflate']

+       Authorization: [token 1234]

+       Connection: [keep-alive]

+       Content-Length: ['518']

+       Content-Type: [application/x-www-form-urlencoded]

+       User-Agent: [python-requests/2.13.0]

+     method: POST

+     uri: http://127.0.0.1:5000/api/0/pkgdb-tickets/new_issue

+   response:

+     body: {string: !!python/unicode "{\n  \"issue\": {\n    \"assignee\": null, \n\

+         \    \"blocks\": [], \n    \"close_status\": null, \n    \"closed_at\": null,\

+         \ \n    \"comments\": [], \n    \"content\": \"{\\n \\\"description\\\": \\\

+         \"\\\", \\n \\\"repo\\\": \\\"resultsdb\\\", \\n \\\"comaintainers\\\": [],\

+         \ \\n \\\"ticket\\\": \\\"1346249\\\", \\n \\\"branches\\\": [\\n  \\\"master\\\

+         \"\\n ], \\n \\\"monitor\\\": \\\"monitoring-with-scratch\\\", \\n \\\"namespace\\\

+         \": \\\"rpms\\\", \\n \\\"summary\\\": \\\"Results store for automated tasks\\\

+         \", \\n \\\"koschei\\\": false, \\n \\\"action\\\": \\\"new_repo\\\", \\n\

+         \ \\\"upstreamurl\\\": \\\"\\\"\\n}\", \n    \"custom_fields\": [], \n   \

+         \ \"date_created\": \"1492710299\", \n    \"depends\": [], \n    \"id\": 36,\

+         \ \n    \"last_updated\": \"1492710299\", \n    \"milestone\": \"\", \n  \

+         \  \"priority\": null, \n    \"private\": false, \n    \"status\": \"Open\"\

+         , \n    \"tags\": [], \n    \"title\": \"New Repo for \\\"rpms/resultsdb\\\

+         \"\", \n    \"user\": {\n      \"fullname\": \"Matt Prahl\", \n      \"name\"\

+         : \"mprahl\"\n    }\n  }, \n  \"message\": \"Issue created\"\n}"}

+     headers:

+       content-length: ['903']

+       content-type: [application/json]

+       date: ['Thu, 20 Apr 2017 17:45:00 GMT']

+       server: [Werkzeug/0.11.10 Python/2.7.13]

+       set-cookie: ['pagure=eyJfcGVybWFuZW50Ijp0cnVlfQ.C9qFHA.ce7Pste6IRxNh5FMamV9UHfyPNM;

+           Expires=Sun, 21-May-2017 17:45:00 GMT; HttpOnly; Path=/']

+     status: {code: 200, message: OK}

+ version: 1

@@ -0,0 +1,239 @@ 

+ interactions:

+ - request:

+     body: !!python/unicode '<?xml version=''1.0''?>

+ 

+       <methodCall>

+ 

+       <methodName>Bugzilla.version</methodName>

+ 

+       <params>

+ 

+       <param>

+ 

+       <value><struct>

+ 

+       </struct></value>

+ 

+       </param>

+ 

+       </params>

+ 

+       </methodCall>

+ 

+       '

+     headers:

+       Accept: ['*/*']

+       Accept-Encoding: ['gzip, deflate']

+       Connection: [keep-alive]

+       Content-Length: ['161']

+       Content-Type: [text/xml]

+       User-Agent: [Python/Bugzilla]

+     method: POST

+     uri: https://bugzilla.redhat.com/xmlrpc.cgi

+   response:

+     body:

+       string: !!binary |

+         H4sIAAAAAAAAA1yOwQ6CMBBEf4X0bpcaNB6W5cYHGPyAChsloS1pC+HzRdMa42mzMy8zg81mpmJl

+         H0Zna6FkKQq2vRtG+6jFrWsPF9EQGo5PN1w5zM4GJpy11yakS7jqadnVEP3Sxzdt7uwJrTZMKRvh

+         8/2gewNVspLqWJ5PUiEkDSExkHMgB3+d1At5B/wNfAEAAP//AwD2noGt1wAAAA==

+     headers:

+       connection: [close]

+       content-encoding: [gzip]

+       content-type: [text/xml]

+       date: ['Thu, 20 Apr 2017 17:50:31 GMT']

+       server: [Apache]

+       set-cookie: [Bugzilla_login_request_cookie=CB8PZXi4vi; domain=bugzilla.redhat.com;

+           path=/; HttpOnly]

+       soapserver: ['SOAP::Lite/Perl/1.11']

+       vary: ['Accept-Encoding,User-Agent']

+       x-content-type-options: [nosniff]

+       x-frame-options: [SAMEORIGIN]

+       x-xss-protection: [1; mode=block]

+     status: {code: 200, message: OK}

+ - request:

+     body: !!python/unicode '<?xml version=''1.0''?>

+ 

+       <methodCall>

+ 

+       <methodName>Bug.get</methodName>

+ 

+       <params>

+ 

+       <param>

+ 

+       <value><struct>

+ 

+       <member>

+ 

+       <name>extra_fields</name>

+ 

+       <value><array><data>

+ 

+       <value><string>comments</string></value>

+ 

+       <value><string>description</string></value>

+ 

+       <value><string>external_bugs</string></value>

+ 

+       <value><string>flags</string></value>

+ 

+       <value><string>tags</string></value>

+ 

+       <value><string>sub_component</string></value>

+ 

+       </data></array></value>

+ 

+       </member>

+ 

+       <member>

+ 

+       <name>ids</name>

+ 

+       <value><array><data>

+ 

+       <value><int>1346249</int></value>

+ 

+       </data></array></value>

+ 

+       </member>

+ 

+       </struct></value>

+ 

+       </param>

+ 

+       </params>

+ 

+       </methodCall>

+ 

+       '

+     headers:

+       Accept: ['*/*']

+       Accept-Encoding: ['gzip, deflate']

+       Connection: [keep-alive]

+       Content-Length: ['609']

+       Content-Type: [text/xml]

+       Cookie: [Bugzilla_login_request_cookie=CB8PZXi4vi]

+       User-Agent: [Python/Bugzilla]

+     method: POST

+     uri: https://bugzilla.redhat.com/xmlrpc.cgi

+   response:

+     body:

+       string: !!binary |

+         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

+         AP//AwDy89Q9wo0AAA==

+     headers:

+       connection: [close]

+       content-encoding: [gzip]

+       content-type: [text/xml]

+       date: ['Thu, 20 Apr 2017 17:50:32 GMT']

+       server: [Apache]

+       soapserver: ['SOAP::Lite/Perl/1.11']

+       vary: ['Accept-Encoding,User-Agent']

+       x-content-type-options: [nosniff]

+       x-frame-options: [SAMEORIGIN]

+       x-xss-protection: [1; mode=block]

+     status: {code: 200, message: OK}

+ version: 1

@@ -0,0 +1,34 @@ 

+ interactions:

+ - request:

+     body: !!python/unicode 'issue_content=%7B%0A+%22action%22%3A+%22unretire%22%2C+%0A+%22repo%22%3A+%22some_package%22%2C+%0A+%22namespace%22%3A+%22rpms%22%0A%7D&title=Unretire+%22rpms%2Fsome_package%22'

+     headers:

+       Accept: ['*/*']

+       Accept-Encoding: ['gzip, deflate']

+       Authorization: [token 1234]

+       Connection: [keep-alive]

+       Content-Length: ['175']

+       Content-Type: [application/x-www-form-urlencoded]

+       User-Agent: [python-requests/2.13.0]

+     method: POST

+     uri: http://127.0.0.1:5000/api/0/pkgdb-tickets/new_issue

+   response:

+     body: {string: !!python/unicode "{\n  \"issue\": {\n    \"assignee\": null, \n\

+         \    \"blocks\": [], \n    \"close_status\": null, \n    \"closed_at\": null,\

+         \ \n    \"comments\": [], \n    \"content\": \"{\\n \\\"action\\\": \\\"unretire\\\

+         \", \\n \\\"repo\\\": \\\"some_package\\\", \\n \\\"namespace\\\": \\\"rpms\\\

+         \"\\n}\", \n    \"custom_fields\": [], \n    \"date_created\": \"1492629392\"\

+         , \n    \"depends\": [], \n    \"id\": 31, \n    \"last_updated\": \"1492629392\"\

+         , \n    \"milestone\": \"\", \n    \"priority\": null, \n    \"private\":\

+         \ false, \n    \"status\": \"Open\", \n    \"tags\": [], \n    \"title\":\

+         \ \"Unretire \\\"rpms/some_package\\\"\", \n    \"user\": {\n      \"fullname\"\

+         : \"Matt Prahl\", \n      \"name\": \"mprahl\"\n    }\n  }, \n  \"message\"\

+         : \"Issue created\"\n}"}

+     headers:

+       content-length: ['638']

+       content-type: [application/json]

+       date: ['Wed, 19 Apr 2017 19:16:32 GMT']

+       server: [Werkzeug/0.11.10 Python/2.7.13]

+       set-cookie: ['pagure=eyJfcGVybWFuZW50Ijp0cnVlfQ.C9lJEA.5dhdh5O1Nq9JsmPvKc-1WmJh1pQ;

+           Expires=Sat, 20-May-2017 19:16:32 GMT; HttpOnly; Path=/']

+     status: {code: 200, message: OK}

+ version: 1

file added
+101

@@ -0,0 +1,101 @@ 

+ # -*- coding: utf-8 -*-

+ #

+ # This file is part of fedrepo_req.

+ # Copyright © 2017 Red Hat, Inc.

+ #

+ # This program is free software; you can redistribute it and/or modify

+ # it under the terms of the GNU General Public License as published by

+ # the Free Software Foundation; either version 2 of the License, or

+ # (at your option) any later version.

+ #

+ # This program is distributed in the hope that it will be useful,

+ # but WITHOUT ANY WARRANTY; without even the implied warranty of

+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

+ # GNU General Public License for more details.

+ """

+ pytest tests for the app

+ """

+ from __future__ import absolute_import

+ from click.testing import CliRunner

+ from os import path

+ import vcr

+ from mock import patch

+ from six.moves import configparser

+ from six.moves import StringIO

+ 

+ from fedrepo_req.fedrepo_req import cli as fedrepo_req_cli

+ from fedrepo_req.fedrepo_req_branch import cli as fedrepo_req_branch_cli

+ from fedrepo_req.fedrepo_req_unretire import cli as fedrepo_req_unretire_cli

+ 

+ 

+ CASSETTES_DIR = path.join(path.abspath(path.dirname(__file__)), 'cassettes')

+ SAMPLE_CONFIG = ('[app]\npagure_api_token = 1234\npagure_url=http://127.0.0.1:'

+                  '5000\npagure_repo = pkgdb-tickets\n'

+                  'bugzilla_url = https://bugzilla.redhat.com')

+ 

+ 

+ @vcr.use_cassette(path.join(CASSETTES_DIR, 'repo_success.yaml'))

+ def test_fedrepo_req_package_cli():

+     """

+     Tests the basic usage of fedrepo-req

+     """

+     runner = CliRunner()

+     args = ['resultsdb', 'master', '-t', '1346249']

+     with patch('fedrepo_req.fedrepo_req.get_config') as mock_get_config:

+         config = configparser.ConfigParser()

+         config.readfp(StringIO(SAMPLE_CONFIG))

+         mock_get_config.return_value = config

+         result = runner.invoke(fedrepo_req_cli, args)

+     assert result.exit_code == 0

+     assert result.output == 'http://127.0.0.1:5000/pkgdb-tickets/issue/36\n'

+ 

+ 

+ @vcr.use_cassette(path.join(CASSETTES_DIR, 'repo_wrong_package_name.yaml'))

+ def test_fedrepo_req_wrong_package_name_cli():

+     """

+     Tests that an error is thrown when the package provided doesn't match the

+     one in the ticket

+     """

+     runner = CliRunner()

+     args = ['python', 'master', '-t', '1346249']

+     with patch('fedrepo_req.fedrepo_req.get_config') as mock_get_config:

+         config = configparser.ConfigParser()

+         config.readfp(StringIO(SAMPLE_CONFIG))

+         mock_get_config.return_value = config

+         result = runner.invoke(fedrepo_req_cli, args)

+     assert result.exit_code == 1

+     assert result.output == ('Error: The package in the ticket "resultsdb" '

+                              'doesn\'t match the one provided "python"\n')

+ 

+ 

+ @vcr.use_cassette(path.join(CASSETTES_DIR, 'branch_success.yaml'))

+ def test_fedrepo_req_branch_cli():

+     """

+     Tests the basic usage of fedrepo-req-branch

+     """

+     runner = CliRunner()

+     args = ['some_package', '2.7', 'dev']

+     with patch('fedrepo_req.fedrepo_req_branch.get_config') as mock_get_config:

+         config = configparser.ConfigParser()

+         config.readfp(StringIO(SAMPLE_CONFIG))

+         mock_get_config.return_value = config

+         result = runner.invoke(fedrepo_req_branch_cli, args)

+     assert result.exit_code == 0

+     assert result.output == 'http://127.0.0.1:5000/pkgdb-tickets/issue/30\n'

+ 

+ 

+ @vcr.use_cassette(path.join(CASSETTES_DIR, 'unretire_success.yaml'))

+ def test_fedrepo_unretire_cli():

+     """

+     Tests the basic usage of fedrepo-unretire-branch

+     """

+     runner = CliRunner()

+     args = ['some_package']

+     with patch('fedrepo_req.fedrepo_req_unretire.get_config') as \

+             mock_get_config:

+         config = configparser.ConfigParser()

+         config.readfp(StringIO(SAMPLE_CONFIG))

+         mock_get_config.return_value = config

+         result = runner.invoke(fedrepo_req_unretire_cli, args, input='y\n')

+     assert result.exit_code == 0

+     assert 'http://127.0.0.1:5000/pkgdb-tickets/issue/31\n' in result.output

file added
+30

@@ -0,0 +1,30 @@ 

+ # Tox (http://tox.testrun.org/) is a tool for running tests

+ # in multiple virtualenvs. This configuration file will run the

+ # test suite on all supported python versions. To use it, "pip install tox"

+ # and then run "tox" from this directory.

+ 

+ [tox]

+ envlist = lint, py26, py27, py33, py34, py35, py36

+ # If the user is missing an interpreter, don't fail

+ skip_missing_interpreters = True

+ 

+ [testenv]

+ # Workaround for testing Click in Tox on Python 3

+ setenv =

+     LC_ALL = en_US.UTF-8

+     LANG = en_US.UTF-8

+ deps =

+     mock

+     pytest

+     vcrpy

+ whitelist_externals =

+     find

+ commands =

+     find . -name *.pyc -delete

+     py.test tests/

+ 

+ [testenv:lint]

+ deps =

+     flake8 > 3.0

+ commands =

+     python -m flake8 {posargs}

This pull request is the initial code addition for CLI tools to replace PkgDB's package request features.

About the code:
There are a couple of parameters in the fedrepo_req.py that I have "TODOs" on top of that I'm not sure still apply in the new world of Pagure over dist-git. Please provide comments on those.

@ralph, can you please comment on the parameters that have "TODOs" on top of them?

This still makes sense.

When requesting a new repo, you'll want these people to have commit on that repo out of the box.

We don't have a place to put this, but we might as well copy it to the ticket for the cvsadmin human to review.

Nope. This is going to move into koschei.

rebased

2 years ago

Pull-Request has been merged by mprahl

2 years ago