<commit_before>package jenkins.model;

import hudson.EnvVars;
import hudson.Extension;
import hudson.Util;
import hudson.model.Computer;
import hudson.model.EnvironmentContributor;
import hudson.model.Executor;
import hudson.model.Node;
import hudson.model.Run;
import hudson.model.TaskListener;
import jenkins.model.Jenkins.MasterComputer;

import java.io.IOException;

/**
 * {@link EnvironmentContributor} that adds the basic set of environment variables that
 * we've been exposing historically.
 *
 * @author <NAME>
 */
@Extension(ordinal=-100)
public class CoreEnvironmentContributor extends EnvironmentContributor {
    @Override
    public void buildEnvironmentFor(Run r, EnvVars env, TaskListener listener) throws IOException, InterruptedException {
        Computer c = Computer.currentComputer();
        if (c!=null)
            c.getEnvironment().overrideAll(env);

        Jenkins j = Jenkins.getInstance();
        String rootUrl = j.getRootUrl();
        if(rootUrl!=null) {
            env.put("JENKINS_URL", rootUrl);
            env.put("HUDSON_URL", rootUrl); // Legacy compatibility
            env.put("BUILD_URL", rootUrl+r.getUrl());
            env.put("JOB_URL", rootUrl+r.getParent().getUrl());<commit_msg>Evn variable wasn't actually populated by computer variables<commit_after>package jenkins.model;

import hudson.EnvVars;
import hudson.Extension;
import hudson.Util;
import hudson.model.Computer;
import hudson.model.EnvironmentContributor;
import hudson.model.Executor;
import hudson.model.Node;
import hudson.model.Run;
import hudson.model.TaskListener;
import jenkins.model.Jenkins.MasterComputer;

import java.io.IOException;

/**
 * {@link EnvironmentContributor} that adds the basic set of environment variables that
 * we've been exposing historically.
 *
 * @author <NAME>
 */
@Extension(ordinal=-100)
public class CoreEnvironmentContributor extends EnvironmentContributor {
    @Override
    public void buildEnvironmentFor(Run r, EnvVars env, TaskListener listener) throws IOException, InterruptedException {
        Computer c = Computer.currentComputer();
        if (c!=null){
            EnvVars compEnv = c.getEnvironment().overrideAll(env);
            env.putAll(compEnv);
        }

        Jenkins j = Jenkins.getInstance();
        String rootUrl = j.getRootUrl();
        if(rootUrl!=null) {
            env.put("JENKINS_URL", rootUrl);
            env.put("HUDSON_URL", rootUrl); // Legacy compatibility
            env.put("BUILD_URL", rootUrl+r.getUrl());
            env.put("JOB_URL", rootUrl+r.getParent().getUrl());
{'fraction_non_alphanumeric': 0.11029126213592233, 'fraction_numerical': 0.002330097087378641, 'mean_word_length': 3.8239700374531833, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4229630', 'n_tokens_mistral': 768, 'n_tokens_neox': 720, 'n_words': 173}