Skip to content

Commit

Permalink
Upgrade sonarqube v10.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
qmonmert committed Oct 3, 2024
1 parent dcc149b commit f9b4600
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/main/docker/sonar.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This configuration is intended for development purpose, it's **your** responsibility to harden it for production
services:
sonar:
image: sonarqube:10.6.0-community
image: sonarqube:10.7.0-community
container_name: sonar
platform: linux/x86_64
# Authentication is turned off for out of the box experience while trying out SonarQube
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/generator/dependencies/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM sonarqube:10.6.0-community
FROM sonarqube:10.7.0-community
FROM consul:1.15.4
FROM jhipster/consul-config-loader:v0.4.1
FROM jhipster/jhipster-registry:v7.4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ sonar.exclusions=\
{{projectBuildDirectory}}/classes/static/**/*.*,\
src/main/webapp/app/index.tsx,\
src/main/webapp/main.ts
sonar.test.exclusions=\
src/test/**/PackageSettings.java

sonar.issue.ignore.multicriteria=S117,S119,S125,S3437,S4502,S4684,S4032,S5778,S1133,S6206,S6437,S6564,UndocumentedApi
sonar.issue.ignore.multicriteria=S117,S119,S125,S3437,S4502,S4684,S4032,S5778,S1133,S6206,S6437,S6564,UndocumentedApi,S2301

# Rule: Local variable and method parameter names should comply with a naming convention
# Handled with checkstyle. Should be revisited with java 25 once Unnamed Patterns and Variables are available (JEP 443)
Expand Down Expand Up @@ -79,3 +81,7 @@ sonar.issue.ignore.multicriteria.S125.ruleKey=xml:S125
# Rule: Remove this redundant type alias and replace its occurrences with "string"
sonar.issue.ignore.multicriteria.S6564.resourceKey=src/main/webapp/**/*
sonar.issue.ignore.multicriteria.S6564.ruleKey=typescript:S6564

# Rule: Methods should not contain selector parameters
sonar.issue.ignore.multicriteria.S2301.resourceKey=src/main/webapp/app/auth/oauth2-auth.service.ts
sonar.issue.ignore.multicriteria.S2301.ruleKey=typescript:S2301
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ sonar.exclusions=\
{{projectBuildDirectory}}/classes/static/**/*.*,\
src/main/webapp/app/index.tsx,\
src/main/webapp/main.ts
sonar.test.exclusions=\
src/test/**/PackageSettings.java

sonar.issue.ignore.multicriteria=S117,S119,S125,S3437,S4502,S4684,S4032,S5778,S1133,S6206,S6548,S6437,S6471,UndocumentedApi
sonar.issue.ignore.multicriteria=S117,S119,S125,S3437,S4502,S4684,S4032,S5778,S1133,S6206,S6548,S6437,S6471,UndocumentedApi,S2301

# Rule: Local variable and method parameter names should comply with a naming convention
# Handled with checkstyle. Should be revisited with java 25 once Unnamed Patterns and Variables are available (JEP 443)
Expand Down Expand Up @@ -79,3 +81,7 @@ sonar.issue.ignore.multicriteria.S6437.ruleKey=java:S6437
# Rule: Run container as default user
sonar.issue.ignore.multicriteria.S6471.resourceKey=src/main/docker/cassandra/**/*
sonar.issue.ignore.multicriteria.S6471.ruleKey=docker:S6471

# Rule: Methods should not contain selector parameters
sonar.issue.ignore.multicriteria.S2301.resourceKey=src/main/webapp/app/auth/oauth2-auth.service.ts
sonar.issue.ignore.multicriteria.S2301.ruleKey=typescript:S2301
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestRedisManager implements ApplicationListener<ApplicationEnvironmentPrep
return;
}

redisContainer = new GenericContainer(DockerImageName.parse("{{redisDockerImage}}")).withExposedPorts(6379);;
redisContainer = new GenericContainer(DockerImageName.parse("{{redisDockerImage}}")).withExposedPorts(6379);

redisContainer.start();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM {{ cassandraDockerImage }}

# script to orchestrate the automatic keyspace creation and apply all migration scripts
ADD cassandra/scripts/autoMigrate.sh /usr/local/bin/autoMigrate
COPY cassandra/scripts/autoMigrate.sh /usr/local/bin/autoMigrate
RUN chmod 755 /usr/local/bin/autoMigrate

# script to run any cql script from src/main/resources/config/cql
ADD cassandra/scripts/execute-cql.sh /usr/local/bin/execute-cql
COPY cassandra/scripts/execute-cql.sh /usr/local/bin/execute-cql
RUN chmod 755 /usr/local/bin/execute-cql

ENTRYPOINT ["autoMigrate"]
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import java.util.stream.Stream;
class TestCassandraMigrationLoader implements ApplicationListener<ApplicationEnvironmentPreparedEvent>, Ordered {
private static final Logger log = LoggerFactory.getLogger(TestCassandraMigrationLoader.class);
private static final String cqlDir = "config/cql/changelog/";
private static final String pattern = ".cql";
private static final String CQL_DIR = "config/cql/changelog/";
private static final String PATTERN = ".cql";
private static boolean migrationDone = false;
@Override
Expand All @@ -43,15 +43,15 @@ class TestCassandraMigrationLoader implements ApplicationListener<ApplicationEnv
public void loadMigrationScripts(CqlSession session) {
CQLDataLoader dataLoader = new CQLDataLoader(session);
URL dirUrl = ClassLoader.getSystemResource(cqlDir);
URL dirUrl = ClassLoader.getSystemResource(CQL_DIR);
if (dirUrl == null) { // protect for empty directory
return;
}

try (Stream<Path> stream = Files.list(Paths.get(dirUrl.toURI()))){
stream
.map(Path::toString)
.filter(file -> file.endsWith(pattern))
.filter(file -> file.endsWith(PATTERN))
.sorted()
.map(file -> new FileCQLDataSet(file, false, false))
.forEach(dataLoader::load);
Expand Down

0 comments on commit f9b4600

Please sign in to comment.