From Fedora Project Wiki

m (1 revision(s))
Line 27: Line 27:
Sometimes you want to have a mailing list own a package so that bugzilla email is assigned to the mailing list.  Doing this requires adding a new pseudo user to the account system and assigning that person as the package maintainer.
Sometimes you want to have a mailing list own a package so that bugzilla email is assigned to the mailing list.  Doing this requires adding a new pseudo user to the account system and assigning that person as the package maintainer.


{{ Template:notice/| In the following examples, replace ("xen", "kernel-xen-2.6") with the packages you are assigning to the new user and 9902 to the userid you select in step 2
{{ Template:Message/notice| In the following examples, replace ("xen", "kernel-xen-2.6") with the packages you are assigning to the new user and 9902 to the userid you select in step 2
}}
}}
1. Log into a box that can access db2.
* Log into a box that can access db2.
1. Log into the db as a user that can make changes
* Log into the db as a user that can make changes
<pre>
<pre>
$ psql -U apache -h db2 fedorausers
$ psql -U apache -h db2 fedorausers
fedorausers>
fedorausers>
</pre>
</pre>
1. Find the current pseudo-users
* Find the current pseudo-users
<pre>
<pre>
fedorausers>  select id, username from person where id < 10000 order by id;
fedorausers>  select id, username from person where id < 10000 order by id;
Line 43: Line 43:
9901 | anaconda-maint
9901 | anaconda-maint
</pre>
</pre>
1. Create a new account with the next available id after 9900
* Create a new account with the next available id after 9900
<pre>
<pre>
fedorausers> insert into person (id, username, email, human_name, password, creation,
fedorausers> insert into person (id, username, email, human_name, password, creation,
Line 49: Line 49:
'Xen Maintainers', '', now(), 'approved', 'Fedora');
'Xen Maintainers', '', now(), 'approved', 'Fedora');
</pre>
</pre>
1. Connect to the pkgdb as a user that can make changes
* Connect to the pkgdb as a user that can make changes
<pre>
<pre>
$ psql -U pkgdbadmin -h db2 pkgdb
$ psql -U pkgdbadmin -h db2 pkgdb
pkgdb>
pkgdb>
</pre>
</pre>
1. Add the current package owner as a comaintainer of the package.  If this user is not currently on he acls for the package you can use the following database queries:
* Add the current package owner as a comaintainer of the package.  If this user is not currently on he acls for the package you can use the following database queries:
<pre>
<pre>
insert into personpackagelisting (userid, packagelistingid)
insert into personpackagelisting (userid, packagelistingid)
Line 76: Line 76:
</pre>
</pre>
If the owner is in the acls, you will need to figure out which packages already acls and only add the new acls for that one.
If the owner is in the acls, you will need to figure out which packages already acls and only add the new acls for that one.
1. Reassign the pseudo-user to be the new owner
* Reassign the pseudo-user to be the new owner
<pre>
<pre>
update packagelisting set owner = 9902 from package as p
update packagelisting set owner = 9902 from package as p
where packagelisting.packageid = p.id and p.name in ('xen', 'kernel-xen-2.6');
where packagelisting.packageid = p.id and p.name in ('xen', 'kernel-xen-2.6');
</pre>
</pre>

Revision as of 20:02, 29 May 2008

Package Database - SOP

Contact Information

Owner: Fedora Infrastructure Team

Contact: #fedora-admin

Persons: abadger1999

Location: Phoenix

Servers: admin.fedoraproject.org -- app3 app4

Purpose: Manage package ownership

Description

The PackageDB is used by Fedora developers to manage package ownership and acls. It controls who is allowed to commit to a package and who gets notification of changes to packages.

PackageDB project Trac: https://fedorahosted.org/packagedb/

Troubleshooting and Resolution

Adding a new Pseudo User as a package owner

Sometimes you want to have a mailing list own a package so that bugzilla email is assigned to the mailing list. Doing this requires adding a new pseudo user to the account system and assigning that person as the package maintainer.

Idea.png
In the following examples, replace ("xen", "kernel-xen-2.6") with the packages you are assigning to the new user and 9902 to the userid you select in step 2
  • Log into a box that can access db2.
  • Log into the db as a user that can make changes
$ psql -U apache -h db2 fedorausers
fedorausers>
  • Find the current pseudo-users
fedorausers>  select id, username from person where id < 10000 order by id;
id  |     username
------+------------------
9900 | orphan
9901 | anaconda-maint
  • Create a new account with the next available id after 9900
fedorausers> insert into person (id, username, email, human_name, password, creation,
approval_status, otrs_orgid) values (9902, 'xen-maint', 'xen-maint@redhat.com',
'Xen Maintainers', '', now(), 'approved', 'Fedora');
  • Connect to the pkgdb as a user that can make changes
$ psql -U pkgdbadmin -h db2 pkgdb
pkgdb>
  • Add the current package owner as a comaintainer of the package. If this user is not currently on he acls for the package you can use the following database queries:
insert into personpackagelisting (userid, packagelistingid)
select pl.owner, pl.id from packagelisting as pl, package as p
where p.id = pl.packageid and p.name in ('xen', 'kernel-xen-2.6');
insert into personpackagelistingacl (personpackagelistingid, acl, statuscode)
select ppl.id, 'build', 3 from personpackagelisting as ppl, packagelisting as pl, package as p
where p.id = pl.packageid and pl.id = ppl.packagelistingid and pl.owner = ppl.userid
and p.name in ('xen', 'kernel-xen-2.6');
insert into personpackagelistingacl (personpackagelistingid, acl, statuscode)
select ppl.id, 'commit', 3 from personpackagelisting as ppl, packagelisting as pl, package as p
where p.id = pl.packageid and pl.id = ppl.packagelistingid
and pl.owner = ppl.userid
and p.name in ('xen', 'kernel-xen-2.6');
insert into personpackagelistingacl (personpackagelistingid, acl, statuscode)
select ppl.id, 'approveacls', 3 from personpackagelisting as ppl, packagelisting as pl, package as p
where p.id = pl.packageid and pl.id = ppl.packagelistingid
and pl.owner = ppl.userid
and p.name in ('xen', 'kernel-xen-2.6');

If the owner is in the acls, you will need to figure out which packages already acls and only add the new acls for that one.

  • Reassign the pseudo-user to be the new owner
update packagelisting set owner = 9902 from package as p
where packagelisting.packageid = p.id and p.name in ('xen', 'kernel-xen-2.6');