From 43452c951404367324dbfceefae45800608b28fe Mon Sep 17 00:00:00 2001 From: saptaks Date: Nov 30 2016 22:35:28 +0000 Subject: [PATCH 1/3] Release widget frontend design added --- diff --git a/hubs/static/css/style.css b/hubs/static/css/style.css index 77714a6..b53c576 100644 --- a/hubs/static/css/style.css +++ b/hubs/static/css/style.css @@ -409,3 +409,29 @@ header h5.m-b-1 { .card .panel-footer { padding-bottom: 2rem; /* fixes request new meeting button padding on the upcoming meeting widget */ } + + +/** Release widget style **/ + +.release .milestone-img { + padding: 1vh 0; +} + +.release h5.milestone-label { + margin: 3vh 0; +} + +.release .milestone-line { + position: absolute; + height: 80%; + width: 2%; + margin: 10% 13.5%; + background-color: #e8e8e8; +} + +.release .milestone-line .milestone-inner { + top: 50%; + height:50%; + background-color: #3c6eb4; +} +/** End of release widget style */ diff --git a/hubs/static/img/release/branch-inactive.png b/hubs/static/img/release/branch-inactive.png new file mode 100644 index 0000000..a0909de Binary files /dev/null and b/hubs/static/img/release/branch-inactive.png differ diff --git a/hubs/static/img/release/branch.png b/hubs/static/img/release/branch.png new file mode 100644 index 0000000..7ee5a95 Binary files /dev/null and b/hubs/static/img/release/branch.png differ diff --git a/hubs/static/img/release/final-inactive.png b/hubs/static/img/release/final-inactive.png new file mode 100644 index 0000000..fbe2a94 Binary files /dev/null and b/hubs/static/img/release/final-inactive.png differ diff --git a/hubs/static/img/release/final.png b/hubs/static/img/release/final.png new file mode 100644 index 0000000..a890d7f Binary files /dev/null and b/hubs/static/img/release/final.png differ diff --git a/hubs/static/img/release/freeze-inactive.png b/hubs/static/img/release/freeze-inactive.png new file mode 100644 index 0000000..feeecae Binary files /dev/null and b/hubs/static/img/release/freeze-inactive.png differ diff --git a/hubs/static/img/release/freeze.png b/hubs/static/img/release/freeze.png new file mode 100644 index 0000000..09cedbd Binary files /dev/null and b/hubs/static/img/release/freeze.png differ diff --git a/hubs/static/img/release/release-inactive.png b/hubs/static/img/release/release-inactive.png new file mode 100644 index 0000000..0bb558c Binary files /dev/null and b/hubs/static/img/release/release-inactive.png differ diff --git a/hubs/static/img/release/release.png b/hubs/static/img/release/release.png new file mode 100644 index 0000000..c0c9327 Binary files /dev/null and b/hubs/static/img/release/release.png differ diff --git a/hubs/widgets/__init__.py b/hubs/widgets/__init__.py index 5f416ed..323344a 100755 --- a/hubs/widgets/__init__.py +++ b/hubs/widgets/__init__.py @@ -18,6 +18,7 @@ from hubs.widgets import bugzilla from hubs.widgets import fhosted from hubs.widgets import memberships from hubs.widgets import contact +from hubs.widgets import release from hubs.widgets.workflow import pendingacls from hubs.widgets.workflow import updates2stable @@ -45,7 +46,7 @@ registry = { 'fedorahosted': fhosted, 'memberships': memberships, 'contact': contact, - + 'release':release, 'workflow.pendingacls': pendingacls, 'workflow.updates2stable': updates2stable, } diff --git a/hubs/widgets/release.py b/hubs/widgets/release.py new file mode 100644 index 0000000..a5070b5 --- /dev/null +++ b/hubs/widgets/release.py @@ -0,0 +1,14 @@ +from hubs.widgets.chrome import panel +from hubs.hinting import hint +from hubs.widgets.base import argument +from hubs.widgets import templating +import hubs.validators as validators + +chrome = panel("Release Widget") +template = templating.environment.get_template('templates/release.html') +position = 'right' + +def data(session, widget, text=42): + ''' Release widget ''' + + return dict(text=text) \ No newline at end of file diff --git a/hubs/widgets/templates/release.html b/hubs/widgets/templates/release.html new file mode 100644 index 0000000..b41df35 --- /dev/null +++ b/hubs/widgets/templates/release.html @@ -0,0 +1,61 @@ +
+
+
+
+
+
+ +
+
+
Fedora Release 24
+
+
+
+
+ +
+
+
Final freeze 2016-05-31
+
+
+
+
+ +
+
+
Beta release 2016-05-10
+
+
+
+
+ +
+
+
Beta freeze 2016-04-19
+
+
+
+
+ +
+
+
Alpha release 2016-03-29
+
+
+
+
+ +
+
+
Alpha freeze 2016-03-08
+
+
+
+
+ +
+
+
Fedora 24 Branch 2016-02-23
+
+
+
\ No newline at end of file From aea8408f6a606851953de4b37f051648339c1463 Mon Sep 17 00:00:00 2001 From: saptaks Date: Nov 30 2016 22:35:28 +0000 Subject: [PATCH 2/3] Added release status view; Tabular navigation between 2 views --- diff --git a/hubs/static/css/style.css b/hubs/static/css/style.css index b53c576..3201fb9 100644 --- a/hubs/static/css/style.css +++ b/hubs/static/css/style.css @@ -413,6 +413,10 @@ header h5.m-b-1 { /** Release widget style **/ +.release { + color: #373a3c; +} + .release .milestone-img { padding: 1vh 0; } @@ -423,15 +427,60 @@ header h5.m-b-1 { .release .milestone-line { position: absolute; - height: 80%; + height: 55%; width: 2%; - margin: 10% 13.5%; + margin: 10% 8%; background-color: #e8e8e8; } .release .milestone-line .milestone-inner { + position: absolute; top: 50%; - height:50%; + height: 50%; + width: 100%; background-color: #3c6eb4; } + +.release h4 { + font-weight:bold; + font-size: 1em; +} + +.release .milestone-label { + margin-top: 3%; +} + +.release .milestone-label h4 { + display: inline; +} + +.release .milestone-label span { + float: right; + font-weight: 100; +} + +.release-details { + text-align: right; +} + +.release-details .ga { + font-weight: bold; +} + +.release-details .beta { + font-weight: bold; + color: purple; +} + +.border { + border-left: black 1vw solid;; +} + +.border.blue { + border-left: #3c6eb4 1vw solid;; +} + +.border.green { + border-left: #79db32 1vw solid;; +} /** End of release widget style */ diff --git a/hubs/static/img/release/branch-inactive.png b/hubs/static/img/release/branch-inactive.png deleted file mode 100644 index a0909de..0000000 Binary files a/hubs/static/img/release/branch-inactive.png and /dev/null differ diff --git a/hubs/static/img/release/branch.png b/hubs/static/img/release/branch.png deleted file mode 100644 index 7ee5a95..0000000 Binary files a/hubs/static/img/release/branch.png and /dev/null differ diff --git a/hubs/static/img/release/final-inactive.png b/hubs/static/img/release/final-inactive.png deleted file mode 100644 index fbe2a94..0000000 Binary files a/hubs/static/img/release/final-inactive.png and /dev/null differ diff --git a/hubs/static/img/release/final.png b/hubs/static/img/release/final.png deleted file mode 100644 index a890d7f..0000000 Binary files a/hubs/static/img/release/final.png and /dev/null differ diff --git a/hubs/static/img/release/freeze-inactive.png b/hubs/static/img/release/freeze-inactive.png deleted file mode 100644 index feeecae..0000000 Binary files a/hubs/static/img/release/freeze-inactive.png and /dev/null differ diff --git a/hubs/static/img/release/freeze.png b/hubs/static/img/release/freeze.png deleted file mode 100644 index 09cedbd..0000000 Binary files a/hubs/static/img/release/freeze.png and /dev/null differ diff --git a/hubs/static/img/release/release-inactive.png b/hubs/static/img/release/release-inactive.png deleted file mode 100644 index 0bb558c..0000000 Binary files a/hubs/static/img/release/release-inactive.png and /dev/null differ diff --git a/hubs/static/img/release/release-widget_branch_active.png b/hubs/static/img/release/release-widget_branch_active.png new file mode 100644 index 0000000..9b858da Binary files /dev/null and b/hubs/static/img/release/release-widget_branch_active.png differ diff --git a/hubs/static/img/release/release-widget_branch_inactive.png b/hubs/static/img/release/release-widget_branch_inactive.png new file mode 100644 index 0000000..2e51b9e Binary files /dev/null and b/hubs/static/img/release/release-widget_branch_inactive.png differ diff --git a/hubs/static/img/release/release-widget_code-freeze_active.png b/hubs/static/img/release/release-widget_code-freeze_active.png new file mode 100644 index 0000000..a05bfc4 Binary files /dev/null and b/hubs/static/img/release/release-widget_code-freeze_active.png differ diff --git a/hubs/static/img/release/release-widget_code-freeze_inactive.png b/hubs/static/img/release/release-widget_code-freeze_inactive.png new file mode 100644 index 0000000..62be22b Binary files /dev/null and b/hubs/static/img/release/release-widget_code-freeze_inactive.png differ diff --git a/hubs/static/img/release/release-widget_freeze_active.png b/hubs/static/img/release/release-widget_freeze_active.png new file mode 100644 index 0000000..aad8e6c Binary files /dev/null and b/hubs/static/img/release/release-widget_freeze_active.png differ diff --git a/hubs/static/img/release/release-widget_freeze_inactive.png b/hubs/static/img/release/release-widget_freeze_inactive.png new file mode 100644 index 0000000..6c8d5cd Binary files /dev/null and b/hubs/static/img/release/release-widget_freeze_inactive.png differ diff --git a/hubs/static/img/release/release-widget_pre-release_active.png b/hubs/static/img/release/release-widget_pre-release_active.png new file mode 100644 index 0000000..a05bfc4 Binary files /dev/null and b/hubs/static/img/release/release-widget_pre-release_active.png differ diff --git a/hubs/static/img/release/release-widget_pre-release_inactive.png b/hubs/static/img/release/release-widget_pre-release_inactive.png new file mode 100644 index 0000000..62be22b Binary files /dev/null and b/hubs/static/img/release/release-widget_pre-release_inactive.png differ diff --git a/hubs/static/img/release/release-widget_release_active.png b/hubs/static/img/release/release-widget_release_active.png new file mode 100644 index 0000000..35f86d8 Binary files /dev/null and b/hubs/static/img/release/release-widget_release_active.png differ diff --git a/hubs/static/img/release/release-widget_release_inactive.png b/hubs/static/img/release/release-widget_release_inactive.png new file mode 100644 index 0000000..9eae41d Binary files /dev/null and b/hubs/static/img/release/release-widget_release_inactive.png differ diff --git a/hubs/static/img/release/release.png b/hubs/static/img/release/release.png deleted file mode 100644 index c0c9327..0000000 Binary files a/hubs/static/img/release/release.png and /dev/null differ diff --git a/hubs/widgets/templates/release.html b/hubs/widgets/templates/release.html index b41df35..5045e06 100644 --- a/hubs/widgets/templates/release.html +++ b/hubs/widgets/templates/release.html @@ -1,61 +1,131 @@
-
-
-
-
-
- -
-
-
Fedora Release 24
-
-
-
-
- -
-
-
Final freeze 2016-05-31
-
-
-
-
- -
-
-
Beta release 2016-05-10
-
-
-
-
- -
-
-
Beta freeze 2016-04-19
-
-
-
-
- -
-
-
Alpha release 2016-03-29
-
-
-
-
- -
-
-
Alpha freeze 2016-03-08
-
-
-
-
- -
-
-
Fedora 24 Branch 2016-02-23
-
-
+ +
+ +
+
+
+
+
+
+ +
+
+

Fedora 25 GA

15 Nov 2016 +
+
+
+
+ +
+
+

Final freeze

01 Nov 2016 +
+
+
+
+ +
+
+

Beta release

27 Oct 2016 +
+
+
+
+ +
+
+

Beta freeze

27 Sept 2016 +
+
+
+
+ +
+
+

Alpha release

30 Aug 2016 +
+
+
+
+ +
+
+

Alpha freeze

09 Aug 2016 +
+
+
+
+ +
+
+

Fedora 25 Branch

26 Jul 2016 +
+

+
+
Full release schedule >
+
+
+ + +
+
+
+

Rawhide

+
+
+ fedora-release-26-0.1 +

Rawhide

+
+

+
+
+

Fedora 25

+
+
+ fedora-release-25-0.11 + +

Beta11 Oct 2016

+

GA15 Nov 2016

+
+
+

+
+
+

Fedora 24

+
+
+ fedora-release-24-2 + +

GA21 Jun 2016

+
+
+

+
+
+

Fedora 23

+
+
+ fedora-release-23-1 + +

GA03 Nov 2015

+
+
+

+
+
+

Fedora 23

+
+
+ fedora-release-23-1 + +

GA03 Nov 2015

+
+
+
+
+
\ No newline at end of file From 7e2de38d25240ce16027e7992d53c54ccda3bdf4 Mon Sep 17 00:00:00 2001 From: Vivek Anand Date: Dec 05 2016 10:01:58 +0000 Subject: [PATCH 3/3] Release widget backend --- diff --git a/hubs/widgets/release.py b/hubs/widgets/release.py index a5070b5..e750b19 100644 --- a/hubs/widgets/release.py +++ b/hubs/widgets/release.py @@ -1,3 +1,9 @@ +#!/usr/bin/env python +# coding=utf-8 + +import re +import requests + from hubs.widgets.chrome import panel from hubs.hinting import hint from hubs.widgets.base import argument @@ -8,7 +14,75 @@ chrome = panel("Release Widget") template = templating.environment.get_template('templates/release.html') position = 'right' -def data(session, widget, text=42): - ''' Release widget ''' - return dict(text=text) \ No newline at end of file +@argument(name="text", default="This is the release_cycle widget", + validator=validators.text, + help="Release cycle widget") +def data(): + '''Data for Release cycle widget. Queries and parses - + https://fedorapeople.org/groups/schedule to get the latest 4 + fedora releases + + Example dict: + { + 'f-25': [ + { + 'summary': 'Alpha Release' + 'date_started': '20160606T210000Z', + 'finish_date': '20161128T053047Z', + }, + { + 'summary': 'Beta Release', + 'date_started': '20160606T210000Z', + 'finish_date': '20161128T053047Z', + } + ] + } + ''' + + base_url = 'https://fedorapeople.org/groups/schedule' + base_page = requests.get(base_url).text + + # get the top three, in increasing order like - [23, 24, 25, 26] + releases = sorted(re.findall('>f-(..)/<', base_page))[-4:] + release_info = {} + for release in releases: + r_info = get_release_info(release, base_url) + release_info['f-%s' % release] = r_info + + return release_info + + +@hint(topics=[_('hubs.widget.update')]) +def should_invalidate(message, session, widget): + ''' Checks whether the Release Cycle widget cache needs an update or not + Called by backend daemon which listens to fedmsg ''' + + raise NotImplementedError + + +def get_release_info(release, base_url): + ''' Given the release number, returns a list of dicts with the fields: + summary, start_date and finish_date. The summary will be out of something + like: Alpha Freeze, Alpha Release, Beta Freeze, Beta Release, Final Freeze, + Final Release Public Availability (GA)''' + + required_data = [ + 'Alpha Freeze (00:00 UTC)', + 'Alpha Release', 'Beta Release', + 'Beta Freeze (00:00 UTC)', 'Final Freeze (00:00 UTC)', + 'Final Release Public Availability (GA)' + ] + base_release_link = base_url + '/f-%s/' % release + release_info_file = base_release_link + 'f-%s-all-milestones.ics' % release + ics = requests.get(release_info_file).text + gcal = Calendar.from_ical(ics) + events = [] + for component in gcal.walk(): + if component['SUMMARY'] in required_data: + event = {} + event['summary'] = component['SUMMARY'] + event['start_date'] = component['DTSTART'] + event['finish_date'] = component['COMPLETED'] + events.append(event) + return events diff --git a/requirements.txt b/requirements.txt index a63b658..5b801e3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,3 +22,4 @@ six pygments pygments-markdown-lexer retask +icalendar