Skip to content

Commit

Permalink
Merge branch '4.9.x' into renovate/major-kotlin-monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
radovanradic authored Jul 9, 2024
2 parents 3aec840 + 571f417 commit b5c5c23
Show file tree
Hide file tree
Showing 88 changed files with 1,587 additions and 737 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ jobs:
fetch-depth: 0

- name: "🔧 Setup GraalVM CE"
uses: graalvm/[email protected].1
uses: graalvm/[email protected].2
with:
distribution: 'graalvm'
java-version: ${{ matrix.java }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: "🔧 Setup Gradle"
uses: gradle/gradle-build-action@v3.3.2
uses: gradle/gradle-build-action@v3.4.2

- name: "❓ Optional setup step"
run: |
Expand All @@ -78,7 +78,7 @@ jobs:

- name: "📜 Upload binary compatibility check results"
if: matrix.java == '17'
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: binary-compatibility-reports
path: "**/build/reports/binary-compatibility-*.html"
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ jobs:
# Store the hash in a file, which is uploaded as a workflow artifact.
sha256sum $ARTIFACTS | base64 -w0 > artifacts-sha256
- name: Upload build artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: gradle-build-outputs
path: build/repo/${{ steps.publish.outputs.group }}/*/${{ steps.publish.outputs.version }}/*
retention-days: 5
- name: Upload artifacts-sha256
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: artifacts-sha256
path: artifacts-sha256
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
artifacts-sha256: ${{ steps.set-hash.outputs.artifacts-sha256 }}
steps:
- name: Download artifacts-sha256
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: artifacts-sha256
# The SLSA provenance generator expects the hash digest of artifacts to be passed as a job
Expand Down Expand Up @@ -146,11 +146,9 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Download artifacts
# Important: update actions/download-artifact to v4 only when generator_generic_slsa3.yml is also compatible.
# See https://github.com/slsa-framework/slsa-github-generator/issues/3068
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: gradle-build-outputs
path: build/repo
Expand Down
9 changes: 9 additions & 0 deletions config/checkstyle/custom-suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">

<suppressions>
<suppress checks="FileLength" files=".*AbstractSqlLikeQueryBuilder.*" />
</suppressions>
1 change: 0 additions & 1 deletion config/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
<!-- files="DefaultBeanContext.java|BeanDefinitionWriter.java|DefaultHttpClient.java"/> -->

<suppress checks="MissingJavadocType" files=".*doc-examples.*" />
<suppress checks="FileLength" files=".*AbstractSqlLikeQueryBuilder.*" />
</suppressions>
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
@Requires(property = "azure.cosmos.key")
final class CosmosDatabaseInitializer {

// For a limited time, if the query runs against a region or emulator that has not yet been updated with the
// new NonStreamingOrderBy query feature the client might run into some issue of not being able to recognize this,
// and throw a 400 exception. If the environment variable `AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY` is set to
// True to opt out of this new query feature, then OLD query features will be used to operate correctly.
private static final String DISABLE_NON_STREAMING_ORDER_BY = "COSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY";
private static final Logger LOG = LoggerFactory.getLogger(CosmosDatabaseInitializer.class);

/**
Expand All @@ -82,6 +87,7 @@ void initialize(CosmosClient cosmosClient,
@Nullable
CosmosDiagnosticsProcessor cosmosDiagnosticsProcessor,
CosmosDatabaseConfiguration configuration) {
System.setProperty(DISABLE_NON_STREAMING_ORDER_BY, Boolean.toString(configuration.isDisableNonStreamingOrderBy()));
if (LOG.isDebugEnabled()) {
LOG.debug("Cosmos Db Initialization Start");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public final class CosmosDatabaseConfiguration {

private boolean queryMetricsEnabled = true;

private boolean disableNonStreamingOrderBy = false;

public ThroughputSettings getThroughput() {
return throughput;
}
Expand Down Expand Up @@ -136,6 +138,26 @@ public void setQueryMetricsEnabled(boolean queryMetricsEnabled) {
this.queryMetricsEnabled = queryMetricsEnabled;
}

/**
* Gets an indicator telling whether non-streaming order by is by default disabled.
* By default, it is not disabled currently and users can change it as needed.
* Effectively, this value will be set as "COSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY" env variable.
*
* @return the disabled non-streaming order by indicator
*/
public boolean isDisableNonStreamingOrderBy() {
return disableNonStreamingOrderBy;
}

/**
* Sets an indicator telling whether non-streaming order by is by default disabled.
*
* @param disableNonStreamingOrderBy the disabled non-streaming order by indicator
*/
public void setDisableNonStreamingOrderBy(boolean disableNonStreamingOrderBy) {
this.disableNonStreamingOrderBy = disableNonStreamingOrderBy;
}

/**
* Throughput settings for database.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ trait AzureCosmosTestProperties implements TestPropertyProvider {
System.setProperty("javax.net.ssl.trustStoreType", "PKCS12")

def defaultProps = [
'azure.cosmos.database.disable-non-streaming-order-by' : 'true',
'azure.cosmos.default-gateway-mode' : 'true',
'azure.cosmos.endpoint-discovery-enabled' : 'false',
'azure.cosmos.endpoint' : emulator.getEmulatorEndpoint(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ protected SqlPredicateVisitor createPredicateVisitor(AnnotationMetadata annotati
private static final String ARRAY_CONTAINS = "ARRAY_CONTAINS";

@Override
public void visitIsNull(QueryPropertyPath propertyPath) {
public void visitIsNull(PersistentPropertyPath propertyPath) {
query.append(NOT).append(SPACE).append(IS_DEFINED).append(OPEN_BRACKET);
appendPropertyRef(propertyPath);
query.append(CLOSE_BRACKET).append(SPACE).append(OR).append(SPACE);
Expand All @@ -151,7 +151,7 @@ public void visitIsNull(QueryPropertyPath propertyPath) {
}

@Override
public void visitIsNotNull(QueryPropertyPath propertyPath) {
public void visitIsNotNull(PersistentPropertyPath propertyPath) {
query.append(IS_DEFINED).append(OPEN_BRACKET);
appendPropertyRef(propertyPath);
query.append(CLOSE_BRACKET).append(SPACE).append(AND).append(SPACE);
Expand All @@ -161,7 +161,7 @@ public void visitIsNotNull(QueryPropertyPath propertyPath) {
}

@Override
public void visitIsEmpty(QueryPropertyPath propertyPath) {
public void visitIsEmpty(PersistentPropertyPath propertyPath) {
query.append(NOT).append(SPACE).append(IS_DEFINED).append(OPEN_BRACKET);
appendPropertyRef(propertyPath);
query.append(CLOSE_BRACKET).append(SPACE).append(OR).append(SPACE);
Expand All @@ -173,7 +173,7 @@ public void visitIsEmpty(QueryPropertyPath propertyPath) {
}

@Override
public void visitIsNotEmpty(QueryPropertyPath propertyPath) {
public void visitIsNotEmpty(PersistentPropertyPath propertyPath) {
query.append(IS_DEFINED).append(OPEN_BRACKET);
appendPropertyRef(propertyPath);
query.append(CLOSE_BRACKET).append(SPACE).append(AND).append(SPACE);
Expand All @@ -185,11 +185,11 @@ public void visitIsNotEmpty(QueryPropertyPath propertyPath) {
}

@Override
public void visitArrayContains(QueryPropertyPath leftProperty, Expression<?> expression) {
public void visitArrayContains(PersistentPropertyPath leftProperty, Expression<?> expression) {
query.append(ARRAY_CONTAINS).append(OPEN_BRACKET);
appendPropertyRef(leftProperty);
query.append(COMMA);
appendExpression(leftProperty, expression);
appendExpression(expression, leftProperty);
query.append(COMMA);
query.append("true").append(CLOSE_BRACKET);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import io.micronaut.data.model.jpa.criteria.IPredicate;
import io.micronaut.data.model.jpa.criteria.ISelection;
import io.micronaut.data.model.jpa.criteria.PersistentEntityRoot;
import io.micronaut.data.model.jpa.criteria.impl.CriteriaUtils;
import io.micronaut.data.model.jpa.criteria.impl.SelectionVisitor;
import io.micronaut.data.model.jpa.criteria.impl.expression.BinaryExpression;
import io.micronaut.data.model.jpa.criteria.impl.expression.FunctionExpression;
Expand All @@ -45,6 +46,7 @@
import io.micronaut.data.model.jpa.criteria.impl.expression.UnaryExpression;
import io.micronaut.data.model.jpa.criteria.impl.predicate.ConjunctionPredicate;
import io.micronaut.data.model.jpa.criteria.impl.predicate.DisjunctionPredicate;
import io.micronaut.data.model.jpa.criteria.impl.predicate.LikePredicate;
import io.micronaut.data.model.jpa.criteria.impl.predicate.NegatedPredicate;
import io.micronaut.data.model.jpa.criteria.impl.predicate.PersistentPropertyInPredicate;
import io.micronaut.data.model.jpa.criteria.impl.selection.AliasedSelection;
Expand Down Expand Up @@ -1033,18 +1035,14 @@ public void visitStartsWith(PersistentPropertyPath leftProperty, Expression<?> e
}

@Override
public void visitLike(PersistentPropertyPath leftProperty, Expression<?> expression) {
handleRegexPropertyExpression(leftProperty, false, false, false, false, expression);
}

@Override
public void visitRLike(PersistentPropertyPath leftProperty, Expression<?> expression) {
throw new UnsupportedOperationException("RLike is not supported by this implementation.");
}

@Override
public void visitILike(PersistentPropertyPath leftProperty, Expression<?> expression) {
throw new UnsupportedOperationException("ILike is not supported by this implementation.");
public void visit(LikePredicate likePredicate) {
if (likePredicate.isCaseInsensitive()) {
throw new UnsupportedOperationException("ILike is not supported by this implementation.");
}
handleRegexPropertyExpression(
CriteriaUtils.requireProperty(likePredicate.getExpression()).getPropertyPath(),
false, false, false, false,
likePredicate.getPattern());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,15 @@
"typeReachable": "org.hibernate.event.service.internal.EventListenerGroupImpl"
},
"unsafeAllocated": true
},
{
"name": "org.hibernate.binder.internal.BatchSizeBinder",
"methods": [
{
"name": "<init>",
"parameterTypes": [
]
}
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,4 @@ class H2CursoredPaginationSpec extends AbstractCursoredPageSpec {
return br
}

@Override
void init() {
pr.deleteAll()
}
}
Loading

0 comments on commit b5c5c23

Please sign in to comment.