<commit_before>package org.jenkins.tools.test.hook;

import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jenkins.tools.test.model.PomData;

/**
 * Workaround for the Pipeline: Declarative plugins since they are stored in a central repository.
 */
public class DeclarativePipelineHook extends AbstractMultiParentHook {

    private static final Logger LOGGER = Logger.getLogger(DeclarativePipelineHook.class.getName());

    @Override
    protected String getParentFolder() {
        return "pipeline-model-definition";
    }

    @Override
    protected String getParentUrl() {
        return "scm:git:git://github.com/jenkinsci/pipeline-model-definition-plugin.git";
    }

    @Override
    protected String getParentProjectName() {
        return "pipeline-model-definition";
    }

    @Override
    public boolean check(Map<String, Object> info) {
        return isDPPlugin(info);
    }

    public static boolean isDPPlugin(Map<String, Object> moreInfo) {
        PomData data = (PomData) moreInfo.get("pomData");
        return isDPPlugin(data);
    }

    public static boolean isDPPlugin(PomData data) {
        if (data.parent != null) {
            return data.parent.artifactId.equalsIgnoreCase("pipeline-model-parent");
        } else {
            LOGGER.log(Level.WARNING, "Artifact {0} has no parent POM, likely it was incrementalified (JEP-305). " +
                    "Will guess the plugin by artifact ID. FTR JENKINS-55169", data.artifactId);
            return data.artifactId.contains("pipeline-model");
        }
    }
}<commit_msg>take into account pipeline-stage-tags-metadata<commit_after>package org.jenkins.tools.test.hook;

import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jenkins.tools.test.model.PomData;

/**
 * Workaround for the Pipeline: Declarative plugins since they are stored in a central repository.
 */
public class DeclarativePipelineHook extends AbstractMultiParentHook {

    private static final Logger LOGGER = Logger.getLogger(DeclarativePipelineHook.class.getName());

    @Override
    protected String getParentFolder() {
        return "pipeline-model-definition";
    }

    @Override
    protected String getParentUrl() {
        return "scm:git:git://github.com/jenkinsci/pipeline-model-definition-plugin.git";
    }

    @Override
    protected String getParentProjectName() {
        return "pipeline-model-definition";
    }

    @Override
    public boolean check(Map<String, Object> info) {
        return isDPPlugin(info);
    }

    public static boolean isDPPlugin(Map<String, Object> moreInfo) {
        PomData data = (PomData) moreInfo.get("pomData");
        return isDPPlugin(data);
    }

    public static boolean isDPPlugin(PomData data) {
        if (data.parent != null) {
            return data.parent.artifactId.equalsIgnoreCase("pipeline-model-parent");
        } else {
            LOGGER.log(Level.WARNING, "Artifact {0} has no parent POM, likely it was incrementalified (JEP-305). " +
                    "Will guess the plugin by artifact ID. FTR JENKINS-55169", data.artifactId);
            return data.artifactId.contains("pipeline-model") || data.artifactId.equalsIgnoreCase("pipeline-stage-tags-metadata");
        }
    }
}
{'fraction_non_alphanumeric': 0.10529500756429652, 'fraction_numerical': 0.005446293494704993, 'mean_word_length': 3.1325, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7254684', 'n_tokens_mistral': 959, 'n_tokens_neox': 928, 'n_words': 220}