[copr/copr] branch master updated (460eae6 -> 43d115f)
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
msuchy pushed a change to branch master
in repository copr/copr.
from 460eae6 the %copr_username isn't defined on copr builders
add 43d115f frontend, backend: send `uses_devel_repo' as a part of task info
No new revisions were added by this update.
Summary of changes:
backend/backend/job.py | 1 +
backend/backend/mockremote/__init__.py | 4 +---
frontend/coprs_frontend/coprs/views/backend_ns/backend_general.py | 1 +
3 files changed, 3 insertions(+), 3 deletions(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 6 months
[copr/copr] branch master updated (cf4cfc3 -> 460eae6)
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
frostyx pushed a change to branch master
in repository copr/copr.
from cf4cfc3 frontend: python3-flask-script removal
add 460eae6 the %copr_username isn't defined on copr builders
No new revisions were added by this update.
Summary of changes:
rpmbuild/copr_rpmbuild/builders/mock.py | 5 ++++-
rpmbuild/mock.cfg.j2 | 2 ++
rpmbuild/tests/test_mock.py | 5 ++++-
3 files changed, 10 insertions(+), 2 deletions(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 6 months
[copr/copr] branch master updated: frontend: python3-flask-script
removal
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
frostyx pushed a commit to branch master
in repository copr/copr.
The following commit(s) were added to refs/heads/master by this push:
new cf4cfc3 frontend: python3-flask-script removal
cf4cfc3 is described below
commit cf4cfc348e57f7fe3d8510d255c599c0489c92f5
Author: Tomas Hrnciar <thrnciar(a)redhat.com>
AuthorDate: Tue Oct 15 09:29:37 2019 +0200
frontend: python3-flask-script removal
commands/test.py - done
Merges: #1069
---
frontend/copr-frontend.spec | 2 ++
frontend/coprs_frontend/commands/test.py | 62 +++++++++++++++-----------------
frontend/coprs_frontend/manage.py | 19 ++++++----
frontend/run_tests.sh | 2 +-
4 files changed, 44 insertions(+), 41 deletions(-)
diff --git a/frontend/copr-frontend.spec b/frontend/copr-frontend.spec
index 2a15142..55df011 100644
--- a/frontend/copr-frontend.spec
+++ b/frontend/copr-frontend.spec
@@ -69,6 +69,7 @@ BuildRequires: python3-devel
BuildRequires: fedora-messaging
BuildRequires: libmodulemd < 2
BuildRequires: libmodulemd >= 1.7.0
+BuildRequires: python3-click
BuildRequires: python3-CommonMark
BuildRequires: python3-blinker
BuildRequires: python3-copr-common > 0.4
@@ -120,6 +121,7 @@ Requires: js-jquery1
Requires: js-respond
Requires: libmodulemd < 2
Requires: libmodulemd >= 1.7.0
+Requires: python3-click
Requires: python3-CommonMark
Requires: python3-alembic
Requires: python3-blinker
diff --git a/frontend/coprs_frontend/commands/test.py b/frontend/coprs_frontend/commands/test.py
index b2ef159..5d5fed4 100644
--- a/frontend/coprs_frontend/commands/test.py
+++ b/frontend/coprs_frontend/commands/test.py
@@ -1,37 +1,31 @@
import argparse
import os
import subprocess
-from flask_script import Command, Option
-
-
-class TestCommand(Command):
-
- def run(self, coverage, test_args):
- os.environ["COPRS_ENVIRON_UNITTEST"] = "1"
- if not (("COPR_CONFIG" in os.environ) and os.environ["COPR_CONFIG"]):
- os.environ["COPR_CONFIG"] = "/etc/copr/copr_unit_test.conf"
-
- if 'PYTHONPATH' in os.environ:
- os.environ['PYTHONPATH'] = os.environ['PYTHONPATH'] + ':.'
- else:
- os.environ['PYTHONPATH'] = '.'
-
- additional_args = test_args
-
- if coverage:
- additional_args.extend([
- '--cov-report', 'term-missing', '--cov', 'coprs'
- ])
-
- return subprocess.call(["/usr/bin/python3", "-m", "pytest"] + additional_args)
-
- option_list = (
- Option("-a",
- dest="test_args",
- nargs=argparse.REMAINDER),
- Option("--coverage",
- dest="coverage",
- required=False,
- action='store_true',
- default=False),
- )
+import click
+
+(a)click.command(context_settings=dict(
+ ignore_unknown_options=True,
+))
+(a)click.argument("arguments", nargs=-1, type=click.UNPROCESSED)
+(a)click.option("--coverage/--no-coverage",
+ default=False
+)
+
+def test(coverage, arguments):
+ os.environ["COPRS_ENVIRON_UNITTEST"] = "1"
+ if not (("COPR_CONFIG" in os.environ) and os.environ["COPR_CONFIG"]):
+ os.environ["COPR_CONFIG"] = "/etc/copr/copr_unit_test.conf"
+
+ if 'PYTHONPATH' in os.environ:
+ os.environ['PYTHONPATH'] = os.environ['PYTHONPATH'] + ':.'
+ else:
+ os.environ['PYTHONPATH'] = '.'
+
+ additional_args = list(arguments)
+
+ if coverage:
+ additional_args.extend([
+ '--cov-report', 'term-missing', '--cov', 'coprs'
+ ])
+
+ return subprocess.call(["/usr/bin/python3", "-m", "pytest"] + additional_args)
diff --git a/frontend/coprs_frontend/manage.py b/frontend/coprs_frontend/manage.py
index add5afb..3d5841c 100755
--- a/frontend/coprs_frontend/manage.py
+++ b/frontend/coprs_frontend/manage.py
@@ -5,14 +5,14 @@ import os
import sys
import pipes
import importlib
+import click
+import commands.test
+
from flask_script import Manager
from coprs import app
-commands = {
- # General commands
- "test": "TestCommand",
-
+commands_old = {
# Database commands
"create_sqlite_file": "CreateSqliteFileCommand",
"create_db": "CreateDBCommand",
@@ -57,11 +57,18 @@ if os.getuid() == 0:
sys.exit(1)
manager = Manager(app)
-for cmdname, clsname in commands.items():
+for cmdname, clsname in commands_old.items():
module = importlib.import_module("commands.{0}".format(cmdname))
cls = getattr(module, clsname)
manager.add_command(cmdname, cls())
+app.cli.add_command(commands.test.test, "test")
if __name__ == "__main__":
- manager.run()
+ # This is just temporary while migrating to flask script,
+ # values in arrays are already migrated parameters.
+ # Else part will be removed once migration is complete.
+ if sys.argv[1] in ['test']:
+ app.cli()
+ else:
+ manager.run()
diff --git a/frontend/run_tests.sh b/frontend/run_tests.sh
index a239427..d068b84 100755
--- a/frontend/run_tests.sh
+++ b/frontend/run_tests.sh
@@ -18,4 +18,4 @@ export PYTHONPATH="${PYTHONPATH+$PYTHONPATH:}$common_path"
export COPR_CONFIG="$(pwd)/coprs_frontend/config/copr_unit_test.conf"
cd coprs_frontend
-./manage.py test -a "$@"
+./manage.py test "$@"
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 6 months
[copr/copr] branch master updated (18be7dc -> 49953b2)
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
frostyx pushed a change to branch master
in repository copr/copr.
from 18be7dc add centos chroot logo
add 49953b2 docker: gathering facts get stucked when set to True
No new revisions were added by this update.
Summary of changes:
docker/backend/files/root/.ansible.cfg | 2 ++
1 file changed, 2 insertions(+)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 6 months
[copr/copr] branch master updated (b28a2fe -> 18be7dc)
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
frostyx pushed a change to branch master
in repository copr/copr.
from b28a2fe backend, frontend, keygen, distgit: logrotate fix/sync
add 18be7dc add centos chroot logo
No new revisions were added by this update.
Summary of changes:
.../coprs_frontend/coprs/static/chroot_logodir/{epel.png => centos.png} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
copy frontend/coprs_frontend/coprs/static/chroot_logodir/{epel.png => centos.png} (100%)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 6 months
[copr/copr] branch master updated (bbe4b26 -> b28a2fe)
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
msuchy pushed a change to branch master
in repository copr/copr.
from bbe4b26 frontend: docs: external dnf isn't needed for modularity now
add b28a2fe backend, frontend, keygen, distgit: logrotate fix/sync
No new revisions were added by this update.
Summary of changes:
backend/copr-backend.service | 2 +-
backend/copr-backend.spec | 2 +-
backend/units/copr-backend-action.service | 2 +-
backend/units/copr-backend-build.service | 2 +-
backend/units/copr-backend-log.service | 2 +-
backend/units/copr-backend-vmm.service | 2 +-
backend/units/copr-backend.service | 1 +
dist-git/copr-dist-git.service | 2 +-
dist-git/copr-dist-git.spec | 1 +
frontend/copr-frontend.spec | 1 +
keygen/copr-keygen.spec | 2 +-
keygen/run/signd-copr.service | 2 +-
12 files changed, 12 insertions(+), 9 deletions(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 6 months
[copr/copr] branch master updated (ebef545 -> bbe4b26)
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
praiskup pushed a change to branch master
in repository copr/copr.
from ebef545 backend: get_redis_logger: skip log entries bellow log_level
new 00f9473 frontend: fix apiv2 for validation errors
new bbe4b26 frontend: docs: external dnf isn't needed for modularity now
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
frontend/coprs_frontend/coprs/rest_api/schemas.py | 7 +++--
frontend/coprs_frontend/coprs/rest_api/util.py | 2 +-
.../coprs/templates/coprs/detail/module.html | 30 ++++++----------------
.../tests/test_api/test_project_r.py | 16 ++++++++++++
4 files changed, 30 insertions(+), 25 deletions(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 6 months
[copr/copr] branch master updated: backend: get_redis_logger: skip
log entries bellow log_level
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
praiskup pushed a commit to branch master
in repository copr/copr.
The following commit(s) were added to refs/heads/master by this push:
new ebef545 backend: get_redis_logger: skip log entries bellow log_level
ebef545 is described below
commit ebef545062f886e146bf8d3327276a9fb3676e91
Author: Pavel Raiskup <praiskup(a)redhat.com>
AuthorDate: Sat Oct 12 14:18:39 2019 +0200
backend: get_redis_logger: skip log entries bellow log_level
The RedisLogHandler already reads and respects log_level option from
configuration (by default INFO), so we don't actually waste the space in
log files. But it is even useless to overwhelm redis server with
messages which are eventually not going to be printed to log file. So
from now, the "level" is respected also on log entry "sender" side (and
I personally think that we could respect the level _only_ on sender
side, and let the RedisLogHandler dump everything is received, ... maybe
next PR?).
This is reaction for magically disappearing log entries upon Worker
failure (exceptions should be logged, but are not). I suppose that the
redis server isn't ready to process all the log entries, and it leads to
obscure system states.
Merges: #1065
---
backend/backend/helpers.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/backend/backend/helpers.py b/backend/backend/helpers.py
index b2e4e2e..6329443 100644
--- a/backend/backend/helpers.py
+++ b/backend/backend/helpers.py
@@ -425,7 +425,9 @@ class RedisPublishHandler(logging.Handler):
def get_redis_logger(opts, name, who):
logger = logging.getLogger(name)
- logger.setLevel(logging.DEBUG)
+ level = getattr(opts, 'log_level', 'debug')
+ level = getattr(logging, level.upper(), logging.DEBUG)
+ logger.setLevel(level)
if not logger.handlers:
rc = get_redis_connection(opts)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 6 months
[copr/copr] branch master updated (c6d8bc7 -> 36b1f44)
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
msuchy pushed a change to branch master
in repository copr/copr.
from c6d8bc7 frontend: pagure-events fedora messaging support
add 36b1f44 backend: delete leftover action redis entries
No new revisions were added by this update.
Summary of changes:
backend/backend/worker_manager.py | 14 ++++++++++++--
backend/run/copr-backend-process-action | 23 +++++++++++++++++++----
2 files changed, 31 insertions(+), 6 deletions(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 6 months
[copr/copr] branch master updated: frontend: pagure-events fedora
messaging support
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
praiskup pushed a commit to branch master
in repository copr/copr.
The following commit(s) were added to refs/heads/master by this push:
new c6d8bc7 frontend: pagure-events fedora messaging support
c6d8bc7 is described below
commit c6d8bc7a1355aefffce43049f34f236e7437e45e
Author: Tomas Hrnciar <thrnciar(a)reedhat.com>
AuthorDate: Mon Sep 23 11:21:29 2019 +0200
frontend: pagure-events fedora messaging support
Adds support for listening pagure-events on fedora-messaging
and removes old zmq message bus.
It's necessary to update .toml file where log_config.handles.console
should look like this:
[log_config.handlers.console]
class = "logging.FileHandler"
formatter = "simple"
filename = "/var/log/copr-frontend/pagure-events.log"
[[bindings]]
queue = "00000000-0000-0000-0000-000000000003"
exchange = "amq.topic"
routing_keys = [
'io.pagure.prod.pagure.git.receive',
'io.pagure.prod.pagure.pull-request.new',
'io.pagure.prod.pagure.pull-request.rebased',
'io.pagure.prod.pagure.pull-request.updated',
'io.pagure.prod.pagure.pull-request.comment.added',
'org.fedoraproject.prod.pagure.git.receive',
'org.fedoraproject.prod.pagure.pull-request.new',
'org.fedoraproject.prod.pagure.pull-request.rebased',
'org.fedoraproject.prod.pagure.pull-request.updated',
'org.fedoraproject.prod.pagure.pull-request.comment.added',
'io.pagure.stg.pagure.git.receive',
'io.pagure.stg.pagure.pull-request.new',
'io.pagure.stg.pagure.pull-request.rebased',
'io.pagure.stg.pagure.pull-request.updated',
'io.pagure.stg.pagure.pull-request.comment.added'
]
Merges: #1025
---
frontend/copr-frontend.spec | 12 ++--
.../{run/pagure-events.py => pagure_events.py} | 81 ++++------------------
frontend/pagure-events.service | 11 ---
3 files changed, 18 insertions(+), 86 deletions(-)
diff --git a/frontend/copr-frontend.spec b/frontend/copr-frontend.spec
index b575f30..b490725 100644
--- a/frontend/copr-frontend.spec
+++ b/frontend/copr-frontend.spec
@@ -66,6 +66,7 @@ BuildRequires: graphviz
BuildRequires: python3-devel
%if %{with check}
+BuildRequires: fedora-messaging
BuildRequires: libmodulemd < 2
BuildRequires: libmodulemd >= 1.7.0
BuildRequires: python3-CommonMark
@@ -112,6 +113,7 @@ Requires: redis
Requires: %flavor_guard
Requires: (copr-selinux if selinux-policy-targeted)
+Requires: fedora-messaging
Requires: js-html5shiv
Requires: js-jquery1
Requires: js-respond
@@ -238,8 +240,6 @@ install -p -m 755 coprs_frontend/run/copr_dump_db.sh %{buildroot}%{_libexecdir}
cp -a coprs_frontend/* %{buildroot}%{_datadir}/copr/coprs_frontend
sed -i "s/__RPM_BUILD_VERSION/%{version}-%{release}/" %{buildroot}%{_datadir}/copr/coprs_frontend/coprs/templates/layout.html
-cp -a pagure-events.service %{buildroot}%{_unitdir}/
-
mv %{buildroot}%{_datadir}/copr/coprs_frontend/coprs.conf.example ./
mv %{buildroot}%{_datadir}/copr/coprs_frontend/config/* %{buildroot}%{_sysconfdir}/copr
rm %{buildroot}%{_datadir}/copr/coprs_frontend/CONTRIBUTION_GUIDELINES
@@ -287,16 +287,16 @@ usermod -L copr-fe
%post
/bin/systemctl condrestart httpd.service || :
-%systemd_post pagure-events.service
+%systemd_post fm-consumer(a)copr_messaging.service
%preun
-%systemd_preun pagure-events.service
+%systemd_preun fm-consumer(a)copr_messaging.service
%postun
/bin/systemctl condrestart httpd.service || :
-%systemd_postun_with_restart pagure-events.service
+%systemd_postun_with_restart fm-consumer(a)copr_messaging.service
%files
@@ -310,8 +310,6 @@ usermod -L copr-fe
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
-%{_unitdir}/pagure-events.service
-
%defattr(-, copr-fe, copr-fe, -)
%dir %{_sharedstatedir}/copr/data
%dir %{_sharedstatedir}/copr/data/openid_store
diff --git a/frontend/coprs_frontend/run/pagure-events.py b/frontend/coprs_frontend/pagure_events.py
similarity index 85%
rename from frontend/coprs_frontend/run/pagure-events.py
rename to frontend/coprs_frontend/pagure_events.py
index a16346e..f88a00a 100755
--- a/frontend/coprs_frontend/run/pagure-events.py
+++ b/frontend/coprs_frontend/pagure_events.py
@@ -2,13 +2,13 @@
import json
import pprint
-import zmq
import sys
import os
import logging
import requests
import re
import munch
+import subprocess
sys.path.append(
os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
@@ -25,39 +25,18 @@ from urllib.parse import urlparse
SCM_SOURCE_TYPE = helpers.BuildSourceEnum("scm")
-logging.basicConfig(
- filename='{0}/pagure-events.log'.format(app.config.get('LOG_DIR')),
- format='[%(asctime)s][%(levelname)6s]: %(message)s',
- level=logging.DEBUG)
-
log = logging.getLogger(__name__)
-log.addHandler(logging.StreamHandler(sys.stdout))
-
if os.getenv('PAGURE_EVENTS_TESTONLY'):
ENDPOINT = 'tcp://stg.pagure.io:9940'
else:
ENDPOINT = 'tcp://hub.fedoraproject.org:9940'
+log.setLevel(logging.DEBUG)
log.info("ENDPOINT = {}".format(ENDPOINT))
-pagure_instances = {
- 'https://pagure.io/': 'io.pagure.prod.pagure',
- 'https://src.fedoraproject.org/': 'org.fedoraproject.prod.pagure',
- 'https://stg.pagure.io/': 'io.pagure.stg.pagure', # testing only
-}
-
-topics = [
- 'git.receive',
- 'pull-request.new',
- 'pull-request.rebased',
- 'pull-request.updated',
- 'pull-request.comment.added',
-]
-
TOPICS = {}
-for url, fedmsg_prefix in pagure_instances.items():
- for topic in topics:
- TOPICS['{0}.{1}'.format(fedmsg_prefix, topic)] = url
+for topic, url in app.config["PAGURE_EVENTS"].items():
+ TOPICS['{0}'.format(topic)] = url
def get_repeatedly(url):
log.info("getting url {}".format(url))
@@ -219,46 +198,22 @@ def git_compare_urls(url1, url2):
return (o1.netloc == o2.netloc and o1.path == o2.path)
-def build_on_fedmsg_loop():
- log.debug("Setting up poller...")
- pp = pprint.PrettyPrinter(width=120)
-
- ctx = zmq.Context()
- s = ctx.socket(zmq.SUB)
-
- # detect server hang/restart (still a chance to loose ~45s events)
- # for more info see man tcp(7).
- s.setsockopt(zmq.TCP_KEEPALIVE, 1) # turn on keep-alive
- s.setsockopt(zmq.TCP_KEEPALIVE_IDLE, 30) # start when 30s inactive
- s.setsockopt(zmq.TCP_KEEPALIVE_INTVL, 5) # send keep-alive packet each 5s
- s.setsockopt(zmq.TCP_KEEPALIVE_CNT, 3) # restart after 3 fails
+class build_on_fedmsg_loop():
- s.connect(ENDPOINT)
-
- for topic in TOPICS:
- s.setsockopt_string(zmq.SUBSCRIBE, topic)
-
- poller = zmq.Poller()
- poller.register(s, zmq.POLLIN)
-
- while True:
- log.debug('Polling...')
- evts = poller.poll(10000)
- if not evts:
- continue
-
- log.debug('Receiving...')
- _, msg_bytes = s.recv_multipart()
- msg = msg_bytes.decode('utf-8')
+ def __call__(self, message):
+ pp = pprint.PrettyPrinter(width=120)
log.debug('Parsing...')
- data = json.loads(msg)
+ data = {
+ 'topic': message.topic,
+ 'msg': message.body
+ }
log.info('Got topic: {}'.format(data['topic']))
base_url = TOPICS.get(data['topic'])
if not base_url:
log.error('Unknown topic {} received. Continuing.')
- continue
+ return
if re.match(r'^.*.pull-request.(new|rebased|updated)$', data['topic']):
event_info = event_info_from_pr(data, base_url)
@@ -271,7 +226,7 @@ def build_on_fedmsg_loop():
if not event_info:
log.info('Received event was discarded. Continuing.')
- continue
+ return
candidates = ScmPackage.get_candidates_for_rebuild(event_info.base_clone_url)
changed_files = set()
@@ -349,13 +304,3 @@ def build_on_fedmsg_loop():
db.session.commit()
else:
log.info('\t -> skipping.')
-
-
-if __name__ == '__main__':
- while True:
- try:
- build_on_fedmsg_loop()
- except KeyboardInterrupt:
- sys.exit(1)
- except:
- log.exception('Error in fedmsg loop. Restarting it.')
diff --git a/frontend/pagure-events.service b/frontend/pagure-events.service
deleted file mode 100644
index db3cc14..0000000
--- a/frontend/pagure-events.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Run copr builds on pagure events
-
-[Service]
-User=copr-fe
-Group=copr-fe
-Environment="PYTHONPATH=/usr/share/copr/"
-ExecStart=/usr/bin/python3 /usr/share/copr/coprs_frontend/run/pagure-events.py
-
-[Install]
-WantedBy=multi-user.target
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 6 months