Skip to content
1 change: 1 addition & 0 deletions .github/workflows/dependency-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ jobs:
uses: ardoco/actions/.github/workflows/maven-update.yml@main
with:
with-submodules: true
runs-on: self-hosted
secrets:
PAT: ${{ secrets.SDQ_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
uses: ardoco/actions/.github/workflows/sonarcloud.yml@main
with:
with-submodules: true
runs-on: self-hosted
secrets:
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}

3 changes: 2 additions & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ jobs:
with:
deploy: false
with-submodules: true
runs-on: self-hosted
secrets:
OSSRH_USER: ""
OSSRH_TOKEN: ""
GPG_KEY: ${{secrets.GPG_KEY}}
GPG_KEY: ""

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import edu.kit.kastel.mcse.ardoco.core.api.diagramrecognition.Classification
import edu.kit.kastel.mcse.ardoco.core.api.diagramrecognition.Diagram
import edu.kit.kastel.mcse.ardoco.lissa.DiagramRecognition
import org.apache.hc.client5.http.classic.methods.HttpPost
import org.apache.hc.client5.http.config.RequestConfig
import org.apache.hc.client5.http.impl.classic.BasicHttpClientResponseHandler
import org.apache.hc.client5.http.impl.classic.HttpClients
import org.slf4j.Logger
Expand All @@ -18,13 +19,19 @@ import java.io.OutputStream
import java.lang.Double.max
import java.lang.Double.min
import java.util.*
import java.util.concurrent.TimeUnit
import javax.imageio.ImageIO

private val colors = listOf(Color.RED, Color.GREEN, Color.YELLOW, Color.BLUE, Color.BLACK, Color.ORANGE)
private val logger: Logger = LoggerFactory.getLogger("${DiagramRecognition::class.java.packageName}.Helpers")
fun executeRequest(postRequest: HttpPost): String {
fun executeRequest(postRequest: HttpPost, modifyTimeout: Boolean = true): String {
HttpClients.createDefault().use {
try {
if (modifyTimeout) {
val basicConfig = postRequest.config ?: RequestConfig.custom().build()
val newConfig = RequestConfig.copy(basicConfig).setResponseTimeout(5, TimeUnit.MINUTES).build()
postRequest.config = newConfig
}
val content = it.execute(postRequest, BasicHttpClientResponseHandler())
return content ?: ""
} catch (e: IOException) {
Expand Down