summaryrefslogtreecommitdiff
path: root/tools/releasedate.py
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2021-08-03 19:15:01 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2021-08-11 16:37:46 +0200
commitdc1c0bc2b31c66711e3a62b23cf973875df1f156 (patch)
treebadaad3ea5a160bfff6e03e21957a78761b2a367 /tools/releasedate.py
parent67831eeebb2e880bb7bcfae4c7d0aafe32730e3b (diff)
workflow: document release scheduling discussed
As discussed in the weekly meeting today, this is what we're trying to work with for the time being. (Date calculator included as a bonus goodie ;) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'tools/releasedate.py')
-rw-r--r--tools/releasedate.py59
1 files changed, 59 insertions, 0 deletions
diff --git a/tools/releasedate.py b/tools/releasedate.py
new file mode 100644
index 0000000000..37780501c3
--- /dev/null
+++ b/tools/releasedate.py
@@ -0,0 +1,59 @@
+#!/usr/bin/python3
+#
+# print FRR release schedule dates
+
+from datetime import datetime, date, timedelta
+
+w2 = timedelta(days=14)
+
+
+def year_gen(year):
+ for month in [3, 7, 11]:
+ d = date(year, month, 1)
+ if d.weekday() == 0:
+ d += timedelta(days=1)
+ elif d.weekday() >= 2:
+ d += timedelta(days=8 - d.weekday())
+ yield d
+
+
+def calc(refdate):
+ year = refdate.year
+
+ prev = list(year_gen(year - 1))[-1]
+ releases = list(year_gen(year)) + list(year_gen(year + 1))
+
+ while refdate > releases[0]:
+ prev = releases.pop(0)
+
+ return (prev, releases)
+
+
+if __name__ == "__main__":
+ now = datetime.now().date()
+ last, upcoming = calc(now)
+
+ print("Last release was (scheduled) on %s" % last.isoformat())
+
+ rel = upcoming.pop(0)
+ freeze, rc1, rc2 = rel - w2 * 3, rel - w2 * 2, rel - w2
+
+ if now == rel:
+ print("It's release day! 🎉")
+ elif now >= rc2:
+ print(
+ "%d days until release! (rc2 since %s)"
+ % ((rel - now).days, rc2.isoformat())
+ )
+ elif now >= rc1:
+ print("%d days until rc2. (rc1 since %s)" % ((rc2 - now).days, rc1.isoformat()))
+ elif now >= freeze:
+ print(
+ "%d days until rc1, master is frozen since %s"
+ % ((rc1 - now).days, freeze.isoformat())
+ )
+ else:
+ print(
+ "%d days of hacking time left! (Freeze on %s)"
+ % ((freeze - now).days, freeze.isoformat())
+ )