[packagedb-cli: 13/13] Merge pull request #75 from fedora-infra/comaintainers
by Pierre-YvesChibon
commit 249e52edbe0be47fe7177c2b2f36faf744bb19c9
Merge: 16b469f fc6f347
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Wed Mar 2 17:47:38 2016 +0100
Merge pull request #75 from fedora-infra/comaintainers
If there are co-maintainers specified in the request, grant them ACLs
pkgdb2client/admin.py | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
8 years, 2 months
[packagedb-cli: 12/13] If there are co-maintainers specified in the request, grant them ACLs
by Pierre-YvesChibon
commit fc6f3478ad42fc0428a11290e1c0a911dd975c97
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Wed Mar 2 15:16:51 2016 +0100
If there are co-maintainers specified in the request, grant them ACLs
pkgdb2client/admin.py | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/pkgdb2client/admin.py b/pkgdb2client/admin.py
index f452673..98a59d1 100644
--- a/pkgdb2client/admin.py
+++ b/pkgdb2client/admin.py
@@ -306,6 +306,18 @@ def __handle_request_package(actionid, action):
koschei=action['info'].get('koschei', False),
)
+ comaintainers = action['info'].get('co-maintainers')
+ if comaintainers:
+ for user in comaintainers.split(','):
+ output = pkgdbclient.update_acl(
+ action['info']['pkg_name'],
+ branches=action['info']['pkg_collection'],
+ acls=['commit', 'watchbugzilla', 'watchcommits',
+ status='Approved',
+ user=user.strip(),
+ namespace=action['info']['pkg_namespace'],
+ )
+
PKGDBCLIENT.handle_api_call(
'/admin/action/status',
data={
8 years, 2 months
[packagedb-cli: 11/13] Merge pull request #74 from fedora-infra/monitoring_create
by Pierre-YvesChibon
commit 16b469f9ca1c84da84b0673905306c4718609896
Merge: 89d0740 328effc
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Wed Mar 2 08:11:20 2016 +0100
Merge pull request #74 from fedora-infra/monitoring_create
Include monitoring information if any are provided when creating a package
pkgdb2client/admin.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
8 years, 2 months
[packagedb-cli: 10/13] Include monitoring information if any are provided
by Pierre-YvesChibon
commit 328effc0dcef11bdde423fbe66bbfd7e9da596b7
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Tue Mar 1 17:19:03 2016 +0100
Include monitoring information if any are provided
pkgdb2client/admin.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/pkgdb2client/admin.py b/pkgdb2client/admin.py
index c540d44..f452673 100644
--- a/pkgdb2client/admin.py
+++ b/pkgdb2client/admin.py
@@ -302,6 +302,8 @@ def __handle_request_package(actionid, action):
upstream_url=upstream,
critpath=action['info']['pkg_critpath'],
namespace=action['info']['pkg_namespace'],
+ monitoring_status=action['info'].get('pkg_namespace', True),
+ koschei=action['info'].get('koschei', False),
)
PKGDBCLIENT.handle_api_call(
8 years, 2 months
[packagedb-cli: 9/13] Merge pull request #73 from fedora-infra/fix_url
by Pierre-YvesChibon
commit 89d0740f381fe884f1bbcee0eeb497ecf9c5e1c0
Merge: 706762b 371c373
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Tue Mar 1 16:11:22 2016 +0100
Merge pull request #73 from fedora-infra/fix_url
Fix calling the right property, PkgDB has a base_url but not an url
pkgdb2client/admin.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
8 years, 2 months
[packagedb-cli: 8/13] Fix calling the right property, PkgDB has a base_url but not an url
by Pierre-YvesChibon
commit 371c37357b15420b035edfeb003163a0dab5ae6d
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Tue Mar 1 15:24:56 2016 +0100
Fix calling the right property, PkgDB has a base_url but not an url
pkgdb2client/admin.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/pkgdb2client/admin.py b/pkgdb2client/admin.py
index 2007e9e..c540d44 100644
--- a/pkgdb2client/admin.py
+++ b/pkgdb2client/admin.py
@@ -314,7 +314,7 @@ def __handle_request_package(actionid, action):
ns = '%s/' % action['info'].get('pkg_namespace', 'rpms')
- url = PKGDBCLIENT.url + '/package/' + ns + action['info']['pkg_name']
+ url = PKGDBCLIENT.base_url + '/package/' + ns + action['info']['pkg_name']
utils.comment_on_bug(
bugid,
'Package request has been approved: %s' % url
8 years, 2 months
[packagedb-cli: 7/13] Merge pull request #67 from tyll/name_email
by Pierre-YvesChibon
commit 706762bb7dd3104bfccb002580cc3f8c75d5e72c
Merge: 8bdef93 83d1902
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Wed Feb 10 11:44:20 2016 +0100
Merge pull request #67 from tyll/name_email
Show full names and check whether review was created by requester
pkgdb2client/admin.py | 2 +-
pkgdb2client/utils.py | 56 ++++++++++++++++++++++++++++++++++++++++--------
2 files changed, 47 insertions(+), 11 deletions(-)
---
8 years, 2 months
[packagedb-cli: 6/13] Handle unknown FAS user
by Pierre-YvesChibon
commit 83d19024c0a1fcee13391adc319f43a9bd1c7d77
Author: Till Maas <opensource(a)till.name>
Date: Tue Feb 9 21:27:44 2016 +0100
Handle unknown FAS user
pkgdb2client/utils.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/pkgdb2client/utils.py b/pkgdb2client/utils.py
index 92f5ac2..499513c 100644
--- a/pkgdb2client/utils.py
+++ b/pkgdb2client/utils.py
@@ -190,9 +190,13 @@ def __get_fas_user_by_email(email_address):
def get_fasinfo(email):
''' Get fas username and build a name string for the user like:
Human Name (fas_username) <email>
+ Returns (fas_username, full_info)
'''
fas_user = __get_fas_user_by_email(email)
+ if fas_user is None:
+ info = "email {} unknown to FAS".format(email)
+ return info, info
fas_username = fas_user["username"]
if fas_username is None:
8 years, 2 months
[packagedb-cli: 5/13] Do not use fas_user.get()
by Pierre-YvesChibon
commit e7eb603215bc5a8c05353d3e4f995823bafe012a
Author: Till Maas <opensource(a)till.name>
Date: Mon Feb 8 20:06:11 2016 +0100
Do not use fas_user.get()
fas_user always contains the specified keys and therefore will still
return None instead of the empty string if the value is None.
pkgdb2client/utils.py | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/pkgdb2client/utils.py b/pkgdb2client/utils.py
index a164f18..92f5ac2 100644
--- a/pkgdb2client/utils.py
+++ b/pkgdb2client/utils.py
@@ -193,8 +193,17 @@ def get_fasinfo(email):
'''
fas_user = __get_fas_user_by_email(email)
- fas_username = fas_user.get("username", "").encode("utf-8")
- human_name = fas_user.get("human_name", "").encode("utf-8")
+
+ fas_username = fas_user["username"]
+ if fas_username is None:
+ fas_username = ""
+ fas_username = fas_username.encode("utf-8")
+
+ human_name = fas_user["human_name"]
+ if human_name is None:
+ human_name = "[Unknown]"
+ human_name = human_name.encode("utf-8")
+
full_info = "{0} ({1}) <{2}>".format(human_name, fas_username, email)
return fas_username, full_info
8 years, 2 months
[packagedb-cli: 4/13] Check that review bug was created by pkg requester
by Pierre-YvesChibon
commit 0716525be54bda1679071df9fadbeed2c55eec34
Author: Till Maas <opensource(a)till.name>
Date: Sat Dec 5 11:38:39 2015 +0100
Check that review bug was created by pkg requester
pkgdb2client/admin.py | 2 +-
pkgdb2client/utils.py | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/pkgdb2client/admin.py b/pkgdb2client/admin.py
index b23b0b0..2007e9e 100644
--- a/pkgdb2client/admin.py
+++ b/pkgdb2client/admin.py
@@ -278,7 +278,7 @@ def __handle_request_package(actionid, action):
bugid = bugid.split('=', 1)[1]
msgs = utils.check_package_creation(
- action['info'], bugid, PKGDBCLIENT)
+ action['info'], bugid, PKGDBCLIENT, action['user'])
bugid = utils.get_bug_id_from_url(action['info']['pkg_review_url'])
diff --git a/pkgdb2client/utils.py b/pkgdb2client/utils.py
index e1859dc..a164f18 100644
--- a/pkgdb2client/utils.py
+++ b/pkgdb2client/utils.py
@@ -225,7 +225,7 @@ def is_packager(user):
and fas_user['group_roles']['packager']['role_status'] == 'approved'
-def check_package_creation(info, bugid, pkgdbclient):
+def check_package_creation(info, bugid, pkgdbclient, requester):
''' Performs a number of checks to see if a package review satisfies the
criterias to create the package on pkgdb.
@@ -267,6 +267,14 @@ def check_package_creation(info, bugid, pkgdbclient):
messages["bad"].append(
'Non-packager {0} commented on review bug'.format(user))
+ bug_creator, bug_creator_full = get_fasinfo(bug.creator)
+ if bug_creator == requester:
+ messages["good"].append("Review bug created by requester `{0}`".format(
+ bug_creator_full))
+ else:
+ messages["bad"].append("Review bug created by `{0}` but request "
+ "by {1}".format(bug_creator_full, requester))
+
# Check who updated the fedora-review flag to +
for flag in bug.flags:
if flag['name'] == 'fedora-review':
8 years, 2 months