<commit_before>package com.heroku.bamboo;

import com.atlassian.bamboo.build.logger.BuildLogger;
import com.atlassian.bamboo.security.EncryptionService;
import com.atlassian.bamboo.task.CommonTaskContext;
import com.atlassian.bamboo.task.CommonTaskType;
import com.atlassian.bamboo.task.TaskException;
import com.atlassian.bamboo.task.TaskResult;
import com.atlassian.bamboo.task.TaskResultBuilder;
import com.heroku.api.App;
import com.heroku.api.Heroku;
import com.heroku.api.HerokuAPI;
import com.heroku.api.exception.RequestFailedException;
import org.jetbrains.annotations.NotNull;

import java.net.HttpURLConnection;

/**
 * @author <NAME>
 */
public abstract class AbstractHerokuTask implements CommonTaskType
{

    protected final StaticSandbox staticSandbox;
    protected EncryptionService encryptionService;

    protected AbstractHerokuTask() {
        this(new StaticSandbox() {
            @Override
            public TaskResult success(CommonTaskContext taskContext) {
                return TaskResultBuilder.create(taskContext).success().build();
            }

            @Override
            public TaskResult failed(CommonTaskContext taskContext) {
                return TaskResultBuilder.create(taskContext).failed().build();
            }
        });
    }

    public AbstractHerokuTask(StaticSandbox staticSandbox) {
        this.staticSandbox = staticSandbox;
    }

    @NotNull
    @Override
    public TaskResult execute(@NotNull final CommonTaskContext taskContext) throws TaskException {
        final BuildLogger buildLogger = taskContext.getBuildLogger();
        final String apiKey = encryptionService.decrypt(taskContext.getConfigurationMap().get(AbstractDeploymentTaskConfigurator.API_KEY));
        final HerokuAPI api = new HerokuAPI(apiKey);<commit_msg>BDEV-3402 Releasing heroku-bamboo-plugin compatible with Bamboo 5.0<commit_after>package com.heroku.bamboo;

import com.atlassian.bamboo.build.logger.BuildLogger;
import com.atlassian.bamboo.security.EncryptionService;
import com.atlassian.bamboo.task.CommonTaskContext;
import com.atlassian.bamboo.task.CommonTaskType;
import com.atlassian.bamboo.task.TaskException;
import com.atlassian.bamboo.task.TaskResult;
import com.atlassian.bamboo.task.TaskResultBuilder;
import com.heroku.api.App;
import com.heroku.api.Heroku;
import com.heroku.api.HerokuAPI;
import com.heroku.api.exception.RequestFailedException;
import org.jetbrains.annotations.NotNull;

import java.net.HttpURLConnection;

/**
 * @author <NAME>
 */
public abstract class AbstractHerokuTask implements CommonTaskType
{

    protected final StaticSandbox staticSandbox;
    protected EncryptionService encryptionService;

    protected AbstractHerokuTask() {
        this(new StaticSandbox() {
            @Override
            public TaskResult success(CommonTaskContext taskContext) {
                return TaskResultBuilder.newBuilder(taskContext).success().build();
            }

            @Override
            public TaskResult failed(CommonTaskContext taskContext) {
                return TaskResultBuilder.newBuilder(taskContext).failed().build();
            }
        });
    }

    public AbstractHerokuTask(StaticSandbox staticSandbox) {
        this.staticSandbox = staticSandbox;
    }

    @NotNull
    @Override
    public TaskResult execute(@NotNull final CommonTaskContext taskContext) throws TaskException {
        final BuildLogger buildLogger = taskContext.getBuildLogger();
        final String apiKey = encryptionService.decrypt(taskContext.getConfigurationMap().get(AbstractDeploymentTaskConfigurator.API_KEY));
        final HerokuAPI api = new HerokuAPI(apiKey);
{'fraction_non_alphanumeric': 0.08479212253829321, 'fraction_numerical': 0.0016411378555798686, 'mean_word_length': 3.895582329317269, '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': '133335', 'n_tokens_mistral': 1033, 'n_tokens_neox': 976, 'n_words': 183}