Skip to content

Instantly share code, notes, and snippets.

@thcipriani
Last active May 4, 2018 20:47
Show Gist options
  • Save thcipriani/2d19626eb49f80cd33a949a318b830df to your computer and use it in GitHub Desktop.
Save thcipriani/2d19626eb49f80cd33a949a318b830df to your computer and use it in GitHub Desktop.

SWAT deploys from 2018-01-02–2018-03-09

Deployment dates and window times scraped from the deployment archive. Times deteremined by hand via the production sal tool (aside: it'd be great to just have this data).

SWAT deploys with > 8 patches

Only 1 took less than the time alotted, 2 out of 7 actually deployed all 8 patches

(/^ヮ^)/*:・゚✧ awk '{if ($4 >= 8) print}' tmp/swats
2018-01-02 - Europe: 8 patches - 14:00-15:05 - 1:05 - 6/8
2018-01-03 - Evening: 8 patches - 00:00-01:01 - 1:01
2018-01-08 - Europe: 8 patches - 14:00-15:03 - 1:03
2018-01-29 - Europe: 9 patches - 14:00-14:58 - 0:58 - 4/9
2018-02-06 - Europe: 10 patches - 14:00-15:02 - 1:02 - 7/10
2018-02-13 - Europe: 8 patches - 14:00-15:01 - 1:01 - 5/8
2018-02-28 - Europe: 8 patches - 14:00-15:16 - 1:16 - 7/8

SWAT deploys with < 8 patches

We've also haven't managed to deploy 7 patches in < 1 hour

~
(/^ヮ^)/*:・゚✧ awk '{if ($4 == 7) print $4,"patches","in",$9,$11}' tmp/swats
7 patches in 1:19 
7 patches in 1:31 5/7
7 patches in 1:32 
7 patches in 0:57 5/7

Deploys with 5 or 6 patches seem to regularly be deployed i nthe allotted time

(/^ヮ^)/*:・゚✧ awk '{if ($4 < 7 && $4 > 4) print $4,"patches","in",$9,$11}' tmp/swats
5 patches in 0:30 
6 patches in 0:50 
5 patches in 1:04 
6 patches in 0:43 
6 patches in 1:15
6 patches in 0:46 
5 patches in 1:15 
6 patches in 0:55 3/6
5 patches in 0:40 
5 patches in 0:43 
5 patches in 1:08 
5 patches in 0:46 
6 patches in 0:55 
6 patches in 1:02 
5 patches in 0:51 
2018-01-02 - Europe: 8 patches - 14:00-15:05 - 1:05 - 6/8
2018-01-03 - Evening: 8 patches - 00:00-01:01 - 1:01
2018-01-03 - Europe: 5 patches - 14:00-14:30 - 0:30
2018-01-03 - Morning: 7 patches - 19:00-20:19 - 1:19
2018-01-04 - Evening: 1 patches - 0-0 - 0:00
2018-01-04 - Europe: 2 patches - 14:00-14:24 - 0:24
2018-01-04 - Morning: 0 patches - 0-0 - 0:00
2018-01-05 - Evening: 0 patches - 0-0 - 0:00
2018-01-08 - Europe: 8 patches - 14:00-15:03 - 1:03
2018-01-08 - Morning: 1 patches - 0-0 - 0:00
2018-01-09 - Evening: 0 patches - 0-0 - 0:00
2018-01-09 - Europe: 1 patches - 0-0 - 0:00
2018-01-10 - Evening: 0 patches - 0-0 - 0:00
2018-01-10 - Europe: 6 patches - 14:00-14:50 - 0:50
2018-01-10 - Morning: 1 patches - 0-0 - 0:00
2018-01-11 - Evening: 1 patches - 0-0 - 0:00
2018-01-11 - Europe: 1 patches - 0-0 - 0:00
2018-01-11 - Morning: 5 patches - 19:00-20:04 - 1:04
2018-01-12 - Evening: 1 patches - 0-0 - 0:00
2018-01-15 - Europe: 2 patches - 14:00-14:41 - 0:41
2018-01-15 - Morning: 0 patches - 0-0 - 0:00
2018-01-16 - Evening: 1 patches - 0-0 - 0:00
2018-01-16 - Europe: 1 patches - 0-0 - 0:00
2018-01-17 - Evening: 4 patches - 00:00-00:28 - 0:28
2018-01-17 - Europe: 2 patches - 14:00-14:27 - 0:27
2018-01-18 - Evening: 3 patches - 00:00-01:01 - 1:01
2018-01-18 - Europe: 2 patches - 0-0 - 0:00
2018-01-18 - Morning: 3 patches - 19:00-20:09 - 1:09
2018-01-19 - Evening: 2 patches - 00:00-00:19 - 0:19
2018-01-22 - Europe: 6 patches - 14:00-14:43 - 0:43
2018-01-22 - Morning: 4 patches - 19:00-19:35 - 0:35
2018-01-23 - Evening: 0 patches - 0-0 - 0:00
2018-01-23 - Europe: 2 patches - 14:00-14:36 - 0:36
2018-01-24 - Evening: 1 patches - 0-0 - 0:00
2018-01-24 - Europe: 0 patches - 0-0 - 0:00
2018-01-25 - Evening: 0 patches - 0-0 - 0:00
2018-01-29 - Europe: 9 patches - 14:00-14:58 - 0:58 - 4/9
2018-01-29 - Morning: 6 patches - 19:00-20:15 - 1:15
2018-02-05 - Europe: 6 patches - 14:00-14:46 - 0:46
2018-02-05 - Morning: 3 patches - 19:00-19:44 - 0:44
2018-02-06 - Evening: 3 patches - 00:00-01:47 - 1:47
2018-02-06 - Europe: 10 patches - 14:00-15:02 - 1:02 - 7/10
2018-02-07 - Evening: 4 patches - 00:00-01:05 - 1:05
2018-02-07 - Europe: 2 patches - 14:00-14:33 - 0:33
2018-02-08 - Evening: 2 patches - 00:00-00:35 - 0:35
2018-02-08 - Europe: 1 patches - 14:00-14:43 - 0:43
2018-02-08 - Morning: 3 patches - 19:00-19:24 - 0:24
2018-02-09 - Evening: 1 patches - 0-0 - 0:00
2018-02-12 - Europe: 1 patches - 0-0 - 0:00
2018-02-12 - Morning: 3 patches - 19:00-19:12 - 0:12
2018-02-13 - Evening: 1 patches - 0-0 - 0:00
2018-02-13 - Europe: 8 patches - 14:00-15:01 - 1:01 - 5/8
2018-02-14 - Evening: 2 patches - 00:00-00:25 - 0:25
2018-02-14 - Europe: 7 patches - 14:00-15:31 - 1:31 - 5/7
2018-02-15 - Evening: 1 patches - 0-0 - 0:00
2018-02-15 - Europe: 5 patches - 14:00-15:15 - 1:15
2018-02-15 - Morning: 6 patches - 19:00-19:55 - 0:55 - 3/6
2018-02-16 - Evening: 1 patches - 0-0 - 0:00
2018-02-20 - Europe: 5 patches - 14:00-14:40 - 0:40
2018-02-21 - Evening: 5 patches - 00:00-00:43 - 0:43
2018-02-21 - Europe: 5 patches - 14:00-15:08 - 1:08
2018-02-22 - Evening: 1 patches - 0-0 - 0:00
2018-02-22 - Europe: 2 patches - 14:00-14:58 - 0:58
2018-02-22 - Morning: 3 patches - 0-0 - 0:00 - maybe didn't happen?
2018-02-23 - Evening: 0 patches - 0-0 - 0:00
2018-02-26 - Europe: 7 patches - 14:00-15:32 - 1:32
2018-02-26 - Morning: 5 patches - 19:00-19:46 - 0:46
2018-02-27 - Evening: 6 patches - 00:00-00:55 - 0:55
2018-02-27 - Europe: 6 patches - 14:00-15:02 - 1:02
2018-02-28 - Evening: 1 patches - 0-0 - 0:00
2018-02-28 - Europe: 8 patches - 14:00-15:16 - 1:16 - 7/8
2018-03-01 - Evening: 3 patches - 00:00-00:43 - 0:43
2018-03-01 - Europe: 4 patches - 14:00-15:19 - 1:19
2018-03-01 - Morning: 4 patches - 19:00-20:15 - 1:15
2018-03-02 - Evening: 3 patches - 00:00-00:46 - 0:46
2018-03-05 - Europe: 7 patches - 14:00-14:57 - 0:57 - 5/7
2018-03-05 - Morning: 5 patches - 19:00-19:51 - 0:51
2018-03-06 - Evening: 1 patches - 0-0 - 0:00
2018-03-06 - Europe: 4 patches - 14:00-15:39 - 1:39 - something wrong on tin
2018-03-07 - Evening: 4 patches - 00:00-00:57 - 0:57
2018-03-07 - Europe: 4 patches - 14:00-14:45 - 0:45
2018-03-08 - Evening: 3 patches - 00:00-00:37 - 0:37
2018-03-08 - Europe: 4 patches - 14:00-14:38 - 0:38
2018-03-08 - Morning: 3 patches - 19:00-19:52 - 0:52
2018-03-09 - Evening: 1 patches - 0-0 - 0:00
#!/usr/bin/env python3
import requests
from datetime import datetime
from bs4 import BeautifulSoup
BASE = 'https://wikitech.wikimedia.org/wiki/Deployments/Archive/2018/0'
def get_window_name(datetime):
if datetime.endswith('0000'):
return 'Evening'
if datetime.endswith('1400'):
return 'Europe'
if datetime.endswith('1900'):
return 'Morning'
return False
for month in range(1, 5):
r = requests.get(BASE + str(month))
r.raise_for_status()
soup = BeautifulSoup(r.text.encode('utf8'), 'html.parser')
swats = soup.find_all('a', attrs={'title': 'SWAT deploys'})
for swat in swats:
slot = swat.find_parent(attrs={'class': 'deploycal-item'})
if not slot:
continue
window = slot['id'].split('-')[-1]
window_name = get_window_name(window)
if not window_name:
continue
window = datetime.strptime(window, '%Y%m%dT%H%M')
date = datetime.strftime(window, '%Y-%m-%d')
slots = slot.find_all('td')
patches = slots[-1]
gerrit_patches = patches.find_all('a')
total_patches = 0
for gerrit_patch in gerrit_patches:
href = gerrit_patch['href']
if not href.startswith('https://gerrit.wikimedia.org'):
continue
total_patches += 1
if total_patches > 4:
print('{} - {}: {} patches'.format(date, window_name, total_patches))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment