Search in sources :

Example 1 with RepositoryAwareVerificationFailure

use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.RepositoryAwareVerificationFailure in project gradle by gradle.

the class HtmlDependencyVerificationReportRenderer method formatError.

private void formatError(RepositoryAwareVerificationFailure failure) {
    VerificationFailure vf = failure.getFailure();
    reportSignatureProblems(vf);
    reportChecksumProblems(vf);
    reportOtherProblems(vf);
}
Also used : ChecksumVerificationFailure(org.gradle.api.internal.artifacts.verification.verifier.ChecksumVerificationFailure) SignatureVerificationFailure(org.gradle.api.internal.artifacts.verification.verifier.SignatureVerificationFailure) VerificationFailure(org.gradle.api.internal.artifacts.verification.verifier.VerificationFailure) RepositoryAwareVerificationFailure(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.RepositoryAwareVerificationFailure)

Example 2 with RepositoryAwareVerificationFailure

use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.RepositoryAwareVerificationFailure in project gradle by gradle.

the class HtmlDependencyVerificationReportRenderer method formatErrors.

private void formatErrors(ArtifactErrors currentArtifact) {
    contents.append("        <tr>\n");
    RepositoryAwareVerificationFailure firstFailure = currentArtifact.failures.get(0);
    reportItem(currentArtifact.key.getComponentIdentifier().getDisplayName());
    reportItem(createFileLink(currentArtifact.key, firstFailure.getFailure(), firstFailure.getRepositoryName()));
    contents.append("            <td>\n");
    currentArtifact.failures.forEach(this::formatError);
    contents.append("            </td>\n");
    contents.append("        </tr>\n");
}
Also used : RepositoryAwareVerificationFailure(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.RepositoryAwareVerificationFailure)

Example 3 with RepositoryAwareVerificationFailure

use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.RepositoryAwareVerificationFailure in project gradle by gradle.

the class DependencyVerificationReportWriter method onArtifactFailure.

private void onArtifactFailure(DependencyVerificationReportRenderer renderer, ReportState state, ModuleComponentArtifactIdentifier key, Collection<RepositoryAwareVerificationFailure> failures) {
    failures.stream().map(RepositoryAwareVerificationFailure::getFailure).map(this::extractFailedFilePaths).forEach(state::addAffectedFile);
    renderer.startNewArtifact(key, () -> {
        if (failures.size() == 1) {
            RepositoryAwareVerificationFailure firstFailure = failures.iterator().next();
            explainSingleFailure(renderer, state, firstFailure);
        } else {
            explainMultiFailure(renderer, state, failures);
        }
    });
}
Also used : RepositoryAwareVerificationFailure(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.RepositoryAwareVerificationFailure)

Example 4 with RepositoryAwareVerificationFailure

use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.RepositoryAwareVerificationFailure in project gradle by gradle.

the class DependencyVerificationReportWriter method doRender.

public void doRender(String displayName, Multimap<ModuleComponentArtifactIdentifier, RepositoryAwareVerificationFailure> failuresByArtifact, DependencyVerificationReportRenderer renderer, boolean useKeyServers) {
    ReportState reportState = new ReportState();
    if (!useKeyServers) {
        reportState.keyServersAreDisabled();
    }
    renderer.startNewSection(displayName);
    renderer.startArtifactErrors(() -> {
        // Sorting entries so that error messages are always displayed in a reproducible order
        failuresByArtifact.asMap().entrySet().stream().sorted(DELETED_LAST.thenComparing(MISSING_LAST).thenComparing(BY_MODULE_ID)).forEachOrdered(entry -> {
            ModuleComponentArtifactIdentifier key = entry.getKey();
            Collection<RepositoryAwareVerificationFailure> failures = entry.getValue();
            onArtifactFailure(renderer, reportState, key, failures);
        });
    });
    renderer.finish(reportState);
}
Also used : ModuleComponentArtifactIdentifier(org.gradle.internal.component.external.model.ModuleComponentArtifactIdentifier) RepositoryAwareVerificationFailure(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.RepositoryAwareVerificationFailure)

Example 5 with RepositoryAwareVerificationFailure

use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.RepositoryAwareVerificationFailure in project gradle by gradle.

the class DependencyVerificationReportWriter method explainSingleFailure.

private void explainSingleFailure(DependencyVerificationReportRenderer renderer, ReportState state, RepositoryAwareVerificationFailure wrapper) {
    VerificationFailure failure = wrapper.getFailure();
    if (failure instanceof MissingChecksums) {
        state.hasMissing();
    } else {
        if (failure instanceof SignatureVerificationFailure) {
            state.failedSignatures();
            if (((SignatureVerificationFailure) failure).getErrors().values().stream().map(SignatureVerificationFailure.SignatureError::getKind).noneMatch(kind -> kind == SignatureVerificationFailure.FailureKind.PASSED_NOT_TRUSTED)) {
                state.maybeCompromised();
            } else {
                state.hasUntrustedKeys();
            }
        } else {
            state.maybeCompromised();
        }
    }
    renderer.reportFailure(wrapper);
}
Also used : SignatureVerificationFailure(org.gradle.api.internal.artifacts.verification.verifier.SignatureVerificationFailure) MissingChecksums(org.gradle.api.internal.artifacts.verification.verifier.MissingChecksums) SignatureVerificationFailure(org.gradle.api.internal.artifacts.verification.verifier.SignatureVerificationFailure) VerificationFailure(org.gradle.api.internal.artifacts.verification.verifier.VerificationFailure) RepositoryAwareVerificationFailure(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.RepositoryAwareVerificationFailure)

Aggregations

RepositoryAwareVerificationFailure (org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.RepositoryAwareVerificationFailure)5 SignatureVerificationFailure (org.gradle.api.internal.artifacts.verification.verifier.SignatureVerificationFailure)2 VerificationFailure (org.gradle.api.internal.artifacts.verification.verifier.VerificationFailure)2 ChecksumVerificationFailure (org.gradle.api.internal.artifacts.verification.verifier.ChecksumVerificationFailure)1 MissingChecksums (org.gradle.api.internal.artifacts.verification.verifier.MissingChecksums)1 ModuleComponentArtifactIdentifier (org.gradle.internal.component.external.model.ModuleComponentArtifactIdentifier)1