Skip to content

Commit

Permalink
Merge branch 'release/6.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
nhirrle committed May 30, 2024
2 parents 8e2d7a5 + b9e6fae commit 060d356
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 25 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
- uses: actions/checkout@v4

- name: Set up Java Env
uses: actions/setup-java@v4
with: # The last version will be used by default and available globally via JAVA_HOME.
java-version: |
17
11
distribution: 'temurin'
cache: maven

Expand All @@ -38,11 +40,14 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build with Maven
- name: Build and Test with Maven
env:
JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }}
run: mvn clean install javadoc:javadoc

- name: Build and analyze
- name: Analyze with SonarQube
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=aecu
JAVA_HOME: ${{ env.JAVA_HOME_17_X64 }}
run: mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=aecu
8 changes: 7 additions & 1 deletion HISTORY
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
2024-30-05 6.5.1
- Store result output data in binary property in case data is too big for string property (#233)
- Remove reindex=true property in index definition as it is not allowed (#230)
- Documentation updates on logging
- Documentation update on upgrade for index move

2023-12-07 6.5.0
- Move of aecu.ui.content to /apps/settings to avoid overwrite of the configured weekly operations window (#225)
- New filter method: filterByPropertyIsMultiple() (#
- New filter method: filterByPropertyIsMultiple()
- Documentation update for filter concatenation semantics with regards of AND/OR (#212)
- Documentation update for re-execute logic of groovy scripts installed through InstallHook
- Documentation update for filterWith
Expand Down
18 changes: 17 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Table of contents
4. [Execution of Migration Scripts](#execution)
1. [Startup Hook](#startupHook)
2. [Install Hook](#installHook)
2. [Manual Execution](#manualExecution)
3. [Manual Execution](#manualExecution)
4. [Execution Details](#executionDetails)
5. [History of Past Runs](#history)
6. [Extension to Groovy Console](#groovy)
1. [Content Upgrades](#content_upgrades)
Expand Down Expand Up @@ -163,6 +164,10 @@ Then delete "aem-groovy-console" packages in package manager.

<a name="structure"></a>

## Upgrade from version lower than 5.0.0 (On Premise)

The index was moved from /var/aecu to /oak:index for cloud compatibility reasons, please remove the /var/aecu/oak:index/aecuHistory to avoid duplicate index definitions

# File and Folder Structure

All migration scripts need to be located in:
Expand Down Expand Up @@ -259,6 +264,17 @@ Once execution is done you will see if the script(s) succeeded. Click on the his

<img src="docs/images/run.png">

<a name="executionDetails"></a>

## Execution Details and Output
When executing, `de.valtech.aecu.core.service.AecuServiceImpl` will emit a log statement to inform script is currently being executed, and when execution is done, a second log statement including the result (success, failure, skipped if prechecks failed) is emitted.
To capture these logs, configure a logger on `de.valtech.aecu` with level `INFO` to append/emit logs as you desire.
These logs are helpful if you are executing scripts via hook.

Additionally, as stated above, manual execution provides the UI to indicate which script is currently running. Please note however that if you leave the page while execution is in progress, you will not be able to go back to it to see the execution details again.

In both cases, you can see more details on the execution in the history. See below for more information.

<a name="history"></a>

# History of Past Runs
Expand Down
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>de.valtech.aecu</groupId>
<artifactId>aecu</artifactId>
<version>6.5.0</version>
<version>6.5.1</version>
</parent>

<artifactId>aecu.api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cloud.startup.hook/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>de.valtech.aecu</groupId>
<artifactId>aecu</artifactId>
<version>6.5.0</version>
<version>6.5.1</version>
</parent>

<artifactId>aecu.cloud.startup.hook</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion complete-cloud/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.valtech.aecu</groupId>
<artifactId>aecu</artifactId>
<version>6.5.0</version>
<version>6.5.1</version>
</parent>

<artifactId>aecu.complete.cloud</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion complete/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.valtech.aecu</groupId>
<artifactId>aecu</artifactId>
<version>6.5.0</version>
<version>6.5.1</version>
</parent>

<artifactId>aecu.complete</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>de.valtech.aecu</groupId>
<artifactId>aecu</artifactId>
<version>6.5.0</version>
<version>6.5.1</version>
</parent>

<artifactId>aecu.core</artifactId>
Expand Down
31 changes: 30 additions & 1 deletion core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
*/
package de.valtech.aecu.core.history;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
Expand Down Expand Up @@ -50,6 +53,12 @@
import de.valtech.aecu.api.service.HistoryEntry.STATE;
import de.valtech.aecu.core.service.HistoryEntryImpl;

import javax.jcr.Binary;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.ValueFactory;

/**
* Reads and writes history entries.
*
Expand All @@ -69,6 +78,7 @@ public class HistoryUtil {

public static final String ATTR_PATH = "path";
protected static final String ATTR_RUN_OUTPUT = "runOutput";
protected static final String ATTR_RUN_OUTPUT_FULL = "runOutputFull";
protected static final String ATTR_RUN_STATE = "runState";
protected static final String ATTR_RUN_RESULT = "runResult";
protected static final String ATTR_RUN_TIME = "runTime";
Expand All @@ -77,6 +87,9 @@ public class HistoryUtil {
protected static final String ATTR_START = "start";
protected static final String ATTR_END = "end";
private static final String NAME_INDEX = "oak:index";
// This size is limited by the LuceneDocumentMaker to be able to read the property and create the new index
// The limit is 102400 but just to be in the safe side, is set to a bit lower number
private static final int MAXIMUM_PROPERTY_SIZE = 100000;

private Random random = new Random();

Expand Down Expand Up @@ -358,7 +371,23 @@ private void saveExecutionResultInHistory(ExecutionResult result, String path, R
values.put(ATTR_RUN_STATE, result.getState().name());
values.put(ATTR_PATH, result.getPath());
if (StringUtils.isNotBlank(result.getOutput())) {
values.put(ATTR_RUN_OUTPUT, result.getOutput());
if (result.getOutput().getBytes(StandardCharsets.UTF_8).length < MAXIMUM_PROPERTY_SIZE) {
values.put(ATTR_RUN_OUTPUT, result.getOutput());
} else {
values.put(ATTR_RUN_OUTPUT, "Output data too big, full data is stored as a binary in runOutputFull");
LOG.info("Script result is bigger than 100 000 bytes. Full data can be found as a binary in property runOutputFull for path {}", path );
try {
Node node = entry.adaptTo(Node.class);
Session session = node.getSession();
ValueFactory factory = session.getValueFactory();
InputStream is = new ByteArrayInputStream(result.getOutput().getBytes());
Binary binary = factory.createBinary(is);
node.setProperty(ATTR_RUN_OUTPUT_FULL, binary);
session.save();
} catch (RepositoryException e) {
LOG.error("Not able to save the output of the script as binary on the History node [{}]", entry.getPath());
}
}
}
if (StringUtils.isNotBlank(result.getResult())) {
values.put(ATTR_RUN_RESULT, result.getResult());
Expand Down
4 changes: 2 additions & 2 deletions docs/developers.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# AEM Server Setup

By default AEM is expected to listen on localhost on port 5702. This setting can be overridden by adding parameters:
By default AEM is expected to listen on localhost on port 4502. This setting can be overridden by adding parameters:
* -Daem.port=5702
* -Daem.host=localhost
* -Daem.publish.port=5703
* -Daem.publish.host=localhost

You need AEM 6.3 with service pack 2 or AEM 6.4.
You need AEM 6.5 with Servicepack 13 or AEM Cloud SDK.

# Build and Deploy

Expand Down
2 changes: 1 addition & 1 deletion examples-cloud/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.valtech.aecu</groupId>
<artifactId>aecu</artifactId>
<version>6.5.0</version>
<version>6.5.1</version>
</parent>

<artifactId>aecu.examples-cloud</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.valtech.aecu</groupId>
<artifactId>aecu</artifactId>
<version>6.5.0</version>
<version>6.5.1</version>
</parent>

<artifactId>aecu.examples</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion oak.index/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.valtech.aecu</groupId>
<artifactId>aecu</artifactId>
<version>6.5.0</version>
<version>6.5.1</version>
</parent>

<artifactId>aecu.oak.index</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
async="async"
compatVersion="{Long}2"
evaluatePathRestrictions="{Boolean}true"
reindex="{Boolean}false"
reindexCount="{Long}0"
type="lucene"
includedPaths="[/var/aecu]"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>de.valtech.aecu</groupId>
<artifactId>aecu</artifactId>
<packaging>pom</packaging>
<version>6.5.0</version>
<version>6.5.1</version>
<name>AECU</name>
<description>AEM Easy Content Upgrade</description>
<url>https://github.com/valtech/aem-easy-content-upgrade</url>
Expand Down
2 changes: 1 addition & 1 deletion ui.apps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.valtech.aecu</groupId>
<artifactId>aecu</artifactId>
<version>6.5.0</version>
<version>6.5.1</version>
</parent>

<artifactId>aecu.ui.apps</artifactId>
Expand Down

0 comments on commit 060d356

Please sign in to comment.