1054472 - Fix deleting multiple SRPMs

Adds Action.data column and fills it with SRPM list rather than
mis-using 255 long new_value column.

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[tests] return exit code from manage.py test

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[tests] fix https and repo generation

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[frontend] 1054474 - drop Copr.build_count nonsense

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[frontend] rename MockChroot.chroot_name to .name

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[frontend] rename active_mock_chroots to active_chroots

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[frontend] 1050904 - monitor shows not submitted chroots

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
remove useless comments

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[frontend] allow GET on repeat_build

Drops TODO message, intersection of active chroots
is not what we want as we want to repeat build
with all active chroots currently assigned to this copr.

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[frontend] allow resubmitting builds from monitor

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[frontend] fix BuildsLogic.new not assigning copr to build

Clap clap.

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[cli] fix initial_pkgs and repos not sent to backend

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[api] fix validation error handling

Now it doesn't results in KeyError['name'] when
validation of initial_pkgs fails.

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[frontend] remove BuildLogic.new, use BL.add only

- fixes permission checking when repeating builds
- fixes api calling nonexistent method

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[frontend] permission checking is done in BuildLogic.add

To achieve a bit of consistency.

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[tests] add test for build resubmission

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[tests] add test for BuildLogic.add

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
[frontend] - do not throw ISE when build_id is malformed

addressing:
Exception on /api/coprs/build_status/h/ [GET]
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1687, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1358, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1344, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/share/copr/coprs_frontend/coprs/views/misc.py", line 100, in decorated_function
    return f(*args, **kwargs)
  File "/usr/share/copr/coprs_frontend/coprs/views/api_ns/api_general.py", line 184, in build_status
    build = builds_logic.BuildsLogic.get(build_id).first()
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2282, in first
    ret = list(self[0:1])
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2149, in __getitem__
    return list(res)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2353, in __iter__
    return self._execute_and_instances(context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2368, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 662, in execute
    params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 761, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 874, in _execute_context
    context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1024, in _handle_dbapi_exception
    exc_info
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 196, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 867, in _execute_context
    context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 324, in do_execute
    cursor.execute(statement, parameters)
DataError: (DataError) invalid input syntax for integer: "h"
LINE 3: WHERE build.id = 'h'
                         ^
 'SELECT build.id AS build_id, build.pkgs AS build_pkgs, build.canceled AS build_canceled, build.repos AS build_repos, build.submitted_on AS build_submitted_on, build.started_on AS build_started_on, build.ended_on AS build_ended_on, build.results AS build_results, build.memory_reqs AS build_memory_reqs, build.timeout AS build_timeout, build.user_id AS build_user_id, build.copr_id AS build_copr_id \nFROM build \nWHERE build.id = %(id_1)s \n LIMIT %(param_1)s' {'id_1': u'h', 'param_1': 1}
use experimental createrepo_c to get rid of lock on temp files

see:
https://github.com/Tojaj/createrepo_c/issues/2#issuecomment-33373406
disable test on i386

because otherwise python will not like that we use in test numbers higher then sys.maxint on i386