From c1a0401fe47c9b131517479aac6916876760db3a Mon Sep 17 00:00:00 2001 From: marko-bekhta Date: Wed, 6 Nov 2024 10:17:17 +0100 Subject: [PATCH 1/2] HV-2059 Add more badges to readme for: - sonar - coverage - develocity --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 4c15b7a03a..5d45903bb1 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ [![Maven Central](https://img.shields.io/maven-central/v/org.hibernate.validator/hibernate-validator.svg?label=Maven%20Central&style=for-the-badge)](https://central.sonatype.com/search?namespace=org.hibernate.validator&sort=name) [![Build Status](https://img.shields.io/jenkins/build?jobUrl=https://ci.hibernate.org/view/Validator/job/hibernate-validator/job/main/&style=for-the-badge)](https://ci.hibernate.org/view/Validator/job/hibernate-validator/job/main/) +[![Sonar Coverage](https://img.shields.io/sonar/coverage/hibernate_hibernate-validator?server=https%3A%2F%2Fsonarcloud.io&style=for-the-badge)](https://sonarcloud.io/project/activity?id=hibernate_hibernate-validator&graph=coverage) +[![Quality gate](https://img.shields.io/sonar/alert_status/hibernate_hibernate-validator?logo=sonarcloud&server=https%3A%2F%2Fsonarcloud.io&style=for-the-badge)](https://sonarcloud.io/dashboard?id=hibernate_hibernate-validator) +[![Develocity](https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?style=for-the-badge&logo=gradle)](https://ge.hibernate.org/scans?search.rootProjectNames=Hibernate%20Validator) [![Reproducible Builds](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jvm-repo-rebuild/reproducible-central/master/content/org/hibernate/validator/hibernate-validator/badge.json&style=for-the-badge)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/hibernate/validator/hibernate-validator/README.md) ## What is it? From 2531f82f4925536a3f56b0fe84f4fa9db47ad02c Mon Sep 17 00:00:00 2001 From: marko-bekhta Date: Wed, 6 Nov 2024 11:46:15 +0100 Subject: [PATCH 2/2] HV-2059 Add missing tryFinally function --- Jenkinsfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 1f84f26585..afaab79c32 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -627,3 +627,33 @@ void mvn(String args) { sh "mvn $args" } } + +// try-finally construct that properly suppresses exceptions thrown in the finally block. +def tryFinally(Closure main, Closure ... finallies) { + def mainFailure = null + try { + main() + } + catch (Throwable t) { + mainFailure = t + throw t + } + finally { + finallies.each {it -> + try { + it() + } + catch (Throwable t) { + if ( mainFailure ) { + mainFailure.addSuppressed( t ) + } + else { + mainFailure = t + } + } + } + } + if ( mainFailure ) { // We may reach here if only the "finally" failed + throw mainFailure + } +}