def __init__(self, tree_status_url, tree_message=None, check_revisions=True, throttle=False, gitpoller_paths=None, branches=None, **kwargs): """Constructor with following specific arguments (on top of base class'). @type tree_status_url: String. @param tree_status_url: Web end-point for tree status updates. @type tree_message: String. @param tree_message: Message posted to the tree status site when closed. @type check_revisions: Boolean, default to True. @param check_revisions: Check revisions and users for closing the tree. @type throttle: Boolean, default to False. @param throttle: Set the tree to 'throttled' rather than 'closed'. @type gitpoller_paths: dict(string -> string) @param gitpoller_path: A map { repository url -> path to the git checkout } used by the GitPoller(s). Implies that this GateKeeper will be operating in git mode for a given repository url. @type branches: [String] or None @param branches: A list of strings defining branches of interest. If None (the default) indicates that all branches are of interest. @type password: String. @param password: Password for service. If None, look in .status_password. """ if throttle: adjective = 'throttled' gerund = 'throttling' else: adjective = 'closed' gerund = 'closing' # Set defaults. kwargs.setdefault('sheriffs', ['sheriff']) kwargs.setdefault('sendToInterestedUsers', True) kwargs.setdefault( 'status_header', 'Automatically ' + gerund + ' tree for "%(steps)s" on "%(builder)s"') chromium_notifier.ChromiumNotifier.__init__(self, **kwargs) self.tree_status_url = tree_status_url self.check_revisions = check_revisions self.tree_message = ( tree_message or 'Tree is ' + adjective + ' (Automatic: "%(steps)s" on ' '"%(builder)s"%(blame)s)') self._last_closure_revision = 0 self.interesting_branches = branches # Set up variables for operating on commits in a Git repository. self.gitpoller_paths = gitpoller_paths or {} self.checkouts = {} self.password = None if tree_status_url: self.password = get_password.Password('.status_password').GetPassword()
def __init__(self, tree_status_url, tree_message=None, check_revisions=True, **kwargs): """Constructor with following specific arguments (on top of base class'). @type tree_status_url: String. @param tree_status_url: Web end-point for tree status updates. @type tree_message: String. @param tree_message: Message posted to the tree status site when closed. @type check_revisions: Boolean, default to True. @param check_revisions: Check revisions and users for closing the tree. @type password: String. @param password: Password for service. If None, look in .status_password. """ # Set defaults. kwargs.setdefault('sheriffs', ['sheriff']) kwargs.setdefault('sendToInterestedUsers', True) kwargs.setdefault( 'status_header', 'Automatically closing tree for "%(steps)s" on "%(builder)s"') chromium_notifier.ChromiumNotifier.__init__(self, **kwargs) self.tree_status_url = tree_status_url self.check_revisions = check_revisions self.tree_message = ( tree_message or 'Tree is closed (Automatic: "%(steps)s" on "%(builder)s"%(blame)s)') self._last_closure_revision = 0 self.password = get_password.Password('.status_password').GetPassword()
def __init__(self, store_revisions_url, good_revision_steps=None, use_getname=False, check_revisions=True): """Constructor with following specific arguments. @type good_revision_steps: Dictionary of builder name string mapped to a list of step strings. @param good_revision_steps: The list of all the steps of all the builders we want to validate before storing this revision as good. @param store_revisions_url: URL where revision info is stored.a @type check_revisions: Boolean, default to True. @param check_revisions: Check revisions and users for closing the tree. """ base.StatusReceiverMultiService.__init__(self) self.good_revision_steps = good_revision_steps or {} self.store_revisions_url = store_revisions_url # TODO(maruel): Enforce use_getname == True self.use_getname = use_getname self.check_revisions = check_revisions # We remember the success of interesting steps in a dictionary index by the # revision number. As soon as one of the interesting steps fail we flush # the revision for which we failed. We also flush the revision as soon as we # have seen a success for all the steps in good_revision_steps for that # revision (or any more recent revision). And finally, we don't need to add # information for a revision that is lower than the last known good # revision described below. self.succeeded_steps = {} # List of failed revisions so that we don't try to remember subsequent step # success for that revision for nothing. And again, we don't need to add # information for a revision that is lower than the last known good # revision described below. self.failed_revisions = [] # To identify revisions lower than this one as not interesting. self.last_known_good_revision = 0 # The status object we must subscribe to. self.status = None self.password = get_password.Password('.status_password').GetPassword()
def __init__(self, name, builders, url, properties=None): """ Args: name: The name of this scheduler, for buildbot indexing. builders: The names of the builders it can schedule jobs for. url: The url to poll for new jobs. properties: Key-value pairs to be added to every job description. """ TryBase.__init__(self, name, builders, properties or {}) # The password to use for authentication. self._password = get_pw.Password('.jobqueue_password').MaybeGetPassword() # The poller instance that will be sending us jobs. self._poller = JsonPoller(url, self._password, interval=_DEFAULT_POLLING_INTERVAL) # The url to which the scheduler posts that it started the job. self._url = url.rstrip('/') + '/accept/%s'