| |
@@ -23,8 +23,31 @@
|
| |
from oraculum import app, CACHE
|
| |
from oraculum.utils import cache_utils, dashboard
|
| |
|
| |
+ def handle_orphan_user():
|
| |
+ empty = {'status': 200, 'data': {}}
|
| |
+ static_info = {
|
| |
+ 'packages': [],
|
| |
+ 'group_packages': {},
|
| |
+ 'primary_packages': [],
|
| |
+ 'orphans': {},
|
| |
+ 'fails_to_install': {},
|
| |
+ 'updates': {},
|
| |
+ 'overrides': {},
|
| |
+ 'koschei': {}
|
| |
+ }
|
| |
+
|
| |
+ orphans_data = CACHE.get('orphans_json')
|
| |
+ static_info['packages'] = list(orphans_data['affected_packages'].keys())
|
| |
+ static_info['primary_packages'] = static_info['packages']
|
| |
+ static_info['orphans'] = dashboard.get_orphans(static_info['packages'])
|
| |
+
|
| |
+ return {'static_info': static_info, 'prs': empty, 'bzs': empty, 'package_versions': empty}
|
| |
+
|
| |
+
|
| |
@app.route('/api/v1/packager_dashboard/<user>', methods=['GET'])
|
| |
def route_dashboard_user_data(user):
|
| |
+ if user == 'orphan':
|
| |
+ return jsonify(handle_orphan_user())
|
| |
packages_promise = CACHE.async_get('packager-dashboard_user_data_static', 'high', user)
|
| |
last_synced = CACHE.get_refreshed_time('packager-dashboard_user_data_static', user)
|
| |
if packages_promise == cache_utils.RefresherNotRegistered:
|
| |
Handle
orphan
user in the packager_dashboard differently, and onlyreturn data for all orphaned packages, so people can easily have a
one-stop-shop for seeing the orphaned (and affected) packages
Fixes https://pagure.io/fedora-qa/packager_dashboard/issue/48