| |
@@ -72,8 +72,34 @@
|
| |
namespace, package, admin = entry
|
| |
output[namespace][package] = [admin]
|
| |
|
| |
- # Add the users with commit and admin ACLs
|
| |
+ # Add the users with admin ACLs first
|
| |
+ query = (
|
| |
+ session.query(
|
| |
+ model.Project.namespace,
|
| |
+ model.Project.name,
|
| |
+ model.User.user,
|
| |
+ )
|
| |
+ .filter(model.Project.id == model.ProjectUser.project_id)
|
| |
+ .filter(model.ProjectUser.user_id == model.User.id)
|
| |
+ .filter(model.ProjectUser.access == "admin")
|
| |
+ .filter(model.Project.parent_id == None)
|
| |
+ .filter(model.Project.is_fork == False)
|
| |
+ )
|
| |
+
|
| |
+ for entry in query.all():
|
| |
+ namespace, package, user = entry
|
| |
+ output[namespace][package].add(user)
|
| |
+
|
| |
+ # Convert the sets into lists
|
| |
+ final = collections.defaultdict(dict)
|
| |
+ for ns in output:
|
| |
+ for pkg in output[ns]:
|
| |
+ final[ns][pkg] = list(output[ns][pkg])
|
| |
+
|
| |
+ with open(os.path.join(args[0], "pagure_owner_alias_admins.json"), "w") as stream:
|
| |
+ json.dump(final, stream, indent=4, sort_keys=True)
|
| |
|
| |
+ # Add the users with commit ACLs
|
| |
query = (
|
| |
session.query(
|
| |
model.Project.namespace,
|
| |
@@ -82,7 +108,7 @@
|
| |
)
|
| |
.filter(model.Project.id == model.ProjectUser.project_id)
|
| |
.filter(model.ProjectUser.user_id == model.User.id)
|
| |
- .filter(model.ProjectUser.access.in_(["commit", "admin"]))
|
| |
+ .filter(model.ProjectUser.access == "commit")
|
| |
.filter(model.Project.parent_id == None)
|
| |
.filter(model.Project.is_fork == False)
|
| |
)
|
| |
Supports: https://pagure.io/fedora-qa/packager_dashboard/issue/153
(I did not actually test this, it should work though (tm))