Figure out for how long a package has been orphaned #14

Open
opened 2026-05-10 05:02:04 +00:00 by gotmax23 · 1 comment
Owner

As part of the report, we need to figure out when a package was orphaned. The previous script did this by looking at the date_modified field from the Pagure projects API. I don't like particularly like this approach, since the date_modified field can be moved forward if another user/group member with admin access makes other changes to the project's ACLs after the date/time it was originally orphaned. Also, I'm trying to avoid dealing with the Pagure projects API and instead rely on Koji (which we need to query anyways to figure out whether a package is blocked) and the https://src.fedoraproject.org/extras/ data (see also #10).

It looks like we can instead get this data from Koji1. The question is whether we can rely on this data over the Pagure data and how/when the Koji tag package ownership is changed after a package is orphaned. The koji history says the bodhi user set the owner, but I'm not sure where that happens. Maybe it's part of the compose process?

More investigation is needed.


  1. import datetime as dt
    import koji
    KOJIHUB = "https://koji.fedoraproject.org/kojihub"
    session = koji.ClientSession(KOJIHUB)
    hist = session.queryHistory(tables=["tag_package_owners"], package="rust-bisection", tag="f45")
    # {'tag_package_owners': [{'active': True,
    #    'create_event': 169890068,
    #    'create_ts': 1776054723.842764,
    #    'creator_id': 428,
    #    'creator_name': 'bodhi',
    #    'owner': 440,
    #    'owner.name': 'orphan',
    #    'package.name': 'rust-bisection',
    #    'package_id': 40094,
    #    'revoke_event': None,
    #    'revoke_ts': None,
    #    'revoker_id': None,
    #    'revoker_name': None,
    #    'tag.name': 'f45',
    #    'tag_id': 128147},
    #   {'active': None,
    #    'create_event': 166063079,
    #    'create_ts': 1770322336.923568,
    #    'creator_id': 3445,
    #    'creator_name': 'releng',
    #    'owner': 3183,
    #    'owner.name': 'music',
    #    'package.name': 'rust-bisection',
    #    'package_id': 40094,
    #    'revoke_event': 169890068,
    #    'revoke_ts': 1776054723.842764,
    #    'revoker_id': 428,
    #    'revoker_name': 'bodhi',
    #    'tag.name': 'f45',
    #    'tag_id': 128147}]}
    t = dt.datetime.fromtimestamp(hist["tag_package_owners"][0]["create_ts"], dt.UTC)
    t.isoformat()  # '2026-04-13T04:32:03.842764+00:00'
    
    ↩︎
As part of the report, we need to figure out when a package was orphaned. The previous script did this by looking at the `date_modified` field from the Pagure projects API. I don't like particularly like this approach, since the `date_modified` field can be moved forward if another user/group member with `admin` access makes other changes to the project's ACLs after the date/time it was originally orphaned. Also, I'm trying to avoid dealing with the Pagure projects API and instead rely on Koji (which we need to query anyways to figure out whether a package is blocked) and the https://src.fedoraproject.org/extras/ data (see also #10). It looks like we can instead get this data from Koji[^1]. The question is whether we can rely on this data over the Pagure data and how/when the Koji tag package ownership is changed after a package is orphaned. The koji history says the `bodhi` user set the owner, but I'm not sure where that happens. Maybe it's part of the compose process? More investigation is needed. [^1]: ``` python import datetime as dt import koji KOJIHUB = "https://koji.fedoraproject.org/kojihub" session = koji.ClientSession(KOJIHUB) hist = session.queryHistory(tables=["tag_package_owners"], package="rust-bisection", tag="f45") # {'tag_package_owners': [{'active': True, # 'create_event': 169890068, # 'create_ts': 1776054723.842764, # 'creator_id': 428, # 'creator_name': 'bodhi', # 'owner': 440, # 'owner.name': 'orphan', # 'package.name': 'rust-bisection', # 'package_id': 40094, # 'revoke_event': None, # 'revoke_ts': None, # 'revoker_id': None, # 'revoker_name': None, # 'tag.name': 'f45', # 'tag_id': 128147}, # {'active': None, # 'create_event': 166063079, # 'create_ts': 1770322336.923568, # 'creator_id': 3445, # 'creator_name': 'releng', # 'owner': 3183, # 'owner.name': 'music', # 'package.name': 'rust-bisection', # 'package_id': 40094, # 'revoke_event': 169890068, # 'revoke_ts': 1776054723.842764, # 'revoker_id': 428, # 'revoker_name': 'bodhi', # 'tag.name': 'f45', # 'tag_id': 128147}]} t = dt.datetime.fromtimestamp(hist["tag_package_owners"][0]["create_ts"], dt.UTC) t.isoformat() # '2026-04-13T04:32:03.842764+00:00' ```
gotmax23 changed title from Figure out for how long as package has been orphaned to Figure out for how long a package has been orphaned 2026-05-20 02:25:39 +00:00
Author
Owner

This was basically implemented in 90cf80f417 (diff-10e2dde02).

This was basically implemented in https://forge.fedoraproject.org/packaging/orphansv2/commit/90cf80f4170ad302880af16fb327a87bbd246942#diff-10e2dde020245d94eff24379c93ec11e1d9be7e3.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
packaging/orphansv2#14
No description provided.