blob: a09bdc1902c676c3939fed973371399150ce449d [file]
"""Recipe for running config validation checks on the given build."""
from slave import base_recipe
from slave.step import json_check_step
from slave.step import xml_check_step
PROJECT_CONFIGS = {
'chromium/src': {
'deny_list_filter': ['.*'],
}
}
def GetValidBuildNames():
return ['config_validator']
def CreateRecipe(build_name: str, **kwargs):
"""Builds a recipe object."""
del build_name # Unused.
return ConfigValidatorRecipe(**kwargs)
class ConfigValidatorRecipe(base_recipe.BaseRecipe):
"""Recipe to run config validatoins on a repository."""
def __init__(self, **kwargs):
base_recipe.BaseRecipe.__init__(self, **kwargs)
self._config = PROJECT_CONFIGS.get(
self._properties.get('patch_project'), {})
self._deny_list_filter = self._config.get('deny_list_filter')
def get_steps(self):
return [
json_check_step.JsonCheckStep(deny_list_filter=self._deny_list_filter,
**self._step_kwargs),
xml_check_step.XmlCheckStep(deny_list_filter=self._deny_list_filter,
**self._step_kwargs),
]