diff --git a/core/src/main/java/io/jenkins/pluginhealth/scoring/probes/FailingBuildProbe.java b/core/src/main/java/io/jenkins/pluginhealth/scoring/probes/FailingBuildProbe.java index ca275d6a8..e045659b2 100644 --- a/core/src/main/java/io/jenkins/pluginhealth/scoring/probes/FailingBuildProbe.java +++ b/core/src/main/java/io/jenkins/pluginhealth/scoring/probes/FailingBuildProbe.java @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2023 Jenkins Infra + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package io.jenkins.pluginhealth.scoring.probes; import io.jenkins.pluginhealth.scoring.model.Plugin; @@ -11,6 +35,9 @@ import java.nio.file.Path; import java.util.stream.Stream; +/** + * This probe checks whether build failed on Default Branch or not. + */ @Component @Order(FailingBuildProbe.ORDER) public class FailingBuildProbe extends Probe{ @@ -25,7 +52,7 @@ protected ProbeResult doApply(Plugin plugin, ProbeContext context){ return ProbeResult.success(key(),"There is no local repository for plugin " + plugin.getName() + "."); } try { - if(repoContainsJenkins(context).equals("Jenkinsfile found")){ + if(repoContainsJenkins(context).toString().equals("Jenkinsfile found")){ final GitHub gh = context.getGitHub(); final GHRepository repository = gh.getRepository(context.getRepositoryName(plugin.getScm()).orElseThrow());