<commit_before>/*
 * Define utility functions.
 */

PROD_BRANCH_NAME = 'prod-push'
STAGE_BRANCH_NAME = 'stage-push'
STANDBY_BRANCH_NAME = 'standby-push'
KUMA_PIPELINE = 'kuma'
KUMASCRIPT_PIPELINE= 'kumascript'
// TODO: After cutover to IT-owned services, remove these.
MOZMEAO_KUMA_PIPELINE = 'mdn_multibranch_pipeline'
MOZMEAO_KUMASCRIPT_PIPELINE= 'kumascript_multibranch_pipeline'

def is_mozmeao_pipeline() {
    /*
     * Temporary function that returns true if this is running on the
     * MozMEAO-owned Jenkins service targeting the MozMEAO-owned Kubernetes
     * cluster.
     * TODO: After cutover to IT-owned services, remove this function.
     */
    return (env.JOB_NAME.startsWith(MOZMEAO_KUMA_PIPELINE + '/') ||
            env.JOB_NAME.startsWith(MOZMEAO_KUMASCRIPT_PIPELINE + '/'))
}

def get_commit_tag() {
    return env.GIT_COMMIT.take(7)
}

def get_target_name() {
    if (env.BRANCH_NAME == PROD_BRANCH_NAME) {
        return 'prod'
    }
    if (env.BRANCH_NAME == STAGE_BRANCH_NAME) {
        return 'stage'
    }
    if (env.BRANCH_NAME == STANDBY_BRANCH_NAME) {
        return 'standby'
    }
    throw new Exception(
        'Unable to determine the target name from the branch name.'
    )
}

def get_target_script() {
    if (env.BRANCH_NAME == PROD_BRANCH_NAME) {
        // TODO: After cutover to IT-owned services, just use 'prod'.
        return is_mozmeao_pipeline() ? 'prod' : 'prod.mm.test'
    }
    if (env.BRANCH_NAME == STAGE_BRANCH_NAME) {
        return 'stage'
    }
    if (env.BRANCH_NAME == STANDBY_BRANCH_NAME) {
        return 'prod.mm'
    }
    throw new Exception(
        'Unable to determine the target script from the branch name.'
    )
}

def get_region() {
    if (env.BRANCH_NAME == PROD_BRANCH_NAME) {
        // TODO: After cutover to IT-owned services, just use 'oregon'.
        return is_mozmeao_pipeline() ? 'portland' : 'oregon'
    }
    if (env.BRANCH_NAME == STAGE_BRANCH_NAME) {
        // TODO: After cutover to IT-owned services, just use 'oregon'.
        return is_mozmeao_pipeline() ? 'portland' : 'oregon'
    }
    if (env.BRANCH_NAME == STANDBY_BRANCH_NAME) {
        return 'frankfurt'
    }
    throw new Exception(
        'Unable to determine the region from the branch name.'
    )
}

def get_repo_name() {
    if (env.JOB_NAME.startsWith(KUMA_PIPELINE + '/') ||
        env.JOB_NAME.startsWith(MOZMEAO_KUMA_PIPELINE + '/')) {
        return 'kuma'
    }
    if (env.JOB_NAME.startsWith(KUMASCRIPT_PIPELINE + '/') ||
        env.JOB_NAME.startsWith(MOZMEAO_KUMASCRIPT_PIPELINE + '/')) {
        return 'kumascript'
    }
    throw new Exception(
        'Unable to determine the repo name from the job name.'
    )
}
<commit_msg>bug 1483072: enable deployments to MozIT standby<commit_after>/*
 * Define utility functions.
 */

PROD_BRANCH_NAME = 'prod-push'
STAGE_BRANCH_NAME = 'stage-push'
STANDBY_BRANCH_NAME = 'standby-push'
KUMA_PIPELINE = 'kuma'
KUMASCRIPT_PIPELINE= 'kumascript'
// TODO: After cutover to IT-owned services, remove these.
MOZMEAO_KUMA_PIPELINE = 'mdn_multibranch_pipeline'
MOZMEAO_KUMASCRIPT_PIPELINE= 'kumascript_multibranch_pipeline'

def is_mozmeao_pipeline() {
    /*
     * Temporary function that returns true if this is running on the
     * MozMEAO-owned Jenkins service targeting the MozMEAO-owned Kubernetes
     * cluster.
     * TODO: After cutover to IT-owned services, remove this function.
     */
    return (env.JOB_NAME.startsWith(MOZMEAO_KUMA_PIPELINE + '/') ||
            env.JOB_NAME.startsWith(MOZMEAO_KUMASCRIPT_PIPELINE + '/'))
}

def get_commit_tag() {
    return env.GIT_COMMIT.take(7)
}

def get_target_name() {
    if (env.BRANCH_NAME == PROD_BRANCH_NAME) {
        return 'prod'
    }
    if (env.BRANCH_NAME == STAGE_BRANCH_NAME) {
        return 'stage'
    }
    if (env.BRANCH_NAME == STANDBY_BRANCH_NAME) {
        return 'standby'
    }
    throw new Exception(
        'Unable to determine the target name from the branch name.'
    )
}

def get_target_script() {
    if (env.BRANCH_NAME == PROD_BRANCH_NAME) {
        // TODO: After cutover to IT-owned services, just use 'prod'.
        return is_mozmeao_pipeline() ? 'prod' : 'prod.mm.test'
    }
    if (env.BRANCH_NAME == STAGE_BRANCH_NAME) {
        return 'stage'
    }
    if (env.BRANCH_NAME == STANDBY_BRANCH_NAME) {
        return 'prod.mm'
    }
    throw new Exception(
        'Unable to determine the target script from the branch name.'
    )
}

def get_region() {
    if (env.BRANCH_NAME == PROD_BRANCH_NAME) {
        // TODO: After cutover to IT-owned services, just use 'oregon'.
        return is_mozmeao_pipeline() ? 'portland' : 'oregon'
    }
    if (env.BRANCH_NAME == STAGE_BRANCH_NAME) {
        // TODO: After cutover to IT-owned services, just use 'oregon'.
        return is_mozmeao_pipeline() ? 'portland' : 'oregon'
    }
    if (env.BRANCH_NAME == STANDBY_BRANCH_NAME) {
        return is_mozmeao_pipeline() ? 'frankfurt' : 'germany'
    }
    throw new Exception(
        'Unable to determine the region from the branch name.'
    )
}

def get_repo_name() {
    if (env.JOB_NAME.startsWith(KUMA_PIPELINE + '/') ||
        env.JOB_NAME.startsWith(MOZMEAO_KUMA_PIPELINE + '/')) {
        return 'kuma'
    }
    if (env.JOB_NAME.startsWith(KUMASCRIPT_PIPELINE + '/') ||
        env.JOB_NAME.startsWith(MOZMEAO_KUMASCRIPT_PIPELINE + '/')) {
        return 'kumascript'
    }
    throw new Exception(
        'Unable to determine the repo name from the job name.'
    )
}

{'fraction_non_alphanumeric': 0.10900818926296633, 'fraction_numerical': 0.001637852593266606, 'mean_word_length': 2.906183368869936, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6311401', 'n_tokens_mistral': 2043, 'n_tokens_neox': 2030, 'n_words': 428}