experiment: Increase logging based on PR label
This commit is contained in:
parent
fc4ea17cf3
commit
335eb3ed8d
3 changed files with 36 additions and 17 deletions
14
.github/workflows/build.yml
vendored
14
.github/workflows/build.yml
vendored
|
@ -20,6 +20,18 @@ jobs:
|
|||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 21
|
||||
- name: Update environment variables based on PR labels
|
||||
id: pr-env
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const labels = context.payload.pull_request.labels.map(label => label.name);
|
||||
console.log('PR labels:', labels);
|
||||
const springDebug = labels.includes('pr-debug');
|
||||
return { SPRING_DEBUG: '' + springDebug };
|
||||
result-encoding: json
|
||||
- uses: gradle/actions/setup-gradle@v4
|
||||
- name: Build gradle project
|
||||
run: ./gradlew build
|
||||
run: ./gradlew build
|
||||
env:
|
||||
ORG_GRADLE_PROJECT_SPRING_DEBUG: ${{ fromJSON(steps.pr-env.outputs.result).SPRING_DEBUG }}
|
|
@ -7,6 +7,7 @@ plugins {
|
|||
|
||||
group = "io.github.markl4yg.hca"
|
||||
version = "0.0.1-SNAPSHOT"
|
||||
val springDebugLogging = providers.gradleProperty("SPRING_DEBUG").orNull == "true"
|
||||
|
||||
apply(
|
||||
from = file("./gradle/spotless.gradle")
|
||||
|
@ -57,6 +58,13 @@ dependencies {
|
|||
|
||||
tasks.withType<Test> {
|
||||
useJUnitPlatform()
|
||||
if (springDebugLogging) {
|
||||
// Additional Hibernate logging
|
||||
jvmArgs("-Dlogging.level.org.sqlite=DEBUG")
|
||||
jvmArgs("-Dlogging.level.org.hibernate=DEBUG")
|
||||
jvmArgs("-Dhibernate.show_sql=true")
|
||||
jvmArgs("-Dhibernate.format_sql=true")
|
||||
}
|
||||
|
||||
systemProperty("spring.profiles.active", "test")
|
||||
jvmArgs("-XX:+EnableDynamicAgentLoading") // DynamicAgentLoading for byteBuddy within Mockito
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package de.mlessmann.certassist.openssl;
|
||||
|
||||
import static de.mlessmann.certassist.Constants.CERTASSIST_TMP_PREFIX;
|
||||
import static java.util.concurrent.TimeUnit.*;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
import de.mlessmann.certassist.DeleteRecursiveFileVisitor;
|
||||
import de.mlessmann.certassist.except.CommandLineOperationException;
|
||||
import de.mlessmann.certassist.except.UnresolvableCLIDependency;
|
||||
|
@ -9,18 +13,6 @@ import de.mlessmann.certassist.models.CertificateInfoExtension;
|
|||
import de.mlessmann.certassist.models.CertificateInfoSubject;
|
||||
import de.mlessmann.certassist.models.CertificateInfoSubject.CertificateInfoSubjectBuilder;
|
||||
import de.mlessmann.certassist.service.ExecutableResolver;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.zeroturnaround.exec.ProcessExecutor;
|
||||
import org.zeroturnaround.exec.ProcessResult;
|
||||
import org.zeroturnaround.exec.StartedProcess;
|
||||
import org.zeroturnaround.exec.stream.slf4j.Slf4jStream;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
|
@ -36,10 +28,17 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static de.mlessmann.certassist.Constants.CERTASSIST_TMP_PREFIX;
|
||||
import static java.util.concurrent.TimeUnit.*;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.zeroturnaround.exec.ProcessExecutor;
|
||||
import org.zeroturnaround.exec.ProcessResult;
|
||||
import org.zeroturnaround.exec.StartedProcess;
|
||||
import org.zeroturnaround.exec.stream.slf4j.Slf4jStream;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
|
|
Loading…
Add table
Reference in a new issue