Skip to content

Commit 8b184b0

Browse files
Merge branch 'release/6.0.3'
2 parents 7b97ad9 + c17933e commit 8b184b0

File tree

35 files changed

+154
-60
lines changed

35 files changed

+154
-60
lines changed

.github/codeql/codeql-config.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: "AECU CodeQL config"
2+
3+
queries:
4+
- uses: security-and-quality
5+
6+
paths-ignore:
7+
- '**/ui.apps.groovyconsole/**/*.*'
8+
- '**/target/**/*.*'

.github/workflows/codeql-analysis.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,21 @@ jobs:
3535

3636
steps:
3737
- name: Checkout repository
38-
uses: actions/checkout@v2
38+
uses: actions/checkout@v3
39+
40+
- name: Cache Maven packages
41+
uses: actions/cache@v1
42+
with:
43+
path: ~/.m2
44+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
45+
restore-keys: ${{ runner.os }}-m2
3946

4047
# Initializes the CodeQL tools for scanning.
4148
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v1
49+
uses: github/codeql-action/init@v2
4350
with:
4451
languages: ${{ matrix.language }}
52+
config-file: ./.github/codeql/codeql-config.yml
4553
# If you wish to specify custom queries, you can do so here or in a config file.
4654
# By default, queries listed here will override any specified in a config file.
4755
# Prefix the list here with "+" to use these queries and those in the config file.
@@ -63,4 +71,4 @@ jobs:
6371
mvn clean install
6472
6573
- name: Perform CodeQL Analysis
66-
uses: github/codeql-action/analyze@v1
74+
uses: github/codeql-action/analyze@v2

.github/workflows/maven.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: Java CI with Maven
5+
6+
on:
7+
push:
8+
branches: [ develop ]
9+
pull_request:
10+
branches: [ develop ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set up JDK 11
21+
uses: actions/setup-java@v3
22+
with:
23+
java-version: '11'
24+
distribution: 'temurin'
25+
cache: maven
26+
27+
- name: Cache SonarCloud packages
28+
uses: actions/cache@v1
29+
with:
30+
path: ~/.sonar/cache
31+
key: ${{ runner.os }}-sonar
32+
restore-keys: ${{ runner.os }}-sonar
33+
34+
- name: Cache Maven packages
35+
uses: actions/cache@v1
36+
with:
37+
path: ~/.m2
38+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
39+
restore-keys: ${{ runner.os }}-m2
40+
41+
- name: Build with Maven
42+
run: mvn clean install javadoc:javadoc
43+
44+
- name: Build and analyze
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
48+
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=aecu

.travis.yml

-19
This file was deleted.

HISTORY

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
6.0.3
2+
- Improvements to cloud startup hook (190)
3+
14
2022-06-03 6.0.2
25
- Improvements to cloud startup hook to avoid double execution and execution before Groovy Console is ready
36

api/pom.xml

+31-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>de.valtech.aecu</groupId>
66
<artifactId>aecu</artifactId>
7-
<version>6.0.2</version>
7+
<version>6.0.3</version>
88
</parent>
99

1010
<artifactId>aecu.api</artifactId>
@@ -45,6 +45,36 @@
4545
<groupId>org.apache.maven.plugins</groupId>
4646
<artifactId>maven-javadoc-plugin</artifactId>
4747
</plugin>
48+
<plugin>
49+
<groupId>org.jacoco</groupId>
50+
<artifactId>jacoco-maven-plugin</artifactId>
51+
<executions>
52+
<execution>
53+
<id>prepare-agent</id>
54+
<goals>
55+
<goal>prepare-agent</goal>
56+
</goals>
57+
</execution>
58+
<execution>
59+
<id>report</id>
60+
<phase>prepare-package</phase>
61+
<goals>
62+
<goal>report</goal>
63+
</goals>
64+
</execution>
65+
<execution>
66+
<id>post-unit-test</id>
67+
<phase>test</phase>
68+
<goals>
69+
<goal>report</goal>
70+
</goals>
71+
</execution>
72+
</executions>
73+
</plugin>
74+
<plugin>
75+
<groupId>org.owasp</groupId>
76+
<artifactId>dependency-check-maven</artifactId>
77+
</plugin>
4878
</plugins>
4979
</build>
5080

api/src/test/java/de/valtech/aecu/core/groovy/console/bindings/filters/TestFilters.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public void filter_whenMultiValueFieldMatch_thenTrue() {
159159

160160
Map<String, Object> properties_multiValue_same_int = new HashMap<>();
161161
properties_multiValue_same_int.put("testMultiValueInt", new Integer[] {1, 2, 3});
162-
assertTrue(new FilterByProperties(properties_multiValue_same).filter(resource, new StringBuilder()));
162+
assertTrue(new FilterByProperties(properties_multiValue_same_int).filter(resource, new StringBuilder()));
163163

164164
Map<String, Object> properties_multiValue_2 = new HashMap<>();
165165
properties_multiValue_2.put("testMultiValue", new String[] {"val_1", "val_2"});

cloud.startup.hook/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>de.valtech.aecu</groupId>
66
<artifactId>aecu</artifactId>
7-
<version>6.0.2</version>
7+
<version>6.0.3</version>
88
</parent>
99

1010
<artifactId>aecu.cloud.startup.hook</artifactId>

cloud.startup.hook/src/main/java/de/valtech/aecu/startuphook/AecuCloudStartupService.java

+13-4
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ public class AecuCloudStartupService {
5858

5959
private static final Logger LOGGER = LoggerFactory.getLogger(AecuCloudStartupService.class);
6060

61-
private static final int WAIT_PERIOD = 10;
62-
private static final int WAIT_INTERVALS = 30;
61+
private static final int WAIT_PERIOD = 30;
62+
private static final int WAIT_INTERVALS = 10;
6363
// migration timeout in seconds
6464
private static final int MIGRATION_TIMEOUT = 1800;
6565

@@ -71,7 +71,16 @@ public class AecuCloudStartupService {
7171
private ServiceComponentRuntime serviceComponentRuntime;
7272

7373
@Activate
74-
public void checkAndRunMigration() {
74+
public void activate() {
75+
Runnable runnable = this::checkAndRunMigration;
76+
Thread thread = new Thread(runnable);
77+
thread.start();
78+
}
79+
80+
/**
81+
* Checks if the components are ready and starts the migration process.
82+
*/
83+
protected void checkAndRunMigration() {
7584
ResourceResolver resourceResolver = getResourceResolver();
7685
Session session = resourceResolver.adaptTo(Session.class);
7786
boolean isCompositeNodeStore = RuntimeHelper.isCompositeNodeStore(session);
@@ -81,7 +90,7 @@ public void checkAndRunMigration() {
8190
LOGGER.error("Groovy extension services seem to be not bound");
8291
throw new IllegalStateException("Groovy extension services seem to be not bound");
8392
}
84-
Thread.sleep(1000L * WAIT_PERIOD);
93+
Thread.sleep(1000L * WAIT_PERIOD * 2);
8594
startAecuMigration();
8695
} catch (InterruptedException e) {
8796
LOGGER.error("Interrupted", e);

complete-cloud/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>de.valtech.aecu</groupId>
77
<artifactId>aecu</artifactId>
8-
<version>6.0.2</version>
8+
<version>6.0.3</version>
99
</parent>
1010

1111
<artifactId>aecu.complete.cloud</artifactId>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
user.mapping=["de.valtech.aecu.core:aecu-admin\=aecu-admin"]
1+
user.mapping=["de.valtech.aecu.core:aecu-admin\=[aecu-admin]"]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
user.mapping=["de.valtech.aecu.cloud.startup.hook:aecu-admin\=aecu-admin"]
1+
user.mapping=["de.valtech.aecu.cloud.startup.hook:aecu-admin\=[aecu-admin]"]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
user.mapping=["de.valtech.aecu.core:aecu-content-migrator\=aecu-content-migrator"]
1+
user.mapping=["de.valtech.aecu.core:aecu-content-migrator\=[aecu-content-migrator]"]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
user.mapping=["de.valtech.aecu.core:aecu\=aecu-service"]
1+
user.mapping=["de.valtech.aecu.core:aecu\=[aecu-service]"]

complete/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>de.valtech.aecu</groupId>
77
<artifactId>aecu</artifactId>
8-
<version>6.0.2</version>
8+
<version>6.0.3</version>
99
</parent>
1010

1111
<artifactId>aecu.complete</artifactId>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
user.mapping=["de.valtech.aecu.core:aecu-admin\=aecu-admin"]
1+
user.mapping=["de.valtech.aecu.core:aecu-admin\=[aecu-admin]"]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
user.mapping=["de.valtech.aecu.core:aecu-content-migrator\=aecu-content-migrator"]
1+
user.mapping=["de.valtech.aecu.core:aecu-content-migrator\=[aecu-content-migrator]"]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
user.mapping=["de.valtech.aecu.core:aecu\=aecu-service"]
1+
user.mapping=["de.valtech.aecu.core:aecu\=[aecu-service]"]

core/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>de.valtech.aecu</groupId>
66
<artifactId>aecu</artifactId>
7-
<version>6.0.2</version>
7+
<version>6.0.3</version>
88
</parent>
99

1010
<artifactId>aecu.core</artifactId>

core/src/main/java/de/valtech/aecu/core/groovy/console/bindings/actions/page/SetPageTagsAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public String doAction(Resource resource) throws PersistenceException {
7171
/**
7272
* Returns the tags that need to be added.
7373
*
74-
* @param oldTags list of existing tags
7574
* @return tags to add
7675
* @throws PersistenceException invalid tag found
7776
*/

core/src/main/java/de/valtech/aecu/core/groovy/console/bindings/impl/ContentUpgradeImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public ContentUpgrade forResourcesByPropertyQuery(@Nonnull String path, Map<Stri
165165
if (properties != null) {
166166
properties.forEach((key, value) -> {
167167
if (key == null || value == null) {
168-
LOG.warn("Null key or value provided: Key: " + key + " Value: " + value);
168+
LOG.warn("Null key or value provided: Key: {} Value: {}", key, value);
169169
return;
170170
}
171171
if (value.contains("%")) {

core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ public void purgeHistory(ResourceResolver resolver, int daysToKeep) throws Persi
418418
Resource base = resolver.getResource(HISTORY_BASE);
419419
Calendar calendar = new GregorianCalendar();
420420
calendar.add(Calendar.DAY_OF_MONTH, -daysToKeep);
421-
LOG.debug("Starting purge with limit " + calendar.getTime().toString());
421+
LOG.debug("Starting purge with limit {}", calendar.getTime());
422422
deleteRecursive(base.listChildren(), calendar, new int[] {Calendar.YEAR, Calendar.MONTH, Calendar.DAY_OF_MONTH});
423423
}
424424

@@ -437,7 +437,7 @@ private void deleteRecursive(Iterator<Resource> resources, Calendar calendar, in
437437
String name = resource.getName();
438438
// skip extra nodes such as ACLs
439439
if (!StringUtils.isNumeric(name)) {
440-
LOG.debug("Skipping purge of other node: " + resource.getPath());
440+
LOG.debug("Skipping purge of other node: {}", resource.getPath());
441441
continue;
442442
}
443443
int nodeValue = Integer.parseInt(name);
@@ -447,9 +447,9 @@ private void deleteRecursive(Iterator<Resource> resources, Calendar calendar, in
447447
limit++;
448448
}
449449
if (nodeValue > limit) {
450-
LOG.debug("Skipping purge of too young node: " + resource.getPath());
450+
LOG.debug("Skipping purge of too young node: {}", resource.getPath());
451451
} else if (nodeValue == limit) {
452-
LOG.debug("Skipping purge of too young node: " + resource.getPath());
452+
LOG.debug("Skipping purge of too young node: {}", resource.getPath());
453453
// check next level
454454
if (fields.length == 1) {
455455
return;
@@ -458,7 +458,7 @@ private void deleteRecursive(Iterator<Resource> resources, Calendar calendar, in
458458
System.arraycopy(fields, 1, fieldsNew, 0, fieldsNew.length);
459459
deleteRecursive(resource.listChildren(), calendar, fieldsNew);
460460
} else {
461-
LOG.debug("Purging node: " + resource.getPath());
461+
LOG.debug("Purging node: {}", resource.getPath());
462462
BatchResourceRemover remover = ResourceUtil.getBatchResourceRemover(1000);
463463
remover.delete(resource);
464464
}

core/src/main/java/de/valtech/aecu/core/installhook/AecuTrackerListener.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public void onMessage(Mode mode, String action, String path) {
108108
}
109109

110110
if (!ACTIONS.contains(action) && isValid(path)) {
111-
LOG.debug(String.format("Skipping %s due to non matching action '%s'", path, action));
111+
LOG.debug("Skipping {} due to non matching action '{}'", path, action);
112112
return;
113113
}
114114

core/src/main/java/de/valtech/aecu/core/model/execute/ExecuteDataSource.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void setup() throws AecuException {
7373
List<String> allowedScripts = aecuService.getFiles(path);
7474
ResourceResolver resourceResolver = request.getResourceResolver();
7575
for (String scriptPath : allowedScripts) {
76-
entries.add(new ValueMapResource(resourceResolver, scriptPath, ITEM_TYPE, null));
76+
entries.add(new ValueMapResource(resourceResolver, scriptPath, ITEM_TYPE));
7777
}
7878
}
7979

core/src/main/java/de/valtech/aecu/core/security/AccessValidationService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ private String getUserName(SlingHttpServletRequest request) {
116116
/**
117117
* Returns the AEM groups that belong to the user.
118118
*
119-
* @param user user
119+
* @param request request
120120
* @return group names
121121
*/
122122
private List<String> getUserGroupNames(SlingHttpServletRequest request) {

examples-cloud/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>de.valtech.aecu</groupId>
77
<artifactId>aecu</artifactId>
8-
<version>6.0.2</version>
8+
<version>6.0.3</version>
99
</parent>
1010

1111
<artifactId>aecu.examples-cloud</artifactId>
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
println "AECU migration started"
1+
println "AECU migration started"
2+
3+
aecu.contentUpgradeBuilder()
4+
.forChildResourcesOf("/content/")
5+
.printPath()
6+
.run()
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
aecu.contentUpgradeBuilder()
22
.forChildResourcesOf("/content/")
3-
.printPath()
4-
.run()
3+
.printJson()
4+
.run()

examples/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>de.valtech.aecu</groupId>
77
<artifactId>aecu</artifactId>
8-
<version>6.0.2</version>
8+
<version>6.0.3</version>
99
</parent>
1010

1111
<artifactId>aecu.examples</artifactId>

0 commit comments

Comments
 (0)