cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblotsky <...@git.apache.org>
Subject [GitHub] cordova-medic pull request: Medic Refactor
Date Fri, 13 Mar 2015 18:13:34 GMT
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-medic/pull/37#discussion_r26409576
  
    --- Diff: buildbot-conf/cordova-internal.conf ---
    @@ -0,0 +1,101 @@
    +import os
    +import json
    +
    +from buildbot.changes.gitpoller import GitPoller
    +from buildbot.schedulers.forcesched import ForceScheduler
    +
    +# config
    +MEDIC_CONFIG_FILE    = os.path.join(FP, 'cordova-config.json')
    +PROJECTS_CONFIG_FILE = os.path.join(FP, 'cordova-repos.json')
    +
    +def parse_config_file(file_name):
    +    with open(file_name, 'r') as config_file:
    +        return json.load(config_file)
    +
    +medic_config    = parse_config_file(MEDIC_CONFIG_FILE)
    +projects_config = parse_config_file(PROJECTS_CONFIG_FILE)
    +
    +# constants
    +GIT_BIN       = 'git' if os.name != 'nt' else 'C:\Program Files (x86)\Git\cmd\git.exe'
    +GITPOLLER_DIR = 'gitpoller-workdir'
    +
    +POLLED_PROJECT_PATTERNS = [
    +    'cordova-mobile-spec',
    +    'cordova-lib',
    +    'cordova-js',
    +    'cordova-cli',
    +    'cordova-medic',
    +    'cordova-plugman',
    +    'cordova-windows',
    +    'cordova-android',
    +]
    +
    +####### UTILITIES
    +
    +# helpers
    +def cordova_builders():
    +    return [b.name for b in c['builders'] if b.name.startswith('cordova-')]
    +
    +def is_polled_project(project_name):
    +    return True if any(pattern in project_name for pattern in POLLED_PROJECT_PATTERNS)
else False
    +
    +def get_polled_projects():
    +    return (project for project_name, project in projects_config.items() if is_polled_project(project_name))
    +
    +def make_git_poller(repo_uri):
    +    # NOTE:
    +    #      branches=True means watching all branches
    +    return GitPoller(repo_uri, workdir=GITPOLLER_DIR, branches=True, pollinterval=120,
gitbin=GIT_BIN)
    --- End diff --
    
    The gitpoller doesn't require those parameters: they are optional. HDD and CPU are barely
used with the gitpollers, and our current config also uses gitpollers that don't do anything,
so it's actually not new. Also, it is useful for seeing which changes are coming in, even
if builds aren't fired on them.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message