sentry.py (992B)
1 # This Source Code Form is subject to the terms of the Mozilla Public 2 # License, v. 2.0. If a copy of the MPL was not distributed with this 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 5 from taskgraph.transforms.base import TransformSequence 6 7 transforms = TransformSequence() 8 9 10 @transforms.add 11 def sentry(config, tasks): 12 """Do transforms specific to github-sync tasks.""" 13 if config.params["project"] not in ["mozilla-central", "try"]: 14 return 15 for task in tasks: 16 scopes = [ 17 scope.format(level=config.params["level"]) for scope in task["scopes"] 18 ] 19 task["scopes"] = scopes 20 21 env = { 22 key: value.format( 23 level=config.params["level"], 24 head_repository=config.params["head_repository"], 25 head_rev=config.params["head_rev"], 26 ) 27 for (key, value) in task["worker"]["env"].items() 28 } 29 task["worker"]["env"] = env 30 yield task