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);
}
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");
}
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);
}
});
}
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);
}
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);
}
Aggregations