Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ jobs:
steps:
# Setup java environment
- name: setup-java
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 11
distribution: temurin
java-version: 17

# Checkout the git repository
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GPR_TOKEN }}
Expand All @@ -33,7 +34,7 @@ jobs:

# Setup/load GitHub Actions caching for external dependencies, in this case especially for Maven
- name: caching
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand All @@ -58,7 +59,7 @@ jobs:
SONAR_TOKEN: ${{ secrets.OS_SONAR_TOKEN }}
run: |
export SONAR_ORGANIZATION=$(echo ${GITHUB_REPOSITORY} | cut -d / -f 1)
mvn sonar:sonar \
mvn org.sonarsource.scanner.maven:sonar-maven-plugin:5.0.0.4389:sonar \
-Dsonar.host.url=${SONAR_HOST} \
-Dsonar.login=${SONAR_TOKEN} \
-Dsonar.organization=${SONAR_ORGANIZATION} \
Expand Down
24 changes: 11 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ jobs:
steps:
# Setup java environment
- name: setup-java
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 11
distribution: temurin
java-version: 17
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
Expand All @@ -38,7 +39,7 @@ jobs:

# Checkout the git repository
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GPR_TOKEN }}
Expand All @@ -50,7 +51,7 @@ jobs:

# Setup GitHub Actions caching for external dependencies, in this case especially for Maven
- name: caching
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand All @@ -71,7 +72,7 @@ jobs:
SONAR_TOKEN: ${{ secrets.OS_SONAR_TOKEN }}
run: |
export SONAR_ORGANIZATION=$(echo ${GITHUB_REPOSITORY} | cut -d / -f 1)
mvn sonar:sonar \
mvn org.sonarsource.scanner.maven:sonar-maven-plugin:5.0.0.4389:sonar \
-Dsonar.host.url=${SONAR_HOST} \
-Dsonar.login=${SONAR_TOKEN} \
-Dsonar.organization=${SONAR_ORGANIZATION} \
Expand All @@ -81,7 +82,7 @@ jobs:
# Get the current project version from POM
- name: get-project-version
id: get_project_version
uses: avides/actions-project-version-check@v1
uses: avides/actions-project-version-check@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
file-to-check: pom.xml
Expand All @@ -93,19 +94,16 @@ jobs:
env:
PROJECT_VERSION: ${{ steps.get_project_version.outputs.version }}
run: |
echo ::set-output name=gitcommitmessage::$(git log --no-merges -1 --oneline)
echo "gitcommitmessage=$(git log --no-merges -1 --oneline)" >> $GITHUB_OUTPUT
if [[ "$PROJECT_VERSION" == *"SNAPSHOT"* || "$PROJECT_VERSION" == *"RC"* ]]; then
echo ::set-output name=isprerelease::true
echo "isprerelease=true" >> $GITHUB_OUTPUT
fi

# Create and publish GitHub Release tag
- name: github-release
uses: actions/create-release@v1
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GPR_TOKEN }}
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GPR_TOKEN }}
tag_name: ${{ steps.get_project_version.outputs.version }}
release_name: ${{ steps.get_project_version.outputs.version }}
body: ${{ steps.setup_github_release.outputs.gitcommitmessage }}
prerelease: ${{ steps.setup_github_release.outputs.isprerelease }}
62 changes: 36 additions & 26 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,24 @@ on:
jobs:
review:
timeout-minutes: 30

runs-on: ubuntu-latest

steps:
# Cancels previous run for this branch that have a different commit id (SHA)
- name: cancel-previous-run
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

steps:
# Setup java environment
- name: setup-java
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 11
distribution: temurin
java-version: 17

# Checkout the git repository
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GPR_TOKEN }}
Expand All @@ -39,14 +38,14 @@ jobs:

# Update GitHub Action configuration if necessary
- name: action-configuration-autoupdate
uses: avides/actions-action-configuration-autoupdate@v1
uses: avides/actions-action-configuration-autoupdate@v2
with:
token: ${{ secrets.GPR_TOKEN }}
actions-configuration-files: os-java-library/nightly.yml,os-java-library/release.yml,os-java-library/review.yml
source-repository: ${{ secrets.ACTIONS_CONFIG_AUTOUPDATE_REPO }}

# Push updated GitHub Actions configuration if necessary
- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: .github/workflows/*.yml
commit_user_name: ${{ secrets.ACTIONS_CONFIG_AUTOUPDATE_USER }}
Expand All @@ -56,34 +55,45 @@ jobs:

# Verify project version is updated
- name: project-version-check
uses: avides/actions-project-version-check@v1
uses: avides/actions-project-version-check@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
file-to-check: pom.xml
additional-files-to-check: README.md

# Check if documentation reminder comment is already given
- name: find-documentation-reminder-comment
uses: peter-evans/find-comment@v1
id: find_documentation_reminder_comment
# Check if reminder comment is already given
- name: find-reminder-comment
uses: peter-evans/find-comment@v3
id: find_reminder_comment
with:
issue-number: ${{ github.event.number }}
body-includes: "Confluence/GitHub documentation added or updated?"

# Add documentation reminder comment if not given
- name: documentation-reminder-comment
uses: jungwinter/comment@v1
# Add reminder comment if not given
- name: reminder-comment
uses: peter-evans/create-or-update-comment@v4
id: create
if: ${{ steps.find_documentation_reminder_comment.outputs.comment-id == 0 }}
if: ${{ steps.find_reminder_comment.outputs.comment-id == 0 }}
with:
type: create
body: 'Confluence/GitHub documentation added or updated?'
issue_number: ${{ github.event.number }}
body: |
- Confluence/GitHub documentation added or updated?
- Diff-Links as response added?
- [ ] Not necessary
- [ ] Added

- [Breaking-Change](<https://avides.atlassian.net/wiki/spaces/ITENT/pages/211498/Wann+habe+ich+einen+breaking+change>) present?
- Necessary deployment adjustments added as a comment (Jira-Ticket)?
- [ ] Not necessary
- [ ] Added
- Necessary rollback adjustments added as a comment (Jira-Ticket)?
- [ ] Not necessary
- [ ] Added
issue-number: ${{ github.event.number }}
token: ${{ secrets.GITHUB_TOKEN }}

# Setup/load GitHub Actions caching for external dependencies, in this case especially for Maven
- name: caching
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand All @@ -109,7 +119,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export SONAR_ORGANIZATION=$(echo ${GITHUB_REPOSITORY} | cut -d / -f 1)
mvn sonar:sonar \
mvn org.sonarsource.scanner.maven:sonar-maven-plugin:5.0.0.4389:sonar \
-Dsonar.host.url=${SONAR_HOST} \
-Dsonar.login=${SONAR_TOKEN} \
-Dsonar.organization=${SONAR_ORGANIZATION} \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dependency>
<groupId>com.avides.springboot.springtainer</groupId>
<artifactId>springtainer-elasticsearch</artifactId>
<version>1.4.0</version>
<version>2.0.0</version>
<scope>test</scope>
</dependency>
```
Expand All @@ -25,7 +25,7 @@ Properties consumed (in `bootstrap.properties`):

- `embedded.container.elasticsearch.enabled` (default is `true`)
- `embedded.container.elasticsearch.startup-timeout` (default is `30`)
- `embedded.container.elasticsearch.docker-image` (default is `docker.elastic.co/elasticsearch/elasticsearch:7.17.9`)
- `embedded.container.elasticsearch.docker-image` (default is `docker.elastic.co/elasticsearch/elasticsearch:8.17.3`)
- `embedded.container.elasticsearch.http-port` (default is `9200`)
- `embedded.container.elasticsearch.transport-host` (default is `9300`)

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>com.avides.springboot.springtainer</groupId>
<artifactId>springtainer-elasticsearch</artifactId>
<version>1.4.0</version>
<version>2.0.0</version>

<name>springtainer-elasticsearch</name>
<description>Elasticsearch test-container</description>
Expand Down Expand Up @@ -63,7 +63,7 @@
<lombok.version>1.18.26</lombok.version>
<junit.version>4.13.2</junit.version>
<slf4j-api.version>1.7.36</slf4j-api.version>
<spring-data-elasticsearch.version>4.3.10</spring-data-elasticsearch.version>
<spring-data-elasticsearch.version>4.4.18</spring-data-elasticsearch.version>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<jackson-core.version>2.13.4</jackson-core.version>
<!-- Testing -->
<jacoco.version>0.8.8</jacoco.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public class ElasticsearchProperties extends AbstractEmbeddedContainerProperties

public ElasticsearchProperties()
{
setDockerImage("docker.elastic.co/elasticsearch/elasticsearch:7.17.9");
setDockerImage("docker.elastic.co/elasticsearch/elasticsearch:8.17.3");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ protected List<String> getEnvs()
List<String> envs = new ArrayList<>();
envs.add("discovery.type=single-node");
envs.add("xpack.security.enabled=false");
envs.add("xpack.monitoring.enabled=false");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.elastic.co/guide/en/elasticsearch/reference/current/monitoring-settings.html#general-monitoring-settings
https://www.elastic.co/guide/en/elasticsearch/reference/current/migrating-8.0.html

Settings used to disable basic license features have been removed.
Details
The following settings were deprecated in Elasticsearch 7.8.0 and have been removed in Elasticsearch 8.0.0:

xpack.enrich.enabled
xpack.flattened.enabled
xpack.ilm.enabled
xpack.monitoring.enabled
xpack.rollup.enabled
xpack.slm.enabled
xpack.sql.enabled
xpack.transform.enabled
xpack.vectors.enabled
These basic license features are now always enabled.

If you have disabled ILM so that you can use another tool to manage Watcher indices, the newly introduced xpack.watcher.use_ilm_index_management setting may be set to false.

Impact
Discontinue use of the removed settings. Specifying these settings in elasticsearch.yml will result in an error on startup.

envs.add("xpack.ml.enabled=false");
envs.add("xpack.graph.enabled=false");
envs.add("xpack.watcher.enabled=false");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"name": "embedded.container.elasticsearch.docker-image",
"type": "java.lang.String",
"description": "Docker-image",
"defaultValue": "docker.elastic.co/elasticsearch/elasticsearch:7.17.9"
"defaultValue": "docker.elastic.co/elasticsearch/elasticsearch:8.17.3"
},
{
"name": "embedded.container.elasticsearch.http-port",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.springframework.data.elasticsearch.core.query.IndexQuery;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.util.ReflectionUtils;

import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.core.DockerClientBuilder;
Expand Down Expand Up @@ -53,7 +54,14 @@ public ElasticsearchRestTemplate elasticsearchRestTemplate()
{
var builder = RestClient.builder(new HttpHost(host, port));
var client = new RestHighLevelClient(builder);

ReflectionUtils.doWithFields(RestHighLevelClient.class, field ->
{
if (field.getName().equals("useAPICompatibility"))
{
ReflectionUtils.makeAccessible(field);
field.setBoolean(client, true);
}
});
return new ElasticsearchRestTemplate(client);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public void testDefaults()
var properties = new ElasticsearchProperties();
assertTrue(properties.isEnabled());
assertEquals(30, properties.getStartupTimeout());
assertEquals("docker.elastic.co/elasticsearch/elasticsearch:7.17.9", properties.getDockerImage());
assertEquals("docker.elastic.co/elasticsearch/elasticsearch:8.17.3", properties.getDockerImage());

assertEquals(9200, properties.getHttpPort());
assertEquals(9300, properties.getTransportPort());
Expand Down