<commit_before>from buildbot.plugins import *
from buildbot.plugins import worker as bworker
from buildbot.process.results import SKIPPED

from github_listener import JuliaGithubListener
import re

try:
    from buildbot_secret import *
except:
    IOError('Could not load buildbot_secret.py! Ensure you have a buildbot_secret.py in this directory, and that it defines GITHUB_SECRET!')

# This is the dictionary that the buildmaster pays attention to. We use the "c" alias because fingers.
c = BuildmasterConfig = {
    'protocols':{
        'pb': {
            'port': 9989
        }
    },
    'schedulers': [],
    'builders': [],
    'buildbotURL': 'https://' + FQDN + '/',
    'buildbotNetUsageData': 'full',
    'title': "Julia",
    'titleURL': "http://julialang.org",
    'db': {
        'db_url' : "postgresql://%s:%s@db/%s"%(db_user, db_password, db_user),
    },
    'services': [],
    'www': {
        'port': 8010,

        # Setup GitHub change hook
        'change_hook_dialects': {
            'github': {
                'class': JuliaGithubListener,
                'secret': GITHUB_WEBHOOK_SECRET,
                'strict': True,
            },
        },

        # Setup GitHub OAuth2 integration to allow anyone in the JuliaLang org to use the buildbot
        'auth': util.GitHubAuth(GITHUB_OAUTH_CLIENT_ID, GITHUB_OAUTH_CLIENT_SECRET),
        'authz': util.Authz(
            allowRules=[
                util.StopBuildEndpointMatcher(role="JuliaLang"),
                util.ForceBuildEndpointMatcher(role="JuliaLang"),
                util.RebuildBuildEndpointMatcher(role="JuliaLang"),
            ],
            roleMatchers=[
                util.RolesFromGroups(groupPrefix="")
            ],
        ),

        'plugins': {
            # Setup waterfall view
            'waterfall_view': {},

            # Setup console view
            'console_view': {},

            # Setup profiler
            'profiler': True,
        },
    }
}


# Returns true if this is a build started from the packager scheduler, not the
# force scheduler or jlbuild, or similar.
def is_nightly_build(props):
    return props.getProperty('scheduler').startswith("Julia CI")
def is_branch(props, branch):
    return props.getProperty('branch') == branch

# Convenience methods for figuring out what OS we're building for
def is_mac(props):<commit_msg>Enable buildbot badge generation (#144)<commit_after>from buildbot.plugins import *
from buildbot.plugins import worker as bworker
from buildbot.process.results import SKIPPED

from github_listener import JuliaGithubListener
import re

try:
    from buildbot_secret import *
except:
    IOError('Could not load buildbot_secret.py! Ensure you have a buildbot_secret.py in this directory, and that it defines GITHUB_SECRET!')

# This is the dictionary that the buildmaster pays attention to. We use the "c" alias because fingers.
c = BuildmasterConfig = {
    'protocols':{
        'pb': {
            'port': 9989
        }
    },
    'schedulers': [],
    'builders': [],
    'buildbotURL': 'https://' + FQDN + '/',
    'buildbotNetUsageData': 'full',
    'title': "Julia",
    'titleURL': "http://julialang.org",
    'db': {
        'db_url' : "postgresql://%s:%s@db/%s"%(db_user, db_password, db_user),
    },
    'services': [],
    'www': {
        'port': 8010,

        # Setup GitHub change hook
        'change_hook_dialects': {
            'github': {
                'class': JuliaGithubListener,
                'secret': GITHUB_WEBHOOK_SECRET,
                'strict': True,
            },
        },

        # Setup GitHub OAuth2 integration to allow anyone in the JuliaLang org to use the buildbot
        'auth': util.GitHubAuth(GITHUB_OAUTH_CLIENT_ID, GITHUB_OAUTH_CLIENT_SECRET),
        'authz': util.Authz(
            allowRules=[
                util.StopBuildEndpointMatcher(role="JuliaLang"),
                util.ForceBuildEndpointMatcher(role="JuliaLang"),
                util.RebuildBuildEndpointMatcher(role="JuliaLang"),
            ],
            roleMatchers=[
                util.RolesFromGroups(groupPrefix="")
            ],
        ),

        'plugins': {
            # Setup waterfall view
            'waterfall_view': {},

            # Setup console view
            'console_view': {},

            # Setup Badges
            'badges': {},

            # Setup profiler
            'profiler': True,
        },
    }
}


# Returns true if this is a build started from the packager scheduler, not the
# force scheduler or jlbuild, or similar.
def is_nightly_build(props):
    return props.getProperty('scheduler').startswith("Julia CI")
def is_branch(props, branch):
    return props.getProperty('branch') == branch

# Convenience methods for figuring out what OS we're building for
def is_mac(props):
{'fraction_non_alphanumeric': 0.11314475873544093, 'fraction_numerical': 0.004367720465890183, 'mean_word_length': 2.3700070077084794, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1256530', 'n_tokens_mistral': 1454, 'n_tokens_neox': 1397, 'n_words': 362}