Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
xtermi2 committed Jan 11, 2023
2 parents e34532a + 9920b43 commit c534c02
Show file tree
Hide file tree
Showing 38 changed files with 846 additions and 211 deletions.
16 changes: 4 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,13 @@ updates:
ignore:
- dependency-name: org.elasticsearch.client:elasticsearch-rest-high-level-client
versions:
- 7.11.x
- 7.12.x
- 7.13.x
- 7.14.x
- 7.15.x
- 7.16.x
- 7.17.x
- 8.x
- dependency-name: org.elasticsearch.client:elasticsearch-rest-client
versions:
- 7.17.x
- 8.x
- dependency-name: org.elasticsearch:elasticsearch
versions:
- 7.11.x
- 7.12.x
- 7.13.x
- 7.14.x
- 7.15.x
- 7.16.x
- 7.17.x
- 8.x
100 changes: 52 additions & 48 deletions .github/workflows/maven-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ on:
branches:
- master
- release
paths-ignore:
- '*.md'
# pull_request to run the pipeline on PRs from external, because "push" does not create this pipeline on external PRs
pull_request:
paths-ignore:
- '*.md'
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '30 5 * * *'
- cron: '11 16 * * 4'

env:
MVN_CMD: "./mvnw --settings .cicd.settings.xml -e -B -V"
Expand All @@ -19,9 +23,9 @@ jobs:
build-and-test-with-jdk:
strategy:
matrix:
java: [ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 ]
java: [ 8, 11, 17, 18, 19 ]
fail-fast: false
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -30,26 +34,26 @@ jobs:
with:
distribution: zulu
java-version: ${{ matrix.java }}
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: |
~/.m2/repository
!~/.m2/repository/com/senacor
~/.m2/wrapper
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# - name: Cache local Maven repository
# uses: actions/cache@v2
# with:
# path: |
# ~/.m2/repository
# !~/.m2/repository/com/senacor
# ~/.m2/wrapper
# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
# restore-keys: |
# ${{ runner.os }}-maven-
- name: Build and test with Maven
run: $MVN_CMD install

build-and-test-with-es-version:
strategy:
matrix:
elasticsearchVersion: [ "8.1.2", "8.0.1", "7.17.2", "7.16.3", "7.15.2", "7.14.2",
elasticsearchVersion: [ "8.6.0", "8.5.3", "8.4.3", "8.3.3", "8.2.3", "8.1.3", "8.0.1", "7.17.8", "7.16.3", "7.15.2", "7.14.2",
"7.13.4", "7.12.1", "7.11.2", "7.10.2", "7.9.3", "7.8.1", "7.7.1", "7.6.2", "7.5.2" ]
fail-fast: false
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -58,16 +62,16 @@ jobs:
with:
distribution: zulu
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: |
~/.m2/repository
!~/.m2/repository/com/senacor
~/.m2/wrapper
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# - name: Cache local Maven repository
# uses: actions/cache@v3
# with:
# path: |
# ~/.m2/repository
# !~/.m2/repository/com/senacor
# ~/.m2/wrapper
# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
# restore-keys: |
# ${{ runner.os }}-maven-
- name: Build and test with Maven
run: $MVN_CMD install -DskipTests
- name: elasticsearch test version ${{ matrix.elasticsearchVersion }}
Expand All @@ -76,8 +80,8 @@ jobs:
release-dry-run:
# this will just build like the real release job, but not do a release (dry run)
needs: [ build-and-test-with-jdk, build-and-test-with-es-version ]
if: ${{ github.event_name != 'pull_request' && github.ref != 'refs/heads/release' }}
runs-on: ubuntu-18.04
if: ${{ github.ref != 'refs/heads/release' }}
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -94,16 +98,16 @@ jobs:
with:
distribution: zulu
java-version: 8
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: |
~/.m2/repository
!~/.m2/repository/com/senacor
~/.m2/wrapper
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# - name: Cache local Maven repository
# uses: actions/cache@v3
# with:
# path: |
# ~/.m2/repository
# !~/.m2/repository/com/senacor
# ~/.m2/wrapper
# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
# restore-keys: |
# ${{ runner.os }}-maven-
- name: Release to maven central
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
Expand All @@ -118,7 +122,7 @@ jobs:
# Release to maven central and create Github release
needs: [ build-and-test-with-jdk, build-and-test-with-es-version ]
if: ${{ github.repository == 'senacor/elasticsearch-evolution' && github.event_name == 'push' && github.ref == 'refs/heads/release' }}
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -135,16 +139,16 @@ jobs:
with:
distribution: zulu
java-version: 8
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: |
~/.m2/repository
!~/.m2/repository/com/senacor
~/.m2/wrapper
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# - name: Cache local Maven repository
# uses: actions/cache@v3
# with:
# path: |
# ~/.m2/repository
# !~/.m2/repository/com/senacor
# ~/.m2/wrapper
# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
# restore-keys: |
# ${{ runner.os }}-maven-
- name: Release to maven central
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
Expand Down
35 changes: 24 additions & 11 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ on:
branches:
- master
- release
paths-ignore:
- '*.md'
pull_request:
paths-ignore:
- '*.md'
schedule:
- cron: '42 16 * * 4'

env:
MVN_CMD: "./mvnw --settings .cicd.settings.xml -e -B -V"

jobs:
code-analysis:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
env:
COVERALLS_REPO_TOKEN_EXISTS: ${{ secrets.COVERALLS_REPO_TOKEN != '' }}
steps:
Expand All @@ -24,16 +30,21 @@ jobs:
with:
distribution: zulu
java-version: 8
- name: Cache local Maven repository
uses: actions/cache@v3
# - name: Cache local Maven repository
# uses: actions/cache@v3
# with:
# path: |
# ~/.m2/repository
# !~/.m2/repository/com/senacor
# ~/.m2/wrapper
# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
# restore-keys: |
# ${{ runner.os }}-maven-
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
path: |
~/.m2/repository
!~/.m2/repository/com/senacor
~/.m2/wrapper
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
languages: 'java'
- name: Build and test with Maven
run: $MVN_CMD install
- name: Execute Maven coveralls Plugin
Expand All @@ -42,4 +53,6 @@ jobs:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_EVENT_PATH: ${{ github.event_path }}
run: $MVN_CMD coveralls:report -DrepoToken=$COVERALLS_REPO_TOKEN -DserviceName=GitHub-Actions
run: $MVN_CMD coveralls:report -DrepoToken=$COVERALLS_REPO_TOKEN -DserviceName=GitHub-Actions
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Successful executed migration scripts will not be executed again!

## 2 Features

- tested on Java 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 and 18
- runs on Spring-Boot 2.1, 2.2, 2.3, 2.4, 2.5 and 2.6 (and of course without Spring-Boot)
- runs on Elasticsearch version 7.5.x - 8.1.x
- runs on Opensearch version 1.x
- tested on Java 8, 11, 17, 18 and 19
- runs on Spring-Boot 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 and 2.7 (and of course without Spring-Boot)
- runs on Elasticsearch version 7.5.x - 8.4.x
- runs on Opensearch version 1.x and 2.x
- highly configurable (e.g. location(s) of your migration files, migration files format pattern)
- placeholder substitution in migration scripts
- easily extendable to your needs
Expand All @@ -33,8 +33,8 @@ Successful executed migration scripts will not be executed again!

| Compatibility | Spring Boot | Elasticsearch | Opensearch |
|----------------------------------|------------------------------|----------------------|------------|
| elasticsearch-evolution >= 0.4.0 | 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 | 7.5.x - 8.1.x | 1.x |
| elasticsearch-evolution >= 0.3.0 | 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 | 7.5.x - 7.17.x | |
| elasticsearch-evolution >= 0.4.0 | 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 | 7.5.x - 8.4.x | 1.x - 2.x |
| elasticsearch-evolution 0.3.x | 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 | 7.5.x - 7.17.x | |
| elasticsearch-evolution 0.2.x | 1.5, 2.0, 2.1, 2.2, 2.3, 2.4 | 7.0.x - 7.4.x, 6.8.x | |

NOTE: When you run on Java 11 and using spring-boot 2.2 or 2.3 and you hit [this issue](https://github.com/ronmamo/reflections/issues/279), you have 2 options:
Expand All @@ -52,7 +52,7 @@ First add the latest version of Elasticsearch-Evolution spring boot starter as a
<dependency>
<groupId>com.senacor.elasticsearch.evolution</groupId>
<artifactId>spring-boot-starter-elasticsearch-evolution</artifactId>
<version>0.3.2</version>
<version>0.4.0</version>
</dependency>
```

Expand All @@ -76,7 +76,7 @@ First add the latest version of Elasticsearch-Evolution core as a dependency:
<dependency>
<groupId>com.senacor.elasticsearch.evolution</groupId>
<artifactId>elasticsearch-evolution-core</artifactId>
<version>0.3.2</version>
<version>0.4.0</version>
</dependency>
```

Expand Down Expand Up @@ -192,6 +192,8 @@ Elasticsearch-Evolution can be configured to your needs:
- **placeholderSuffix** (default=}): Suffix of placeholders in migration scripts.
- **historyIndex** (default=es_evolution): Name of the history index that will be used by Elasticsearch-Evolution. In this index Elasticsearch-Evolution will persist his internal state and tracks which migration script has already been executed.
- **historyMaxQuerySize** (default=1000): The maximum query size while validating already executed scripts. This query size have to be higher than the total count of your migration scripts.
- **validateOnMigrate** (default=true): Whether to fail when a previously applied migration script has been modified after it was applied.
- **baselineVersion** (default=1.0): Version to use as a baseline. versions lower than it will not be applied.

### 5.1 Spring Boot

Expand Down Expand Up @@ -286,7 +288,18 @@ ElasticsearchEvolution.configure()

## 6 changelog

### v0.4.0-SNAPSHOT
### v0.4.1-SNAPSHOT

- Optimization: Don't acquire lock if no scripts need to be executed ([#172](https://github.com/senacor/elasticsearch-evolution/issues/172))
- Previously applied migration scripts are now checked for modifications and rejected if they've been modified after they were applied. The old behaviour can be restored by setting the new configuration parameter `validateOnMigrate` to false (default: true) ([#155](https://github.com/senacor/elasticsearch-evolution/issues/155))
- version updates (spring-boot 2.7.7)
- added java 19 compatibility tests
- added spring boot 2.7 compatibility tests
- added Elasticsearch 8.6, 8.5, 8.4, 8.3, and 8,2 compatibility test
- added Opensearch 2.3, 2.2, 2.1 and 2.0 compatibility tests
- It is now possible to set a `baselineVersion` to skip migrations with versions lower than the defined `baselineVersion` ([#164](https://github.com/senacor/elasticsearch-evolution/issues/164))

### v0.4.0

- **breaking change**: drop `org.elasticsearch.client.RestHighLevelClient` and replace with `org.elasticsearch.client.RestClient` (LowLevelClient). This will drop the big transitive dependency `org.elasticsearch:elasticsearch` and opens compatibility to Elasticsearch 8 and OpenSearch.
- version updates (spring-boot 2.6.6)
Expand Down
16 changes: 16 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Security Policy

## Supported Versions

Only the latest version is supported with security updates:

| Version | Supported |
|---------| ------------------ |
| 0.4.x | :white_check_mark: |
| < 0.4 | :x: |

## Reporting a Vulnerability

### Please do not use GitHub issues for security-sensitive communication.

You should contact one of the repository [maintainer](https://github.com/orgs/senacor/teams/elasticsearch-evolution-maintainers) or one of its main [contributor](https://github.com/senacor/elasticsearch-evolution/graphs/contributors) via email (visible in users GitHub profile).
2 changes: 1 addition & 1 deletion elasticsearch-evolution-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.senacor.elasticsearch.evolution</groupId>
<artifactId>elasticsearch-evolution-parent</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<relativePath>../</relativePath>
</parent>
<artifactId>elasticsearch-evolution-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ protected MigrationService createMigrationService() {
10_000,
getRestClient(),
ContentType.parse(getConfig().getDefaultContentType()),
getConfig().getEncoding());
getConfig().getEncoding(),
getConfig().getValidateOnMigrate(),
getConfig().getBaselineVersion());
}
}
Loading

0 comments on commit c534c02

Please sign in to comment.