Skip to content

Commit

Permalink
Merge pull request cms-sw#152 from ktf/use-yaml-for-watcher
Browse files Browse the repository at this point in the history
Move all watchers to be in the yaml file.
  • Loading branch information
ktf committed Oct 14, 2014
2 parents 2ea402a + 7152669 commit 3c4ccc8
Show file tree
Hide file tree
Showing 4 changed files with 584 additions and 509 deletions.
3 changes: 1 addition & 2 deletions process-pull-request
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ from optparse import OptionParser
from categories import CMSSW_CATEGORIES, CMSSW_L2, CMSSW_L1
from releases import RELEASE_BRANCH_MILESTONE, RELEASE_BRANCH_PRODUCTION, RELEASE_BRANCH_CLOSED
from releases import RELEASE_MANAGERS
from watchers import WATCHERS
import yaml

import re
Expand Down Expand Up @@ -76,7 +75,7 @@ if __name__ == "__main__":
signing_categories.add("new-package")

# Add watchers.yaml information to the WATCHERS dict.
WATCHERS.update(yaml.load(file("watchers.yaml")))
WATCHERS = (yaml.load(file("watchers.yaml")))
# Given the packages check if there are additional developers watching one or more.
author = pr.user.login
watchers = set([user for package in packages
Expand Down
17 changes: 16 additions & 1 deletion tests/test_watchers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
#!/usr/bin/env python

from watchers import *
from releases import *
import yaml
import re
# Validate the schema of watchers.

KEY_RE = "[^@]+"
VALUE_RE = "[A-Za-z0-0.*+]"

w = yaml.load(open("watchers.yaml", "r"))
assert(type(w) == dict)
for (key, value) in w.items():
assert(type(key) == str)
assert(re.match(KEY_RE, key))
assert(type(value) == list)
for x in value:
assert(type(x) == str)
assert(re.match(VALUE_RE, x))
Loading

0 comments on commit 3c4ccc8

Please sign in to comment.