[copr/copr] branch master updated: frontend,
doc: more scripted fedora branching
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 ceaa4bb frontend, doc: more scripted fedora branching
ceaa4bb is described below
commit ceaa4bb09c5f4826a70f6507214cdf4fafe1d68f
Author: Pavel Raiskup <praiskup(a)redhat.com>
AuthorDate: Wed Aug 28 09:29:33 2019 +0200
frontend, doc: more scripted fedora branching
This change adds `manage.py branch_fedora` command - that is a more
automated variant of manual rawhide_to_release command execution for
each rawhide chroot. The change also introduces convenience option
`--deactivated` for `create_chroot` command, so we don't have to create
the chroot and disable right after that (racy).
Suggest in doc that we should newly use `branch_fedora` command, and
explain why is important to run the command as soon as possible.
Fixes: #955
Merges: #973
---
doc/how_to_manage_chroots.rst | 59 ++++++++++++++---------
frontend/coprs_frontend/commands/branch_fedora.py | 42 ++++++++++++++++
frontend/coprs_frontend/commands/create_chroot.py | 22 ++++++---
frontend/coprs_frontend/manage.py | 1 +
4 files changed, 94 insertions(+), 30 deletions(-)
diff --git a/doc/how_to_manage_chroots.rst b/doc/how_to_manage_chroots.rst
index fac99e9..e878800 100644
--- a/doc/how_to_manage_chroots.rst
+++ b/doc/how_to_manage_chroots.rst
@@ -17,6 +17,7 @@ Chroots can be easily managed with these few commands.
copr-frontend create_chroot <name>
copr-frontend alter_chroot --action activate <name>
copr-frontend alter_chroot --action deactivate <name>
+ copr-frontend branch_fedora <new-branched-version>
copr-frontend rawhide_to_release <rawhide-chroot> <newly-created-chroot>
However, `enablement process upon Fedora branching <#branching-process>`_ and also
@@ -27,39 +28,51 @@ That's why the rest of this article explains the certain use-cases rather than a
Branching process
-----------------
-Immediately after Fedora branching, you want to do something like this
+Projects can be configured to follow Fedora branching. That means, that once a
+chroot for new Fedora release is enabled, it should be automatically turned-on
+for such projects. Moreover, builds from Rawhide should be forked into this new
+chroot.
-::
-
- copr-frontend create_chroot fedora-27-x86_64 fedora-27-i386 fedora-27-ppc64le
+So **immediately** after Fedora branching (for exmaple to version **31**), you
+want to do this (the command takes a very long time, be prepared)::
+ copr-frontend branch_fedora 31
-Copr uses `Mock <https://github.com/rpm-software-management/mock>`_ for building packages, so you should check if
-the mock configs
-`are already available <https://github.com/rpm-software-management/mock/tree/devel/mock-core-conf...>`_
-and in which version of the :code:`mock-core-configs` package they were added. If that version is not installed
-on builders, you should temporarily disable the chroots.
+This command creates ``fedora-31-*`` chroots from corresponding
+``fedora-rawhide-*`` chroots, and it also copies (duplicates/forks) latest
+successful rawhide package builds into the new chroots. This can be done
+manually for each architecture by::
-::
+ copr-frontend create_chroot fedora-31-x86_64 --deactivated
+ copr-frontend rawhide_to_release fedora-rawhide-x86_64 fedora-31-x86_64
- copr-frontend alter_chroot --action deactivate fedora-27-x86_64 fedora-27-i386 fedora-27-ppc64le
+From the manual steps you can see that the new chroots are **deactivated** at
+the beginning.
+It's important to do ``rawhide_to_release`` as soon as possible, because right
+after branching action - Fedora Rawhide starts to live it's own separate life -
+and the builds in Rawhide become more and more incompatible with the branched
+Fedora. So - if we copied the packages later - the branched chroot in copr
+could become unusable. You may consider sending an email to mailing list that
+rawhide packages were copied.
-Projects can be configured to follow Fedora branching. That means, that once a chroot for new Fedora release is
-enabled, it should be automatically turned-on for such projects. Moreover, builds from Rawhide should be forked into
-this new chroot. It can be done like this
+The next needs to wait a bit, namely
+* till there's a working compose for the freshly branched Fedora, and
+* till the new mock configs are available on the builders.
-::
-
- copr-frontend rawhide_to_release fedora-rawhide-x86_64 fedora-27-x86_64
- copr-frontend rawhide_to_release fedora-rawhide-i386 fedora-27-i386
- copr-frontend rawhide_to_release fedora-rawhide-ppc64le fedora-27-ppc64le
-
-Once the mock configs are available on the builders, you can re-enable the chroots
+Copr uses `Mock <https://github.com/rpm-software-management/mock>`_ for building packages, so you should check if
+the mock configs
+`are already available <https://github.com/rpm-software-management/mock/tree/devel/mock-core-conf...>`_
+and in which version of the :code:`mock-core-configs` package they were added. If that version is not installed
+on builders, you should keep the chroots deactivated for now and continue later.
-::
+But the sooner we can enable the new chroots, the better -- all the builds that
+happened in the time window between ``rawhide_to_release`` and chroot enablement
+will be missed in the branched chroot later (users will have to rebuild them
+manually). So as soon as it is possible, do::
- copr-frontend alter_chroot --action activate fedora-27-x86_64 fedora-27-i386 fedora-27-ppc64le
+ copr-frontend alter_chroot --action activate \
+ fedora-31-x86_64 fedora-31-i386 fedora-31-ppc64le fedora-31-aarch64
When everything is done, `send an information email to a mailing list <#mailing-lists>`_.
diff --git a/frontend/coprs_frontend/commands/branch_fedora.py b/frontend/coprs_frontend/commands/branch_fedora.py
new file mode 100644
index 0000000..ddbf02d
--- /dev/null
+++ b/frontend/coprs_frontend/commands/branch_fedora.py
@@ -0,0 +1,42 @@
+from flask_script import Command, Option
+from coprs.logic import coprs_logic
+
+from commands.create_chroot import CreateChrootCommand
+from commands.rawhide_to_release import RawhideToReleaseCommand
+
+
+class BranchFedoraCommand(Command):
+ """
+ Branch fedora-rawhide-* chroots to fedora-N* and execute rawhide_to_release
+ on them
+ """
+
+ option_list = [
+ Option("fedora_version",
+ help="The version of Fedora to branch Rawhide into, e.g. 32",
+ type=int),
+ Option(
+ "--dist-git-branch",
+ "-b",
+ dest="branch",
+ help="Branch name for this set of new chroots"),
+ ]
+
+ def run(self, fedora_version, branch=None):
+ rawhide_chroots = coprs_logic.MockChrootsLogic.get_from_name(
+ "fedora-rawhide",
+ active_only=True,
+ noarch=True).all()
+
+ chroot_pairs = {
+ 'fedora-{}-{}'.format(fedora_version, rch.arch):
+ 'fedora-rawhide-{}'.format(rch.arch)
+ for rch in rawhide_chroots
+ }
+
+ c_cmd = CreateChrootCommand()
+ c_cmd.run(chroot_pairs.keys(), branch, True)
+
+ r2r_cmd = RawhideToReleaseCommand()
+ for new_chroot, rawhide_chroot in chroot_pairs.items():
+ r2r_cmd.run(rawhide_chroot, new_chroot)
diff --git a/frontend/coprs_frontend/commands/create_chroot.py b/frontend/coprs_frontend/commands/create_chroot.py
index dd97fac..48ddcc0 100644
--- a/frontend/coprs_frontend/commands/create_chroot.py
+++ b/frontend/coprs_frontend/commands/create_chroot.py
@@ -30,13 +30,20 @@ class CreateChrootCommand(ChrootCommand):
"Creates a mock chroot in DB"
def __init__(self):
- self.option_list += Option(
- "--dist-git-branch",
- "-b",
- dest="branch",
- help="Branch name for this set of new chroots"),
-
- def run(self, chroot_names, branch=None):
+ self.option_list += (
+ Option(
+ "--dist-git-branch",
+ "-b",
+ dest="branch",
+ help="Branch name for this set of new chroots"),
+ Option(
+ "--deactivated",
+ action="store_true",
+ help="Activate the chroot later, manually by `alter_chroot`"
+ ),
+ )
+
+ def run(self, chroot_names, branch=None, deactivated=False):
for chroot_name in chroot_names:
if not branch:
branch = chroot_to_branch(chroot_name)
@@ -44,6 +51,7 @@ class CreateChrootCommand(ChrootCommand):
try:
chroot = coprs_logic.MockChrootsLogic.add(chroot_name)
chroot.distgit_branch = branch_object
+ chroot.is_active = not deactivated
db.session.commit()
except exceptions.MalformedArgumentException:
self.print_invalid_format(chroot_name)
diff --git a/frontend/coprs_frontend/manage.py b/frontend/coprs_frontend/manage.py
index 455e3c5..3701370 100755
--- a/frontend/coprs_frontend/manage.py
+++ b/frontend/coprs_frontend/manage.py
@@ -23,6 +23,7 @@ commands = {
"alter_chroot": "AlterChrootCommand",
"display_chroots": "DisplayChrootsCommand",
"drop_chroot": "DropChrootCommand",
+ "branch_fedora": "BranchFedoraCommand",
# User commands
"alter_user": "AlterUserCommand",
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 7 months
[copr/copr] branch master updated (266dfc1 -> 32b2613)
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 266dfc1 docker: install make in the backend container
add 32b2613 frontend: add link to builder-live log for chroot states
No new revisions were added by this update.
Summary of changes:
frontend/coprs_frontend/coprs/models.py | 8 ++++++++
frontend/coprs_frontend/coprs/templates/coprs/detail/build.html | 6 +++++-
2 files changed, 13 insertions(+), 1 deletion(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 7 months
[copr/copr] branch master updated (46e3f98 -> 266dfc1)
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 46e3f98 frontend: add missing url to overview page
add 307dfac docker: add containers for keygen
add 778c685 docker: fix backend httpd port
add 266dfc1 docker: install make in the backend container
No new revisions were added by this update.
Summary of changes:
docker-compose.yaml | 23 ++++++++++
docker/backend/Dockerfile | 34 ++------------
docker/backend/files/etc/copr/copr-be.conf | 7 ++-
docker/backend/files/etc/copr/copr-keygen.conf | 10 ----
docker/backend/files/etc/sign.conf | 16 +------
docker/backend/files/etc/uwsgi.d/copr-keygen.ini | 41 -----------------
docker/backend/files/etc/uwsgi.ini | 9 ----
docker/keygen-httpd/Dockerfile | 53 ++++++++++++++++++++++
.../files/etc/httpd/conf.d/copr-keygen.conf | 4 ++
docker/keygen-signd/Dockerfile | 20 ++++++++
docker/keygen-signd/files/etc/sign.conf | 18 ++++++++
11 files changed, 126 insertions(+), 109 deletions(-)
delete mode 100644 docker/backend/files/etc/copr/copr-keygen.conf
delete mode 100644 docker/backend/files/etc/uwsgi.d/copr-keygen.ini
delete mode 100644 docker/backend/files/etc/uwsgi.ini
create mode 100644 docker/keygen-httpd/Dockerfile
copy keygen/configs/httpd/copr-keygen.conf.example => docker/keygen-httpd/files/etc/httpd/conf.d/copr-keygen.conf (93%)
create mode 100644 docker/keygen-signd/Dockerfile
create mode 100644 docker/keygen-signd/files/etc/sign.conf
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 7 months
[copr/copr] branch master updated (fc6855f -> 46e3f98)
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 fc6855f frontend: dump whooshee version when updating indexes
add 46e3f98 frontend: add missing url to overview page
No new revisions were added by this update.
Summary of changes:
.../coprs/templates/coprs/detail/settings/repositories.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 7 months
[copr/copr] branch master updated: frontend: dump whooshee version
when updating indexes
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 fc6855f frontend: dump whooshee version when updating indexes
fc6855f is described below
commit fc6855f3dc98585ca86d1a47aa3325f6ea6bd322
Author: Jakub Kadlcik <frostyx(a)email.cz>
AuthorDate: Mon Aug 26 13:33:34 2019 +0200
frontend: dump whooshee version when updating indexes
Once we have information about what whooshee version we used for
generating indexes, then we can update our provision playbooks
to rebuild them only if the version changed.
Merges: #946
---
frontend/coprs_frontend/commands/update_indexes.py | 4 ++-
.../commands/update_indexes_required.py | 14 ++++++++
frontend/coprs_frontend/coprs/whoosheers.py | 38 ++++++++++++++++++++++
frontend/coprs_frontend/manage.py | 7 ++--
4 files changed, 60 insertions(+), 3 deletions(-)
diff --git a/frontend/coprs_frontend/commands/update_indexes.py b/frontend/coprs_frontend/commands/update_indexes.py
index 03279fc..e9da805 100644
--- a/frontend/coprs_frontend/commands/update_indexes.py
+++ b/frontend/coprs_frontend/commands/update_indexes.py
@@ -1,7 +1,7 @@
from flask_script import Command
from flask_whooshee import Whooshee
from coprs import app
-from coprs.whoosheers import CoprWhoosheer
+from coprs.whoosheers import CoprWhoosheer, WhoosheeStamp
from coprs.logic import coprs_logic
@@ -26,3 +26,5 @@ class UpdateIndexesCommand(Command):
for copr in coprs_logic.CoprsLogic.get_all():
CoprWhoosheer.insert_copr(writer, copr)
writer.commit(optimize=True)
+
+ WhoosheeStamp.store()
diff --git a/frontend/coprs_frontend/commands/update_indexes_required.py b/frontend/coprs_frontend/commands/update_indexes_required.py
new file mode 100644
index 0000000..209b31d
--- /dev/null
+++ b/frontend/coprs_frontend/commands/update_indexes_required.py
@@ -0,0 +1,14 @@
+import sys
+from flask_script import Command
+from coprs.whoosheers import WhoosheeStamp
+
+
+class UpdateIndexesRequiredCommand(Command):
+ """
+ Is whooshee indexes rebuild required?
+ """
+
+ def run(self):
+ valid = WhoosheeStamp.is_valid()
+ print("no" if valid else "yes")
+ sys.exit(int(not valid))
diff --git a/frontend/coprs_frontend/coprs/whoosheers.py b/frontend/coprs_frontend/coprs/whoosheers.py
index 930bd65..9ab6d70 100644
--- a/frontend/coprs_frontend/coprs/whoosheers.py
+++ b/frontend/coprs_frontend/coprs/whoosheers.py
@@ -1,8 +1,11 @@
+import os
import whoosh
import time
+from subprocess import Popen, PIPE
from flask_whooshee import AbstractWhoosheer
+from coprs import app
from coprs import models
from coprs import whooshee
from coprs import db
@@ -110,3 +113,38 @@ class CoprWhoosheer(AbstractWhoosheer):
WHERE copr.id = {1}
""".format(int(time.time()), copr_id)
)
+
+
+class WhoosheeStamp(object):
+ """
+ When a whooshee package is updated, it is often needed to rebuild
+ indexes. This class manages a stamp file containing whooshee packages
+ versions and decides whether they are still up-to-date or not.
+ """
+
+ PATH = os.path.join(app.config["WHOOSHEE_DIR"], "whooshee-version")
+
+ @classmethod
+ def current(cls):
+ packages = ["python3-flask-whooshee", "python3-whoosh"]
+ cmd = ["rpm", "-q", "--qf", "%{NAME}-%{VERSION}\n"] + packages
+ process = Popen(cmd, stdout=PIPE, stderr=PIPE)
+ out, err = process.communicate()
+ return out.decode("utf-8").rstrip()
+
+ @classmethod
+ def store(cls):
+ with open(cls.PATH, "w") as f:
+ f.write(cls.current())
+
+ @classmethod
+ def read(cls):
+ try:
+ with open(cls.PATH, "r") as f:
+ return f.read().rstrip()
+ except OSError:
+ return None
+
+ @classmethod
+ def is_valid(cls):
+ return cls.read() == cls.current()
diff --git a/frontend/coprs_frontend/manage.py b/frontend/coprs_frontend/manage.py
index 2f0d585..455e3c5 100755
--- a/frontend/coprs_frontend/manage.py
+++ b/frontend/coprs_frontend/manage.py
@@ -29,11 +29,14 @@ commands = {
"add_user": "AddUserCommand",
"dump_user": "DumpUserCommand",
+ # Whooshee indexes
+ "update_indexes": "UpdateIndexesCommand",
+ "update_indexes_quick": "UpdateIndexesQuickCommand",
+ "update_indexes_required": "UpdateIndexesRequiredCommand",
+
# Other
"get_admins": "GetAdminsCommand",
"fail_build": "FailBuildCommand",
- "update_indexes": "UpdateIndexesCommand",
- "update_indexes_quick": "UpdateIndexesQuickCommand",
"rawhide_to_release": "RawhideToReleaseCommand",
"backend_rawhide_to_release": "BackendRawhideToReleaseCommand",
"update_graphs": "UpdateGraphsDataCommand",
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 8 months
[copr/copr] branch master updated (51e452a -> 2b5b8be)
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 51e452a frontend: copr-fe-dev shouldn't send emails to everybody
add 2b5b8be frontend: really don't show srpm live-log when pending
No new revisions were added by this update.
Summary of changes:
frontend/coprs_frontend/coprs/templates/coprs/detail/build.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 8 months
[copr/copr] branch master updated: frontend: copr-fe-dev shouldn't
send emails to everybody
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 51e452a frontend: copr-fe-dev shouldn't send emails to everybody
51e452a is described below
commit 51e452acaba2859e14165f7d77131ef29da52329
Author: Silvie Chlupova <sisi.chlupova(a)gmail.com>
AuthorDate: Wed Aug 28 13:19:03 2019 +0200
frontend: copr-fe-dev shouldn't send emails to everybody
Fixes: #793
Merges: #959
---
.../commands/notify_outdated_chroots.py | 2 +-
frontend/coprs_frontend/coprs/config.py | 2 ++
frontend/coprs_frontend/coprs/mail.py | 28 ++++++++++++++++------
.../coprs/views/apiv3_ns/apiv3_permissions.py | 4 ++--
.../coprs/views/coprs_ns/coprs_general.py | 2 +-
.../tests/test_apiv3/test_projects.py | 4 ++--
frontend/coprs_frontend/tests/test_mail.py | 15 +++++++++++-
7 files changed, 43 insertions(+), 14 deletions(-)
diff --git a/frontend/coprs_frontend/commands/notify_outdated_chroots.py b/frontend/coprs_frontend/commands/notify_outdated_chroots.py
index 30d37d2..5d92ab5 100644
--- a/frontend/coprs_frontend/commands/notify_outdated_chroots.py
+++ b/frontend/coprs_frontend/commands/notify_outdated_chroots.py
@@ -74,7 +74,7 @@ class NotifyOutdatedChrootsCommand(Command):
class Notifier(object):
def notify(self, user, chroots):
msg = OutdatedChrootMessage(chroots)
- send_mail(user.mail, msg)
+ send_mail([user.mail], msg)
def store_timestamp(self, chroots):
for chroot in chroots:
diff --git a/frontend/coprs_frontend/coprs/config.py b/frontend/coprs_frontend/coprs/config.py
index 3e56df4..fb3059f 100644
--- a/frontend/coprs_frontend/coprs/config.py
+++ b/frontend/coprs_frontend/coprs/config.py
@@ -93,6 +93,8 @@ class Config(object):
ENABLE_DISCUSSION = False
DISCOURSE_URL = ''
+ WHITELIST_EMAILS = []
+
class ProductionConfig(Config):
DEBUG = False
# SECRET_KEY = "put_some_secret_here"
diff --git a/frontend/coprs_frontend/coprs/mail.py b/frontend/coprs_frontend/coprs/mail.py
index c310dec..2d7662a 100644
--- a/frontend/coprs_frontend/coprs/mail.py
+++ b/frontend/coprs_frontend/coprs/mail.py
@@ -1,6 +1,6 @@
import flask
import platform
-import smtplib
+from smtplib import SMTP
from email.mime.text import MIMEText
from coprs import app, helpers
@@ -114,9 +114,21 @@ class OutdatedChrootMessage(Message):
"{3}\n\n".format(chroot.copr.full_name, chroot.name, chroot.delete_after_days, url))
-def send_mail(recipient, message, sender=None, reply_to=None):
+def filter_whitelisted_recipients(recipients):
"""
- :param str/list recipient: One recipient email as a string or multiple emails in a list
+ Filters e-mail recipients if the white list of recipients in conf is not empty.
+ :param recipients: list of recipients
+ :return: list of recipients who should receive an e-mail
+ """
+ if not app.config["WHITELIST_EMAILS"]:
+ return recipients
+
+ return [r for r in recipients if r in app.config["WHITELIST_EMAILS"]]
+
+
+def send_mail(recipients, message, sender=None, reply_to=None):
+ """
+ :param list recipients: List of email recipients
:param Message message:
:param str sender: Email of a sender
:return:
@@ -124,8 +136,10 @@ def send_mail(recipient, message, sender=None, reply_to=None):
msg = MIMEText(message.text)
msg["Subject"] = message.subject
msg["From"] = sender or "root@{0}".format(platform.node())
- msg["To"] = ", ".join(recipient) if type(recipient) == list else recipient
+ msg["To"] = ", ".join(recipients)
msg.add_header("reply-to", reply_to or app.config["REPLY_TO"])
- s = smtplib.SMTP("localhost")
- s.sendmail("root@{0}".format(platform.node()), recipient, msg.as_string())
- s.quit()
+ recipients = filter_whitelisted_recipients(recipients)
+ if not recipients:
+ return
+ with SMTP("localhost") as smtp:
+ smtp.sendmail("root@{0}".format(platform.node()), recipients, msg.as_string())
diff --git a/frontend/coprs_frontend/coprs/views/apiv3_ns/apiv3_permissions.py b/frontend/coprs_frontend/coprs/views/apiv3_ns/apiv3_permissions.py
index dd7e541..15c81fd 100644
--- a/frontend/coprs_frontend/coprs/views/apiv3_ns/apiv3_permissions.py
+++ b/frontend/coprs_frontend/coprs/views/apiv3_ns/apiv3_permissions.py
@@ -67,7 +67,7 @@ def set_permissions(copr):
# send emails only if transaction succeeded
for task in messages:
if flask.current_app.config.get("SEND_EMAILS", False):
- send_mail(task['address'], task['message'])
+ send_mail([task['address']], task['message'])
return flask.jsonify({'updated': list(updated.keys())})
@@ -96,6 +96,6 @@ def request_permissions(ownername, projectname):
msg = PermissionRequestMessage(copr, flask.g.user, permission_dict)
for address in copr.admin_mails:
if flask.current_app.config.get("SEND_EMAILS", False):
- send_mail(address, msg)
+ send_mail([address], msg)
return flask.jsonify({'updated': bool(permission_dict)})
diff --git a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index 9bb39cd..33517da 100644
--- a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -522,7 +522,7 @@ def copr_permissions_applier_change(copr):
permission_dict = {"old_builder": old_builder, "old_admin": old_admin,
"new_builder": new_builder, "new_admin": new_admin}
msg = PermissionRequestMessage(copr, flask.g.user, permission_dict)
- send_mail(mail, msg, )
+ send_mail([mail], msg)
return flask.redirect(helpers.copr_url("coprs_ns.copr_detail", copr))
diff --git a/frontend/coprs_frontend/tests/test_apiv3/test_projects.py b/frontend/coprs_frontend/tests/test_apiv3/test_projects.py
index a5d83e8..564dd61 100644
--- a/frontend/coprs_frontend/tests/test_apiv3/test_projects.py
+++ b/frontend/coprs_frontend/tests/test_apiv3/test_projects.py
@@ -213,8 +213,8 @@ class TestApiV3Permissions(CoprsTestCase):
emails = ['user1(a)spam.foo', 'user2(a)spam.foo']
calls = send_mail.call_args_list
assert len(calls) == 2
- assert calls[0][0][0] == "user2(a)spam.foo"
- assert calls[1][0][0] == "user1(a)foo.bar"
+ assert calls[0][0][0] == ["user2(a)spam.foo"]
+ assert calls[1][0][0] == ["user1(a)foo.bar"]
assert str(calls[0][0][1]) == msg
assert str(calls[1][0][1]) == msg
diff --git a/frontend/coprs_frontend/tests/test_mail.py b/frontend/coprs_frontend/tests/test_mail.py
index 519a7e0..2a364ef 100644
--- a/frontend/coprs_frontend/tests/test_mail.py
+++ b/frontend/coprs_frontend/tests/test_mail.py
@@ -1,6 +1,6 @@
import pytest
import datetime
-from coprs.mail import PermissionRequestMessage, PermissionChangeMessage, LegalFlagMessage, OutdatedChrootMessage
+from coprs.mail import PermissionRequestMessage, PermissionChangeMessage, LegalFlagMessage, OutdatedChrootMessage, filter_whitelisted_recipients
from tests.coprs_test_case import CoprsTestCase
from coprs import app
@@ -84,3 +84,16 @@ class TestMail(CoprsTestCase):
with pytest.raises(AttributeError) as ex:
OutdatedChrootMessage(copr_chroots=[])
assert "No outdated chroots" in str(ex)
+
+ def test_filter_recipients(self):
+ app.config["WHITELIST_EMAILS"] = ["test(a)redhat.com"]
+ recipient = filter_whitelisted_recipients(["test(a)redhat.com", "user(a)redhat.com"])
+ assert recipient == ["test(a)redhat.com"]
+
+ app.config["WHITELIST_EMAILS"] = ["test(a)redhat.com", "user(a)redhat.com"]
+ recipient = filter_whitelisted_recipients(["test(a)redhat.com", "user(a)redhat.com"])
+ assert recipient == ["test(a)redhat.com", "user(a)redhat.com"]
+
+ app.config["WHITELIST_EMAILS"] = []
+ recipient = filter_whitelisted_recipients(["test(a)redhat.com", "user(a)redhat.com"])
+ assert recipient == ["test(a)redhat.com", "user(a)redhat.com"]
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 8 months
[copr/copr] branch master updated (78ce39e -> 794a49d)
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 78ce39e releng: adjust tito releasers
add 794a49d beaker-tests: fix vera.spec for boost url
No new revisions were added by this update.
Summary of changes:
beaker-tests/Regression/dist-git/tests/batch1/static/vera.spec | 5 +++++
beaker-tests/Sanity/copr-cli-basic-operations/files/vera.spec | 2 ++
2 files changed, 7 insertions(+)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 8 months
[copr/copr] branch master updated: releng: adjust tito releasers
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 78ce39e releng: adjust tito releasers
78ce39e is described below
commit 78ce39ef161f345dba3d55ddb927476b4a5c08fe
Author: Pavel Raiskup <praiskup(a)redhat.com>
AuthorDate: Wed Sep 4 09:28:14 2019 +0200
releng: adjust tito releasers
---
.tito/releasers.conf | 4 ++--
doc/how_to_release_copr.rst | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.tito/releasers.conf b/.tito/releasers.conf
index 3bbcfd0..0a0c00f 100644
--- a/.tito/releasers.conf
+++ b/.tito/releasers.conf
@@ -1,8 +1,8 @@
[fedora-git]
# used by frontend, backend, dist-git, rpmbuild
releaser = tito.release.FedoraGitReleaser
-branches = master f29 f30
+branches = master f29 f30 f31
[fedora-git-clients]
releaser = tito.release.FedoraGitReleaser
-branches = master el6 epel7 f29 f30
+branches = master el6 epel7 f29 f30 f31
diff --git a/doc/how_to_release_copr.rst b/doc/how_to_release_copr.rst
index e1b220b..cf03f9b 100644
--- a/doc/how_to_release_copr.rst
+++ b/doc/how_to_release_copr.rst
@@ -123,7 +123,7 @@ For each package do::
cd <package subdir>
tito build --srpm
tito release fedora-git # for server packages, or
- tito release fedora-git-client # for server packages (includes epel)
+ tito release fedora-git-clients # for server packages (includes epel)
And submit them into `Infra tags repo <https://fedora-infra-docs.readthedocs.io/en/latest/sysadmin-guide/sops/in...>`_.
Not even every fedora infra member can to this, ping clime or ask on ``#fedora-admin``.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 8 months
[copr/copr] annotated tag copr-frontend-1.153-1 created (now
33bb534)
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
dturecek pushed a change to annotated tag copr-frontend-1.153-1
in repository copr/copr.
at 33bb534 (tag)
tagging 0a0da987f074279d5177049a5ebbfae6769396b7 (commit)
replaces copr-backend-1.125-1
by Dominik Turecek
on Wed Sep 4 09:01:26 2019 +0200
- Log -----------------------------------------------------------------
Tagging package [copr-frontend] version [copr-frontend-1.153-1] in directory [frontend/].
-----------------------------------------------------------------------
No new revisions were added by this update.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 8 months